From 14a2330d7b4edbb294b77072f99283cdd0fa6bae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 9 May 2011 02:45:52 +0000 Subject: [PATCH] copied across changes which were missed by merging. --- .../cmake/example_scripts/make_quicky.py | 13 +- doc/BL-license.txt | 35 - doc/bf-members.txt | 1393 ----------------- doc/blender.1 | 338 ---- extern/libopenjpeg/CMakeLists.txt | 1 - intern/SoundSystem/CMakeLists.txt | 42 - intern/SoundSystem/Makefile | 70 - intern/SoundSystem/SConscript | 20 - intern/SoundSystem/SND_C-api.h | 354 ----- intern/SoundSystem/SND_CDObject.h | 83 - intern/SoundSystem/SND_DependKludge.h | 50 - intern/SoundSystem/SND_DeviceManager.h | 79 - intern/SoundSystem/SND_IAudioDevice.h | 343 ---- intern/SoundSystem/SND_Scene.h | 104 -- intern/SoundSystem/SND_SoundListener.h | 82 - intern/SoundSystem/SND_SoundObject.h | 159 -- intern/SoundSystem/SND_Utils.h | 111 -- intern/SoundSystem/SND_WaveCache.h | 66 - intern/SoundSystem/SND_WaveSlot.h | 92 -- intern/SoundSystem/SND_test/Makefile | 48 - intern/SoundSystem/SND_test/SND_test.c | 154 -- intern/SoundSystem/SoundDefines.h | 107 -- intern/SoundSystem/dummy/Makefile | 42 - intern/SoundSystem/dummy/SND_DummyDevice.cpp | 52 - intern/SoundSystem/dummy/SND_DummyDevice.h | 93 -- intern/SoundSystem/intern/Makefile | 44 - intern/SoundSystem/intern/SND_AudioDevice.cpp | 242 --- intern/SoundSystem/intern/SND_AudioDevice.h | 115 -- intern/SoundSystem/intern/SND_C-api.cpp | 392 ----- intern/SoundSystem/intern/SND_CDObject.cpp | 182 --- .../SoundSystem/intern/SND_DeviceManager.cpp | 126 -- intern/SoundSystem/intern/SND_IdObject.cpp | 76 - intern/SoundSystem/intern/SND_IdObject.h | 58 - intern/SoundSystem/intern/SND_Scene.cpp | 544 ------- .../SoundSystem/intern/SND_SoundListener.cpp | 185 --- intern/SoundSystem/intern/SND_SoundObject.cpp | 508 ------ intern/SoundSystem/intern/SND_Utils.cpp | 424 ----- intern/SoundSystem/intern/SND_WaveCache.cpp | 138 -- intern/SoundSystem/intern/SND_WaveSlot.cpp | 180 --- .../SoundSystem/make/msvc_6_0/SoundSystem.dsp | 206 --- .../make/msvc_6_0/dummy/DummySoundSystem.dsp | 103 -- .../msvc_6_0/openal/OpenALSoundSystem.dsp | 106 -- .../make/msvc_7_0/SoundSystem.vcproj | 339 ---- .../msvc_7_0/dummy/DummySoundSystem.vcproj | 243 --- .../msvc_7_0/openal/OpenALSoundSystem.vcproj | 249 --- .../make/msvc_9_0/SoundSystem.vcproj | 447 ------ .../msvc_9_0/dummy/DummySoundSystem.vcproj | 343 ---- .../msvc_9_0/openal/OpenALSoundSystem.vcproj | 351 ----- intern/SoundSystem/openal/Makefile | 44 - .../SoundSystem/openal/SND_OpenALDevice.cpp | 854 ---------- intern/SoundSystem/openal/SND_OpenALDevice.h | 107 -- intern/SoundSystem/openal/pthread_cancel.cpp | 67 - intern/SoundSystem/sdl/Makefile | 43 - intern/SoundSystem/sdl/SND_SDLCDDevice.cpp | 171 -- intern/SoundSystem/sdl/SND_SDLCDDevice.h | 58 - .../CTR_HashedPtr.h} | 41 +- intern/decimation/SConscript | 1 - intern/elbeem/intern/elbeem.h | 262 ---- intern/guardedalloc/SConscript | 1 - intern/itasc/kdl/frameacc.hpp | 12 +- intern/opennl/superlu/sgstrf.c | 2 +- intern/string/SConscript | 1 - release/plugins/sequence/Makefile | 35 - release/scripts/export_cal3d.py | 1112 ------------- release/scripts/modules/bpy/app.py | 26 - release/scripts/modules/bpy_ops.py | 200 --- release/scripts/modules/dynamic_menu.py | 111 -- release/scripts/op/add_mesh_torus.py | 154 -- release/scripts/op/animsys_update.py | 708 --------- release/scripts/op/console_python.py | 294 ---- release/scripts/op/fcurve_euler_filter.py | 90 -- release/scripts/op/image.py | 205 --- release/scripts/op/mesh.py | 183 --- release/scripts/op/nla.py | 185 --- release/scripts/op/object.py | 574 ------- release/scripts/op/object_align.py | 300 ---- .../scripts/op/object_randomize_transform.py | 167 -- release/scripts/op/presets.py | 364 ----- .../scripts/op/screen_play_rendered_anim.py | 157 -- release/scripts/op/sequencer.py | 146 -- release/scripts/op/uv.py | 381 ----- release/scripts/op/uvcalc_follow_active.py | 264 ---- release/scripts/op/uvcalc_smart_project.py | 1142 -------------- release/scripts/op/vertexpaint_dirt.py | 190 --- release/scripts/op/wm.py | 859 ---------- release/scripts/presets/interaction/maya.py | 378 +---- release/scripts/startup/bl_ui/space_info.py | 2 - release/scripts/templates/operator.py | 63 - release/scripts/uv_from_adjacent.py | 129 -- release/windows/installer/01.installer.bmp | Bin 0 -> 154542 bytes source/blender/editors/armature/poseobject.c | 6 +- .../editors/interface/interface_handlers.c | 2 +- source/blender/editors/mesh/CMakeLists.txt | 5 +- source/blender/editors/mesh/bmesh_tools.c | 4 + source/blender/editors/object/object_add.c | 3 +- .../editors/object/object_constraint.c | 2 +- source/blender/editors/object/object_edit.c | 4 +- .../blender/editors/object/object_relations.c | 14 +- .../blender/editors/object/object_transform.c | 9 +- source/blender/editors/object/object_vgroup.c | 2 +- source/blender/editors/screen/Makefile | 68 - source/blender/editors/space_file/Makefile | 76 - source/blender/editors/space_image/Makefile | 77 - source/blender/editors/space_info/Makefile | 56 - source/blender/gpu/GPU_material.h | 2 +- .../blender/ikplugin/intern/itasc_plugin.cpp | 14 +- source/blender/makesdna/intern/SConscript | 3 - source/blender/makesdna/intern/makesdna.c | 2 - source/blender/makesrna/intern/SConscript | 1 + source/blender/makesrna/intern/makesrna.c | 1 - .../blender/makesrna/intern/rna_constraint.c | 2 +- source/blender/makesrna/intern/rna_fcurve.c | 2 +- source/blender/makesrna/intern/rna_object.c | 1 - .../makesrna/rna_cleanup/rna_properties.txt | 1 - .../makesrna/rna_cleanup/rna_update.sh | 1 - .../nodes/intern/SHD_nodes/SHD_output.c | 2 +- source/blender/python/BPY_menus.c | 1118 ------------- source/blender/python/BPY_menus.h | 128 -- source/blender/python/Makefile | 34 - source/blender/python/epy_doc_gen.py | 753 --------- source/blender/python/intern/Makefile | 67 - source/blender/python/intern/bpy_rna.h | 1 - source/blender/python/intern/bpy_ui.c | 69 - source/blender/python/intern/bpy_ui.h | 31 - source/blender/python/simple_enum_gen.py | 54 +- .../readblenfile/intern/BLO_readblenfile.c | 1 + .../render/intern/raytrace/reorganize.h | 8 +- .../blender/render/intern/source/pipeline.c | 2 +- .../render/intern/source/pointdensity.c | 4 +- .../render/intern/source/shadeoutput.c | 35 +- source/blender/windowmanager/CMakeLists.txt | 3 +- .../windowmanager/intern/wm_event_system.c | 9 +- .../windowmanager/intern/wm_operators.c | 12 +- .../blender/windowmanager/intern/wm_window.c | 4 +- source/creator/CMakeLists.txt | 6 +- source/creator/creator.c | 4 +- source/gameengine/Ketsji/SConscript | 1 - source/gameengine/Rasterizer/SConscript | 1 - 138 files changed, 156 insertions(+), 22164 deletions(-) delete mode 100644 doc/BL-license.txt delete mode 100644 doc/bf-members.txt delete mode 100644 doc/blender.1 delete mode 100644 intern/SoundSystem/CMakeLists.txt delete mode 100644 intern/SoundSystem/Makefile delete mode 100644 intern/SoundSystem/SConscript delete mode 100644 intern/SoundSystem/SND_C-api.h delete mode 100644 intern/SoundSystem/SND_CDObject.h delete mode 100644 intern/SoundSystem/SND_DependKludge.h delete mode 100644 intern/SoundSystem/SND_DeviceManager.h delete mode 100644 intern/SoundSystem/SND_IAudioDevice.h delete mode 100644 intern/SoundSystem/SND_Scene.h delete mode 100644 intern/SoundSystem/SND_SoundListener.h delete mode 100644 intern/SoundSystem/SND_SoundObject.h delete mode 100644 intern/SoundSystem/SND_Utils.h delete mode 100644 intern/SoundSystem/SND_WaveCache.h delete mode 100644 intern/SoundSystem/SND_WaveSlot.h delete mode 100644 intern/SoundSystem/SND_test/Makefile delete mode 100644 intern/SoundSystem/SND_test/SND_test.c delete mode 100644 intern/SoundSystem/SoundDefines.h delete mode 100644 intern/SoundSystem/dummy/Makefile delete mode 100644 intern/SoundSystem/dummy/SND_DummyDevice.cpp delete mode 100644 intern/SoundSystem/dummy/SND_DummyDevice.h delete mode 100644 intern/SoundSystem/intern/Makefile delete mode 100644 intern/SoundSystem/intern/SND_AudioDevice.cpp delete mode 100644 intern/SoundSystem/intern/SND_AudioDevice.h delete mode 100644 intern/SoundSystem/intern/SND_C-api.cpp delete mode 100644 intern/SoundSystem/intern/SND_CDObject.cpp delete mode 100644 intern/SoundSystem/intern/SND_DeviceManager.cpp delete mode 100644 intern/SoundSystem/intern/SND_IdObject.cpp delete mode 100644 intern/SoundSystem/intern/SND_IdObject.h delete mode 100644 intern/SoundSystem/intern/SND_Scene.cpp delete mode 100644 intern/SoundSystem/intern/SND_SoundListener.cpp delete mode 100644 intern/SoundSystem/intern/SND_SoundObject.cpp delete mode 100644 intern/SoundSystem/intern/SND_Utils.cpp delete mode 100644 intern/SoundSystem/intern/SND_WaveCache.cpp delete mode 100644 intern/SoundSystem/intern/SND_WaveSlot.cpp delete mode 100644 intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp delete mode 100644 intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp delete mode 100644 intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp delete mode 100644 intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj delete mode 100644 intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj delete mode 100644 intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj delete mode 100644 intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj delete mode 100644 intern/SoundSystem/make/msvc_9_0/dummy/DummySoundSystem.vcproj delete mode 100644 intern/SoundSystem/make/msvc_9_0/openal/OpenALSoundSystem.vcproj delete mode 100644 intern/SoundSystem/openal/Makefile delete mode 100644 intern/SoundSystem/openal/SND_OpenALDevice.cpp delete mode 100644 intern/SoundSystem/openal/SND_OpenALDevice.h delete mode 100644 intern/SoundSystem/openal/pthread_cancel.cpp delete mode 100644 intern/SoundSystem/sdl/Makefile delete mode 100644 intern/SoundSystem/sdl/SND_SDLCDDevice.cpp delete mode 100644 intern/SoundSystem/sdl/SND_SDLCDDevice.h rename intern/{SoundSystem/SND_Object.h => container/CTR_HashedPtr.h} (59%) delete mode 100644 intern/elbeem/intern/elbeem.h delete mode 100644 release/plugins/sequence/Makefile delete mode 100644 release/scripts/export_cal3d.py delete mode 100644 release/scripts/modules/bpy/app.py delete mode 100644 release/scripts/modules/bpy_ops.py delete mode 100644 release/scripts/modules/dynamic_menu.py delete mode 100644 release/scripts/op/add_mesh_torus.py delete mode 100644 release/scripts/op/animsys_update.py delete mode 100644 release/scripts/op/console_python.py delete mode 100644 release/scripts/op/fcurve_euler_filter.py delete mode 100644 release/scripts/op/image.py delete mode 100644 release/scripts/op/mesh.py delete mode 100644 release/scripts/op/nla.py delete mode 100644 release/scripts/op/object.py delete mode 100644 release/scripts/op/object_align.py delete mode 100644 release/scripts/op/object_randomize_transform.py delete mode 100644 release/scripts/op/presets.py delete mode 100644 release/scripts/op/screen_play_rendered_anim.py delete mode 100644 release/scripts/op/sequencer.py delete mode 100644 release/scripts/op/uv.py delete mode 100644 release/scripts/op/uvcalc_follow_active.py delete mode 100644 release/scripts/op/uvcalc_smart_project.py delete mode 100644 release/scripts/op/vertexpaint_dirt.py delete mode 100644 release/scripts/op/wm.py delete mode 100644 release/scripts/templates/operator.py delete mode 100644 release/scripts/uv_from_adjacent.py create mode 100644 release/windows/installer/01.installer.bmp delete mode 100644 source/blender/editors/screen/Makefile delete mode 100644 source/blender/editors/space_file/Makefile delete mode 100644 source/blender/editors/space_image/Makefile delete mode 100644 source/blender/editors/space_info/Makefile delete mode 100644 source/blender/python/BPY_menus.c delete mode 100644 source/blender/python/BPY_menus.h delete mode 100644 source/blender/python/Makefile delete mode 100644 source/blender/python/epy_doc_gen.py delete mode 100644 source/blender/python/intern/Makefile delete mode 100644 source/blender/python/intern/bpy_ui.c delete mode 100644 source/blender/python/intern/bpy_ui.h diff --git a/build_files/cmake/example_scripts/make_quicky.py b/build_files/cmake/example_scripts/make_quicky.py index 05850254867..a4e0d3371f1 100755 --- a/build_files/cmake/example_scripts/make_quicky.py +++ b/build_files/cmake/example_scripts/make_quicky.py @@ -20,6 +20,7 @@ # + def print_help(targets): print("CMake quicky wrapper, no valid targets given.") print(" * targets can contain a subset of the full target name.") @@ -36,11 +37,11 @@ def print_help(targets): for t in targets: print(" %s" % t) print("...exiting") - + def main(): targets = set() - + # collect targets makefile = open("Makefile", "r") for line in makefile: @@ -54,13 +55,12 @@ def main(): line = line.split(":", 1)[0] - if "/" in line: # cmake terget options, dont need these + if "/" in line: # cmake terget options, dont need these continue targets.add(line) makefile.close() - # remove cmake targets bad = set([ "help", @@ -75,9 +75,8 @@ def main(): "depend", "cmake_check_build_system", ]) - - targets -= set(bad) + targets -= set(bad) # parse args targets = list(targets) @@ -106,7 +105,7 @@ def main(): print(" %s" % t) print("...aborting.") return - + # execute cmd = "make %s %s blender/fast" % (" ".join(args), " ".join(targets_new)) print("cmake building with targets: %s" % " ".join(targets_new)) diff --git a/doc/BL-license.txt b/doc/BL-license.txt deleted file mode 100644 index 3f079767198..00000000000 --- a/doc/BL-license.txt +++ /dev/null @@ -1,35 +0,0 @@ -Blender License (the "BL", see http://www.blender.org/BL/ ). - -Copyright (C) 2002-2005 Blender Foundation. All Rights Reserved. - -This text supersedes the previous BL description, called Blender License 1.0. - -When the Blender source code was released in 2002, the Blender Foundation reserved -the right to offer licenses outside of the GNU GPL. This so-called "dual license" -model was chosen to provide potential revenues for the Blender Foundation. - -The BL has not been activated yet. Partially because; - -- there has to be a clear benefit for Blender itself and its community of - developers and users. -- the developers who have copyrighted additions to the source code need to approve - the decision. -- the (c) holder NaN Holding has to approve on a standard License Contract - -But most important; - -- the Blender Foundation is financially healthy, based on community support - (e-shop sales), sponsoring and subsidy grants -- current focus for the Blender Foundation is to not set up any commercial - activity related to Blender development. -- the GNU GPL provides sufficient freedom for third parties to conduct business - with Blender - -For these reasons we've decided to cancel the BL offering for an indefinite period. - -Third parties interested to discuss usage or exploitation of Blender can email -license@blender.org for further information. - -Ton Roosendaal -Chairman Blender Foundation. -June 2005 diff --git a/doc/bf-members.txt b/doc/bf-members.txt deleted file mode 100644 index 41aad8b7264..00000000000 --- a/doc/bf-members.txt +++ /dev/null @@ -1,1393 +0,0 @@ -Blender Foundation Members - -Special thanks to the following people, who have supported the Blender Foundation -by donating at least USD 50 to pay for opening the Blender sources: -(in chronological order): - -Bradley Keyes -Robert Knop -Thomas Brown -Adam Goodenough -Steven Tally -Jason Tally -Alan Taylor -Pascal COMPAGNON -Christopher Koppler -Matthew P. Carter -Gideon Vaala -F.O. Bossert -Frank Mayhar -Peter Volgyesi -Mark E. Nelmes -Peter Lammers -Craig Maloney -daniel e vertseegh -Freek Zijlmans -Anthony Ogden -Anders Dys -Gerald Saunders -Fernando Cordas -Joshua Smith -Max R. Huskins -imarend -Olaf Arnold -Eric Van Hensbergen -Christian Reichlin -brian moore -Anthony Walker -Carsten Hšfer -Raymond Fordham -David Megginson -Jason Schmidt -Christopher Walden -Robert van Straten -Daniel Schwartz -ekzakt -Jellybean -Streit Eric -Bob Ippolito -Keith Frederick -Ryan Heimbuch -Martin Hess -Shigeo Yoshida -Rens Houben -Jun IIO -Derek Gladding -Adam Wendt -Habib Loew -Jani Turkia -Warren Landon -Chip Lynch -Hans Ruedisueli -Keith Jones -Eugenio Mario Longo -Philippe Tanguay -nekurai -Ricardo Kustner -Peter Van Loock -Jun-ichi OKAMURA -alain dejoux -dario trombino -Kenneth Johansson -Felix Schwarz -Eugenio Diaz -Aoki Katsutoshi -Norman J. Harman Jr. -Ralf Habel -Ken Payne -DEBEUX Sylvain -Douglas Philips -Lai Che Hung -Johan Bolmsjš -Aaron Mitchell -Teinye Horsfall -Martin Marbach -Jason Poole -Cesar Delgado -Gareth Clay -Paul Wasserman -Joeri Sebrechts -Johannes Lehtinen -Marcio L. Teixeira -James A. Peltier -George E. Nimmer III -Matthew Fite -Ken Sedgwick -Gary Baltzell -lukas schroeder -Dan Lyke -Mark Thorpe -A.D. Arul Nirai Selvan -Herbert Pštzl -Andy Payne -LAFFITTE Benoit (KenjForce) -James Ertle -Tom Turelinckx -Rigo Ketelings -Bryan Green -Suzuki Akihiro -Mason Staugler -Guillaume Randon -francois Gombault -Harald Thelen -Graziano Roccon -Jonathan DuBois -Jason Luros -Drew M. Snyder -Jesse DeFer -Michael Keith -Gaetano Tinat -Ferris McCormick -Sherman Boyd -Thomas C Anth Jr -Joseph Catto -Damian Soto -John Walsh -Stephen Rosman -Ross Hopkins -Robert Wenzlaff -Joe Galat -LinuxFrench.NET -Thomas Erichsen -Gary E. Deschaines -Denis McCarthy -Michael Dowman -John (J5) Palmieri -alphawolf -Peter Paul Fink -Charles F. McKnight -Avi Schwartz -Jim Witte -Jens Ansorg -William Bate -Ron Romano -Marc Schraffenberger -Steve Thompson -Martin Whitaker -Kendall Dugger -Brice Due -Simon Vogl -Bernd Koestler -clŽment CORDIER -CreationAnimation.com -Pete Carss -HERSEN Antoine -Charles R. Tersteeg -James T Burnett -Shawn Legrand -David Choice -patrick amaru -David Eck -Gabriel Welsche -Henning von Zitzewitz -Chris Impink -Den Giles -Jon Cisewski -Ricki Myers -Luis Collado -Robert G. Watkins -Rainer Perl -YAGI, Toshiki -Bruno Nitrosso -Athalyba / Blender Brasil -Dave Whittington -Darryl Luscombe -Benjamin A Moore -Andreas Kollegger -Stamatis Logos -Ray Kelm -Albrecht Jacobs -Mirko Horstmann -Ranjit Mathew -Jaron Blackburn -Antonio Hui -Scott Moore -CSN media -Scott Carle -Ted Milker -Lars Brinkhoff -Louise Edwards -Alex Ruano -Art Rozenbaum -Manuel Hossfeld -Brandon Ehle -Lou Bruce -ROMASZEWSKI -cadic jean-yves -Ralf Pietersz -KAZY -serge Jadot -HervŽ LOUINET -Tom Houtman -Magnus Kššhler -Martin Sinnaeve -Kevin Yank -Tomoichi Iriyama -THIBAULT -Dr Steven J. Baines -Hans-Peter Berger -Jeffrey D. Holland -Philip XP Talbot -Peter Haight -Krister Bruhwel -the Smoos -Hohenegger Michael -Alejandro Gabriel y Galan -Boyer -Alwin Eilers -Tyberghein Jorrit -Jaroslav Benkovsky -Gianluigi Belli -Naoki Abe -NOTTE Jean-Pierre -Jack Way -Bjšrn Westlin -Mitch Magee -wizoptic -Jake Edge -David Hoover -Xabier Go–i -Daniel Fort -Erik Noteboom -Pavel Vostatek -Javier Belanche Alonso -Jeffrey Blank -Nathan Ryan -Peter Wrangell -Josef Sie§ -Timm Krumnack -Steve Martin -Shigeru Matsumoto -Marko Kohtala -Aleix Conchillo -Curtis Smith -Tatjana Svizensky -Matt Graham -Karo Launonen -Nikolaj Brandt Jensen -Jean-Michel Smith -Nathan Clegg -Joaquim Carvalho -Bomholt -Martin Imobersteg -Jordan -Justin Warwick -barussaud -Eric Molbert -Ben Berck -Jacco van Beek -Dominic Agoro-Ombaka -Colin Foster -Sascha Adler -Stuart Duncan -Brendon Smith -SŽbastien COLLETTE -Clemens Auer -Kay Fricke -Fabian Fagerholm -Norman Lin -Aaron Digulla -Camilo Moreno -Detlev Reppin -Denis NICOLAS -Armin Antons -Darren Heighington -Mario Latronico -Frank Meier -Joerg Frochte -Matthew Ingle -Anters -Bjoern C. Schaefer -STEMax -Jeff Cox -Trevor Ratliff -Matt Henley -Franois VALETTE -Rob Saunders -Mike Luethi -Rami Aubourg-Kaires -Matthew Thomas -Allan Jacobsen -Adam Lowe -David Hostetler -Lo•c Vigneras -Dan Reiland -Pedro D’az del Arco -Pierre Beyssac -Chris Davey -YOSHIAKI Nishino -Cyber Perk -Fabrizio Cali -Harunobu Yoda -Gerrit Jan Baarda -LarstiQ -Ico Doornekamp -Emiel den Biesen -Willem Zwarthoed -Carl Giesberts -Buzz -lieve vanderschaeve -Margreet de Brie -hans verwaal -Saskia van Dijk -Martin Gosch -Alexander Konopka -Thomas Gebert -Gerard de Vries -Hans Lambermont -Kim Beumer -Kay Thust -Alexander Jung -Tony Corlett -Olivier Thouverey -Hideo Nomoto -Giel Peters -Ray Poynter -Edoardo Galvagno -Pim Feijen -Hua-lun Li -William Reynish -Bryan Carpenter -Jim Scott -NGUYEN Fabien -Dave Stone -Andy Kugyelka -Andrew Ross -MerieJean-Christophe -Marko Mestrovic -Jack -Lars Gunnar West -Wile E. Coyote -Rick Clark -Carlos A. Duque -Franck Barnier -Matt Shirley -Viktor Zacek -Peter Williamson -Chema Celorio -Paul Cleveland -Guo-Rong Koh -Andrew Potter -Daniel Smeltzer -Cativo -Dmitri Bichko -Jeremy Brinkley -Stephen Saville -Michael Proto -Kurt Korbatits -Ruan Muller -Mike Beggs -Beat Schiess -Sven Marcel Buchholz -Enrique Monfort -Simon Posnjak -Steven Ahkim -theGyre -William Marble -Allen Smith -Joshua SS Miller -Mike Edwards (PinkFreud) -Mark D. Butala -Auriea Harvey&Michael Samyn -Randy Newman -Leslie Spring -Marc Schefer -Dean Edmonds -David Whitehouse -Tim Humphrey -Phillip Richdale -Jason McHugh -Claudio de Sario -Artur Kedzierski -Richard Garcia -Isaac Rivas Alvarez -Kiernan Holland -Holger Malessa -Masanori Okuda -Andrea Maracci -Kai-Peter BŠckman -Gregg Patton -Luis M Ibarra -Julian Green -Christian Bender -Mark Winkelman -Ebbe L. Nielsen -Carlos Orozco -magnetHead -KrŸckel Oliver -Thomas Ingham -Wes Devauld -Uwe Steinmann -Jesus Gonzalez -DenMeridiS -Marc Hofer -Marko Mestrovic -Leslie Owen Everett -Knut Bueltemann -Eric Garaventa -Wolfram Schwenzer -Edwin Brouwer -mauro ujetto -Franck Vibert -Daniel Pacheco -Justin Shumaker -Steve Wallace -Forensic Engineering Inc. -Steve Mackay -NDNWarrior -Christopher Gray -Darius Clarke (Socinian) -Jean-SŽbastien SEVESTRE -Douglas Fellows -Craig Symons -Quincin Gonjon -Brian B. Kelley -Kie Brooks -Scott Whitney -kwbrads -Keijiro Takahashi -Geno Ruffalo -Zzeb -Peter Dohnt -Jeff E Schram -ernst bunders -Nobutoshi Shigemori -Mariano Aured -Rab Gordon -Kurt Maurer -Ron Cavagnaro (doogs) -Johan Bjorklund -Cyril M. Hansen -JOSEPH GRACI -Rafael Rubio -fabrice meynard -Emilio Aguirre -Mark Lewis -Markus Q. Roberts -Christoher Bartak -Peter Truog -Eric Dynowski -Philipp GŸhring -Pierre-Yves RANNO -Jason Nollan (Cluh) -Launay Jean-Claude -Wayne Buckhanan -Jan Magne Landsvik -Douglas Dragan Njegovan -Brian David Hale -Randal Walser -Matthew A. Nicholson -Thomas -Phillip Kinsley -Jerome Zago -David Rosky -TROJANI Cedric -David Polston -Patrick Mullen -Tetsuya Okuno -Bodo JŠger -Leon Brooks -Cedric Adjih -Michael L. Fisher -Dan Tomalesky -Sky Schulz -Scott Brickert -James Purdon -Miles Langham -N Yiannakoulias -Stephen Swaney -www.artwave.nl -Take Vos -sspickle -Denis Oliver Kropp -Gustavo -rodgers whittington jr -George Dvorak -Norman J Davis, Jr. -Javier Velazquez -John Tougas -John Howland -Steve Organek -Jano Lukac -David Cardon -Mick Balaban -Michael Kaufman -Viper Expo -Chassoulier -Sjoerd Zaalberg van Zelst -B. Douglas Hilton -Benoit CANTAGREL -Kai Fischer -Mark Osborne -Michael Hollenbeck -iconjunky -luca de giorgi -Jonathan Mullen -Javier Fernandez-Ivern -Reuben Burgess -Olivier Scalbert -claudio luis Rogers -Jeremy Peterson -Mark Streutker -Lourens Veen -Neil Davis -John McGurk -Stephen Teegarden -Dave LeCompte -Michael Lang -Mortal_Enemy -Arigo Stanescu -Vincent Stoessel -Adrian Virnig -Chris Dixon -Travis Cole -MŒrten MŒrtensson -Evan Scott -Mark Coletti -Ken Burke -Karl Holland -ScRaze -Wilco Wilbrink -chris montijn -Michael Wagenmann -Viktor Pracht -henrik wilming -Jim Evins -Christophe Massaloux -Marc Sommer -Luc Stepniewski -Eric M. Clark -Iain Russell -Thomas Bleicher -Anthony Zishka -Jefferson Dubrule -Esa PiirilŠ -Bill Thiede -William Anderson -Alexander Kittel -Joe Tennies -Sam Cable -Christian Peper -Joshua Frederick -Steve Sutton -Pete Toscano -Michael Zucchi -Peter Degenhardt -Horizont Entertainment -Olivier Bornet -Richard D. Laudenslager -sha -John DiLauro -John Miller -Frederic Crozat -Matt Welland -Paul CalcŽ -Joe Prochilo -Justin Shafer -Joe Croft -Detlef Mueller -Raschbacher Thomas -Alain Gallo -Phuoc Ngo -Krabat -Derek Harmison -SŽbastien Devine -Kenneth P. Stox -Wade Felde -Kai Groshert -Michael Soibelman -janine dalisda-davis -Philippe Raxhon -Daniel Sheridan -Michael Pressler -Daniel Lundqvist -Tim Oertel -James Ahlschwede -William Henstrom -PETIT-PHAR Patrice -Marc-Aurele DARCHE -Wei-ju Wu -Robert Wilson -Gerald Severs -Alejandro Conty Estevez -Tetsuya Yatagai -David Dolder -Luigi Cristiano -Posse Press / Romain Canonge -Vania Smrkovski -Bartosch Pixa -Dr. Jens Rosenboom -Gunnar Stahl -Robert Kroeger -Martin Forisch -Guillermina Manon -Randal D. Adams -Kevin Reagh (kevin3D) -Wolfgang KŸhn -BEAUSOLEIL Arnaud -Stan Jakubek -Klaus Brand -Holger Mueller -Fankhauser -Jon McCallum -Rob Olsen -Joel Davis -Kenneth Bledsoe -James F. Campanella -Jens Kilian -wim hendrix -Karri Kaksonen -Luis Roldan -Jason L. Shiffer -Jacco Marks -Dale Schoeck -Agustin Catalan -A. T. Meinen -Kamiel Wanrooij -Samuel Seay -Mike Schaudies -Robert Sherwood -Fernando Villalon Panzano -Jšrg Roschke -Carl Symons -Peter Pichler -Alan Heckart -seth nagy -pelletier -Jeff Kowalczyk -LIONEL ALLORGE -Bhishma Patel -Richard Rowell -Barbara Seaton -Aschwin van der Woude -William J Black -Kars Meyboom -Glen Nakamura -Jim Belcher -Tim Scott -mea van amstel -Robert-Reinder Nederhoed -Neil Hunt -WizardNx -Brad Choate -scott schoen -Dan Merillat -Martin Krueger -Samuel Greenfeld -Damon Tkoch -Colin Millar -Mike Roseman -Patrick Trussell -Hans-Peter Bock -Daniel Haertle -Wiremu Te Kani -Joep Mathijssen -LATRY -Witold Hazuka -geoff marshall -dave howard -Jan Zielinski -Fernando Buelna Sanchez -Timo Mihaljov -Allard Willem van den Brul -T.J.T van Kooten -Thijs van der Vossen -Antonio de Santis -Jama Poulsen -Robert Emanuele -Timothy Lord -Tom Parker -Jarrod Willard -Leon Merts -Tom Dow -Eric Anholt -mercier -Marc van Kempen -wim van hoydonck -Joe Hacobian -Jose Luis Fresquet Febrer -toni calmardo -Sam Littlewood -Charles Wardlaw -Javier Rodriguez -Michael C. Schwab -Corey Bell -Emmanuel Preveraud de La Boutresse -Davide Desogus -Larry Phillips -Marko Teiste -John Roesink -Legrand Johan -Jeff Boody -James Turner -Peter Petrakis -Ravi Ravindran -dickie -Rene Geerlings -Richard Braakman -Arthur Frenslich -Carsten Schmidt -Ronny Martin -Erwin Kuiper -Lopez-Garcia, Juan-Carlos -Rau, Bernhard -Stephen Uithoven -Ken Beyer -Matjaz Jakopec -Eckhard M. JŠger -Mike Siebach -John Harger -Justin W. Carper -Markus Weber -Elena Grandi -Arndt Heuvel -Miguel Cancela Da Fonseca -Kirk Lancaster -Phillip Elliott -Chris Halsall -Andre Voitel -benjamin scheers -Robinder S. Bains -David Brunton -David Brown -Craig Duncan -du Song -Ben Wart -Eryk Kedzierski -Ronald Hayden -Raymond de Vries -David Johnson -Kenichi Fujihiro -WANG -Chris Weber -Christian Lehmann -DENDIEVEL Stephane -Bryan Jaycox -Karl Bartel -Ralph Howes -Matthew J. Stott -Omar Priego -ke Westerstršm -Imago Viva -James E Hill -Rune Myrland -James Hill -Nick -Ramiro Santos -Giuseppe Chiesa -Philippe Ney -Tom Woodyard -Jim Gray -Jim Newman -Robert I Black III -Peter Marouelli -Ian Roberts -Guy Van Rentergem -Jose Luis Perez Rubio -Gabriel Mainberger -Klein Poelhuis -Luke Sargeant -Edomaur -robert stok -Karl J. Smith -Harry Splinter -Paul Boese -Dave Mata -piet visser -Nicolas Christin -Erik Zidowecki -Markus Michael Egger -Edward R. Helwig -Alyx Flannery -raphael betemps -Masahiro Takahata -Claude Bilat -Mario Palomo -Neipi -Grethus Bode -Jan MŸller -Mark Pearson -Stanislav Osicka -DataCare Solutions AG -Russell Elliott -Antonio Campos -bordeaux samuel -Herman Vereycken -Sergio Avila -George Dobrozemsky -Ocie Mitchell -Ryuuji Kusajima -Nick Austin -Edward Wei -Gregg Tavares -Aaron Bredon -Hideki Suzuki -josef radinger -Robert Friemer -Jšrg Zastrau -Burton Bicksler -Kimmo Mšsš -Robert F Johnson -Mark Johnson -Avi Bercovich -Mike Armitage -Roy Jones -Kathleen Sinnott -Per-Erik Westerberg -Reid Ellis -Phillip J. Birmingham -Ken Jordan -Duffaud -Marco Ardito -Simon Suter -Tobias Huelsdau -Winfried EnglŠnder -Stephen Groundwater -Joel Ray Holveck -Mag. Tibor Rudas -Hartmut Wolf -Douglas Jones -brett hartshorn -Beat MŠgert -Javon Prince -bri -James Klicman -Harvey Fong -jeroen v.d. Meulen -Wim Vandersmissen -Carlos Moreno Rodr’guez -Trausti Kristjansson -Larry Snyder -olivier -jip -Thomas Hintz -Daan van der Munnik -gideon -jared -Erick I. Jimenez Alvarado -John Martinez -Daniel Stephens -Alaric Haag -Michael Edwards -Sam Tregillus -Joe Pribele -Jeffry Archambeault -robert schiffers -shane smith -elout de kok -Felix Esser -Dietrich Lange -Richard Clark -errol garner -Jose M Cerqueira Esteves -Jeroen Janssen -Sven Meyer -Mike Bayer -Arash Vahdat -Bernd Hoppe -Tobias Geiger -Ronnie Stevens -W. van Ophoven -Artem Baguinski -Peter Morse -Nicholas Phillips -Leo Mannhart -philippe eygonnet -Hans Klerk -wes uchida -Guido Winkelmann -Doug Ferguson -Robert Lindsay -John Lovgren -Rogers Cadenhead -Philippe Crassous -Dirk Krause -lexpattison -Fred Roberts -Njin-Zu Chen -GUILLON Marc -Felix Klock -Ernesto Salas Rodr’guez -Pavel Roskin -Jaap -Stefan Maass -Adam Bower -Gary Thomas -Chris Gottbrath -seyssel claude -Chris Winberry -Chip Collier -Balint Reczey -Nuno Sucena Almeida -Landon Bradshaw -Chua Mei Ling -JC Hythloday -Dustin Knie -artshow -Ralf Gauglitz -Ted Schundler -Bernard Hurley -delerue -Dirk Behrens -Doc Holiday -Wouter Kerkhoven -Andreas BŸttner -James Black -Nicholas Ward -David Oberbeck -The Shizit -Erich Moog -James Amendolagine -Alex Penner -Dieter Finkenzeller -giol franco -Tobias Regenbrecht -Ryan Dewalt -Spencer Cathey -Benoit SERRA -System Impuls -Jason Tranter -macherb -LCC Consulting AG -Ivan So -Cori Verschoor -Henauer Pascal -Chris Bilderback -Eddie Sheffield -DEHEN Pierre -henk van den toorn -Ian Whitworth -Ruud H.G. van Tol -Pierre Lo Cicero -Srinivas Digumarty -digitalvelocity¨ -Alan J Booth -Tony OBrien -Douglas Toltzman -Christophe BOUCHET -Paul Robertson -SCHNEIDER Philippe -Jason Cunliffe -Dick Damian -Charles Hakari -jeff knowlton -Kevyn Shortell -robin -Craig Spitzer -Jeffrey Van Ness -Lucas Vergnettes -Wolfgang Michaelis -Luis JimŽnez Linares -Julian Eden -Ms Lilo von Hanffstengel -Kurt B. Kaiser -Mark Ping -CombŽe -Diego Matho -MELIN Philippe -Damian Sobieralski -Luigino Masarati -Leonard Wikberg III -Tom Howsman -Christopher R Marquard -Claus Munk -Chris D'Iorio -Graphics Solutions Pty Ltd -Bernd Stein -Jose Angel Vallejo Pinto -Matthew William Turner -Kelly A. Flinn -Hai T. Nguyen -Tim Formica -Kevin Purrington -Andreas Lindenblatt -Brian Musker -Diego Silvio Novo -Close Pierre-Yves -Wayne Pierce -Hattan Lee -Didier PEYRET -Jacquelin GAZEAU -Kenneth Balmer -Robert Hwang -Gaertner, Klaus -Peter Gumieniak -Simon Pigot -Ian Thompson -Jason Southwell -Stephan -Robert Kuehn -IUT Mesures Physiques:gilbert Garnier CAEN France -Nigel I Phillip -powermacg4 -Joan Touzet -Mike Mormando -katsuhiko ebisawa -Baheux Tony -Randi Joseph -Rick Comeau -michiel van der kley -Thijs Seelen -Robert Roos -ton -david seccombe -Joshua Eckert -Joshua Newman -Paolo Sammicheli -Gentilini Bruno -Martin Herren -STRAPPAZON Mathias -Steven Gibbs -Florian Kruesch -Wesley Blijlevens -Fabianne Balvedi -Colin Henry -Mark Deepak Puttnam -LE GOULVEN -evolutie -Stephane Portha -Robert Gentner -David B. Camhy -RenŽ Foucart -Coyok Drio -Mark Ng -klein michael -Antonin Kral -Edward Jomisko -Wouter de Mik -Matteo De Simone -Gal Barak -Thomas Dyar -Nathan Allworth -Dean Giberson -Larry Cummings -Eric Augustine -IngieBee -Michael Velikanje -Andre M. Czausov -H@dj -Thorsten Burghaus -Renzo Lauper -Martin White -Ferdinand Strixner -Neil Mannall -Maxime Wacker -Gal Buki -Rene Christen -Andreas Neukoetter -DAVID JOHNSON -John Walton -Volker Mische -Michel Vilain -Luigi/Blender Brasil -Clifton A. Cross -Kent B. Mein (SirDude) -Anne Postma -Matt Runion -Bob Tackett -stanislas nanchen -Jorge Monteiro -S68 -Ville Kaajakari -Adrien Rebollo -Al Curatolo -Frank Rutten -Dierk Dohmann -Roel Spruit -Rob Coldwell -Yann Vernier -Haunt_House (PH) -Ravinder Singh Bhara -Erik Augustijns -Ryan Earle Freckleton -Andreas Sturm -matt mullin -MOREAUX Denis -Brendan Stromberger -Hideki Saito -Christian Ullrich -Courty Didier -Steve Newton -Brecht Van Lommel -Jasper Op de Coul -Stuart MacKinnon -Dietrich Dietz - the IMaGiNation project (IMGN) -Tina Hirsch -John R Thorp -FrŽdŽric Bouvier -LINETTE -Felix Rabe -Chay Adamou -nick harron -stephen john ford -Kino -Daniel Sjšlie -Matthias Derer -Alain VALLETON -Kervin Pierre -Mike Laughton -Frank van Puffelen -Andreas Dluzewski -Christofer Edvardsen -Maciek Szczyglowski -Rakesh Ravuri -Robert Schouwenburg -Bob Bayens -Devas73 -Mika Saari -Robert Ives -Adam McBride -IAN ROSS -Uriah Liggett -stefan fischer -Didac Miro -Tim Barlow -G. T. Blackwell -Tim Weaver -Dalet -Erwin Vervacke -Benjamin Eduardo Rodriguez Berumen -Ozono Multimedia s.l.l. -James Kersey -Michael DeLuca -Mark Swann -Andreas Altenburger -John Smith -Simon de Haan -David Gregory -Harald Krummeck -E Warren McNee -Marc-Andre Levesque -Satoshi Yamasaki -Rolf-Dieter Klein -J. Deetman -Helge Walter -Roland StrŒlberg -Nicolas Morenas (Caronte) -Simon Clarke -Maigrot Michel -Rod Robinson -Kevin Cozens -Germ‡n Alonso (taz) -Martin Stegeman -Henrik Jordfald Olsen -Mitchell Skinner -Michael Lei -Spiridon G. Kontarakis -Bas Denissen -Loic Dachary -Michael Rutter -Thorsten SchlŸter -hijothema -Andreas Hauser -Holger Haase -Danilo Duina -Matthias Thurau -Flavio Curti -Ian Beardslee -Cristina Lozano Ballester -Jason Roberson -Victor Lim -andreas palsson -Richard Charvat -James Ezell -Florian Eggenberger -John J. Marshall -Paul Lunneberg -Peter Wolkerstorfer -Gerhard Siegesmund -Nat Budin -NDNChief -Dave Leeak -Michael Siebecker -Jan Walter -John Aughey -Corey Rice -Darren F. Coolen -tony principali -Joe Kimmes -Pekka Karvonen -Rick Kimball -Christopher Capoccia -Bertram Zeller -Vanpoucke Alexandre -Bassam Kurdali -Michael Baker -Michael Schwemmle -Ford "fullback" Roberts -Lama Angelo -Kevin Roeder -oliv -pinhead_66 -Zach Millis -Ryan C. Stallings -Adam LaJeunesse -Satish Goda -Erik Haagsman -Lorenzo Moro -Nathan Letwory -stephan f. haupt -Alex Papadopoulos -Gianluigi Berrone -andrea casentini -David Randall Simpson -Jason Oppel -Mark Bloomfield -Alexander Ehrath -Owen Swerkstrom -Aurelio Caliaro -Karsten Dambekalns -Eddy MOUSSA -Bernd Roetter -Roland Hess -Luis Eduardo P. Gervasio -Pierre-Luc Robert (bedsitter) -Andreu Cuartiella -Nathan Vegdahl -Scott Ross -Jacob Kafka -Mario Bolte -Wolfgang Draxinger -Starr Kline -John Lullie -Chiffi Cosimo -Morgan McMillian -Stefan HŸbner -Loic de MONTAIGNAC -AndrŽs Castillo -Francesco Anselmo -Ingo Guenther -James C. Davis, Jr. -Claudio Andaur -Caleb Williams -Orest Dubay -Adam Casto -David -Joost Burger -Ken Hahn -Mark Herring -Stig Oeveraas -Robert Rainthorpe -Martin Middleton -Simon Sedgwick -Joseph Firestine -Miguel Melo -Wooster Dennis -Gary Lucas -Johannes Schwarz -Mark Dalton -Mike Norton -Michael Schardt -jean-michel soler -Chris Bracewell -Ross Dawson -Tim De Graeve -Adam Wiseman -Luiz Olsson Barbosa -Donna Carey -Auke van Balen -Mike Birdsong -Martin Curran -Shawn M. Murray -Roy Simmons -Malik -Teguh Pangestu -Mats Holmberg -Julien Jehannet -Michael A. Nelson -Axel Cushing -erik vogan -Datenflug GmbH -KC Roeyer -Ryan J. Parker -Robert E. Meuse -Alex Heizer -Netsail Ltd / Mats Holmberg -Jonathan Lawman -Seikoh Hokama -Perry Faulkner -Will Hanson -Lyubomir Pavlov Kovachev -Ennio Quattrini -Marcelo "xfer" Alves -Joseph Winston IV -Jorge Otero Rueda -Timothy Murakami -Matthew Johnson -Erik Rombouts -Petr Vlk -Thomas Dammann -Henrik Turkerud -Erlend Hamberg -Arnaud Lebegue -Kevin O'Brien -Michael Buettner -Engel A. Sanchez -Alexander Hilgert -FAUGE Thierry -Wulf Huesken -John M. Adams -Dell'Aiera Pol -Waylena McCully -Russell Smith -Luke Titley -marinus meijers -Henry Kaminski -Alistair Riddoch -Daniel NŸmm -Matthew Meadows -Bjoern Paschen -Paul Fredrickson -Gavin Baker -Jan Illetschko -Aaron C. McLeod -Thomas Muldowney -Cheyenne Cloud, LLC -Helmut A. Goettl -Martin A. Boegelund -Beno”t Cousson -Scott Brooks -Ferlet Patrice -Aaron Porterfield -Ivan Florentin -Scott Isaacson -Rui Paulo Sanguinheira Diogo -Jason Saville -Active-Websight GbR -Bryon Roche -Gustavo Mu–oz -Christopher Gillanders -Phil Frost Tate -Gilles Gonon -Kay -James C. Franklin -Luis Enrique Caama–o Navas -Alexander "estartu" Felder -Marc Ledermann -vrijschrift.org -Holger Weihe -Peter Cammaert -Andres Meyer -Tony Arnett -Adam Hughes -Tony Farley -Dmitriy Teresh -Maickel Swart -Peter den Bak -Steve Bennett -Romain Rubi -John Bolt -Michael Gaston -Philip Brown -Wasi -Mike Hirst -Lloyd J Robinson, Jr -Charles Rinker -Nick Vogtmann -Frank van Beek -Bruce Mitchener -ROBERTO A. RUIZ VIAL -Maurizio Sibaud -Ron Bolger -Nathan Parton -Andrew Fry -VINCENT StŽphane -Yan Yan -Justin L Graham -Wade Beasley -Salvador Mata Rodriguez -Jan Tiemersma -Luis A. R. Fernandez -Jacob Moy -Stefano Francesi -Jochen Hanne -David Stephenson -Brent O'Dell -Mike Kasprzak -Tom Thompson -David Fung -Radoslav Dejanovic -James H. Cloos, Jr. -Karl Erlandsen (LethalSideParting) -Kari Pulli -Dave Shemano diff --git a/doc/blender.1 b/doc/blender.1 deleted file mode 100644 index 43ac5638765..00000000000 --- a/doc/blender.1 +++ /dev/null @@ -1,338 +0,0 @@ -.TH "BLENDER" "1" "June 27, 2010" "Blender Blender 2\&.52 (sub 5) " - -.SH NAME -blender \- a 3D modelling and rendering package -.SH SYNOPSIS -.B blender [args ...] [file] [args ...] -.br -.SH DESCRIPTION -.PP -.B blender -is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions. - -Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented. - -http://www.blender.org -.SH OPTIONS - -Blender 2.52 (sub 5) Build -Usage: blender [args ...] [file] [args ...] -.br -.SS "Render Options:" - -.TP -.B \-b or \-\-background -.br -Load in background (often used for UI\-less rendering) -.br - -.TP -.B \-a or \-\-render\-anim -.br -Render frames from start to end (inclusive) -.br - -.TP -.B \-S or \-\-scene -.br -Set the active scene for rendering -.br - -.TP -.B \-f or \-\-render\-frame -.br -Render frame and save it. -.br -+ start frame relative, \- end frame relative. -.br - -.TP -.B \-s or \-\-frame\-start -.br -Set start to frame (use before the \-a argument) -.br - -.TP -.B \-e or \-\-frame\-end -.br -Set end to frame (use before the \-a argument) -.br - -.TP -.B \-j or \-\-frame\-jump -.br -Set number of frames to step forward after each rendered frame -.br - -.TP -.B \-o or \-\-render\-output -.br -Set the render path and file name. -.br -Use // at the start of the path to -.br - render relative to the blend file. -.br -The # characters are replaced by the frame number, and used to define zero padding. -.br - ani_##_test.png becomes ani_01_test.png -.br - test\-######.png becomes test\-000001.png -.br - When the filename does not contain #, The suffix #### is added to the filename -.br -The frame number will be added at the end of the filename. -.br - eg: blender \-b foobar.blend \-o //render_ \-F PNG \-x 1 \-a -.br - //render_ becomes //render_####, writing frames as //render_0001.png// -.br - -.TP -.B \-E or \-\-engine -.br -Specify the render engine -.br -use \-E help to list available engines -.br - -.IP - -.SS "Format Options:" - -.TP -.B \-F or \-\-render\-format -.br -Set the render format, Valid options are... -.br - TGA IRIS JPEG MOVIE IRIZ RAWTGA -.br - AVIRAW AVIJPEG PNG BMP FRAMESERVER -.br -(formats that can be compiled into blender, not available on all systems) -.br - HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS -.br - -.TP -.B \-x or \-\-use\-extension -.br -Set option to add the file extension to the end of the file -.br - -.TP -.B \-t or \-\-threads -.br -Use amount of for rendering in background -.br -[1\-BLENDER_MAX_THREADS], 0 for systems processor count. -.br - -.IP - -.SS "Animation Playback Options:" - -.TP -.B \-a -.br -Playback , only operates this way when not running in background. -.br - \-p Open with lower left corner at , -.br - \-m Read from disk (Don't buffer) -.br - \-f Specify FPS to start with -.br - \-j Set frame step to -.br - -.IP - -.SS "Window Options:" - -.TP -.B \-w or \-\-window\-border -.br -Force opening with borders (default) -.br - -.TP -.B \-W or \-\-window\-borderless -.br -Force opening with without borders -.br - -.TP -.B \-p or \-\-window\-geometry -.br -Open with lower left corner at , and width and height as , -.br - -.IP - -.SS "Game Engine Specific Options:" - -.TP -.B \-g Game Engine specific options -.br -\-g fixedtime Run on 50 hertz without dropping frames -.br -\-g vertexarrays Use Vertex Arrays for rendering (usually faster) -.br -\-g nomipmap No Texture Mipmapping -.br -\-g linearmipmap Linear Texture Mipmapping instead of Nearest (default) -.br - -.IP - -.SS "Misc Options:" - -.TP -.B \-d or \-\-debug -.br -Turn debugging on -.br - -.IP -* Prints every operator call and their arguments -.br -* Disables mouse grab (to interact with a debugger in some cases) -.br -* Keeps python sys.stdin rather then setting it to None -.br - -.TP -.B \-\-debug\-fpe -.br -Enable floating point exceptions -.br - -.IP - -.TP -.B \-nojoystick -.br -Disable joystick support -.br - -.TP -.B \-noglsl -.br -Disable GLSL shading -.br - -.TP -.B \-noaudio -.br -Force sound system to None -.br - -.TP -.B \-setaudio -.br -Force sound system to a specific device -.br -NULL SDL OPENAL JACK -.br - -.IP - -.TP -.B \-h or \-\-help -.br -Print this help text and exit -.br - -.IP - -.TP -.B \-y or \-\-enable\-autoexec -.br -Enable automatic python script execution (default) -.br - -.TP -.B \-Y or \-\-disable\-autoexec -.br -Disable automatic python script execution (pydrivers, pyconstraints, pynodes) -.br - -.IP - -.TP -.B \-P or \-\-python -.br -Run the given Python script (filename or Blender Text) -.br - -.TP -.B \-\-python\-console -.br -Run blender with an interactive console -.br - -.TP -.B \-v or \-\-version -.br -Print Blender version and exit -.br - -.TP -.B \-\- -.br -Ends option processing, following arguments passed unchanged. Access via python's sys.argv -.br - -.SS "Other Options:" - -.TP -.B /? -.br -Print this help text and exit (windows only) -.br - -.TP -.B \-R -.br -Register .blend extension (windows only) -.br - -.SS "Argument Parsing:" - - arguments must be separated by white space. eg - "blender \-ba test.blend" - ...will ignore the 'a' - "blender \-b test.blend \-f8" - ...will ignore 8 because there is no space between the \-f and the frame value -.br -.SS "Argument Order:" - -Arguments are executed in the order they are given. eg - "blender \-\-background test.blend \-\-render\-frame 1 \-\-render\-output /tmp" - ...will not render to /tmp because '\-\-render\-frame 1' renders before the output path is set - "blender \-\-background \-\-render\-output /tmp test.blend \-\-render\-frame 1" - ...will not render to /tmp because loading the blend file overwrites the render output that was set - "blender \-\-background test.blend \-\-render\-output /tmp \-\-render\-frame 1" works as expected. -.br -.br -.SH "ENVIRONMENT VARIABLES" - \fIHOME\fR Store files such as .blender/ .B.blend .Bfs .Blog here. - \fIBLENDERPATH\fR System directory to use for data files and scripts. - For this build of blender the default \fIBLENDERPATH\fR is... - "/usr/local/share/blender/2.5" - setting the \fIBLENDERPATH\fR will override this - \fITMP\fR or \fITMPDIR\fR Store temporary files here. - \fIPYTHONHOME\fR Path to the python directory, eg. /usr/lib/python. -.br -.br - -.br -.SH SEE ALSO -.B yafaray(1) - -.br -.SH AUTHORS -This manpage was written for a Debian GNU/Linux system by Daniel Mester - and updated by Cyril Brulebois - and Dan Eicher . diff --git a/extern/libopenjpeg/CMakeLists.txt b/extern/libopenjpeg/CMakeLists.txt index 774d32ef4a2..c5ba1363246 100644 --- a/extern/libopenjpeg/CMakeLists.txt +++ b/extern/libopenjpeg/CMakeLists.txt @@ -74,4 +74,3 @@ set(SRC ) blender_add_lib(extern_openjpeg "${SRC}" "${INC}") - diff --git a/intern/SoundSystem/CMakeLists.txt b/intern/SoundSystem/CMakeLists.txt deleted file mode 100644 index 9a370af2268..00000000000 --- a/intern/SoundSystem/CMakeLists.txt +++ /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) 2006, Blender Foundation -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): Jacques Beaurain. -# -# ***** END GPL LICENSE BLOCK ***** - -SET(INC . intern ../moto/include ../string dummy openal sdl) - -IF(WITH_OPENAL) - FILE(GLOB SRC dummy/*.cpp intern/*.cpp openal/*.cpp sdl/*.cpp) - INCLUDE_DIRECTORIES(${OPENAL_INC} ${SDL_INC}) - STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INC}) - IF(FRAMEWORK) - ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX) - ENDIF(FRAMEWORK) -ELSE(WITH_OPENAL) - FILE(GLOB SRC dummy/*.cpp intern/*.cpp) - ADD_DEFINITIONS(-DNO_SOUND) -ENDIF(WITH_OPENAL) - -BLENDERLIB(bf_soundsystem "${SRC}" "${INC}") -#, libtype=['core','player'], priority = [20,140] ) diff --git a/intern/SoundSystem/Makefile b/intern/SoundSystem/Makefile deleted file mode 100644 index 4d346f65138..00000000000 --- a/intern/SoundSystem/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*- -# vim: tabstop=8 -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 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): GSR -# -# ***** END GPL LICENSE BLOCK ***** -# -# - -include nan_definitions.mk - -LIBNAME = SoundSystem -SOURCEDIR = intern/SoundSystem -DIR = $(OCGDIR)/$(SOURCEDIR) -DIRS = intern -DIRS += dummy - -ifneq ($(NAN_NO_OPENAL),true) - ifeq ($(OS),windows) - DIRS += openal sdl - endif - ifeq ($(OS),darwin) - DIRS += openal - endif - ifeq ($(OS),$(findstring $(OS), "linux freebsd solaris")) - DIRS += openal sdl - endif - ifeq ($(OS), irix) - DIRS += sdl - endif -else - export CPPFLAGS += -DNO_SOUND -endif - -include nan_subdirs.mk - -install: $(ALL_OR_DEBUG) - @[ -d $(NAN_SOUNDSYSTEM) ] || mkdir $(NAN_SOUNDSYSTEM) - @[ -d $(NAN_SOUNDSYSTEM)/include ] || mkdir $(NAN_SOUNDSYSTEM)/include - @[ -d $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR) - @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libSoundSystem.a $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR) -ifeq ($(OS),darwin) - ranlib $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a -endif - @../tools/cpifdiff.sh *.h $(NAN_SOUNDSYSTEM)/include/ - - diff --git a/intern/SoundSystem/SConscript b/intern/SoundSystem/SConscript deleted file mode 100644 index 256b7904a0f..00000000000 --- a/intern/SoundSystem/SConscript +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/python - -Import ('env') - -sources = env.Glob('dummy/*.cpp') + env.Glob('intern/*.cpp') - -incs = '. intern ../moto/include ../string dummy openal sdl' -defs = '' -if env['WITH_BF_OPENAL']: - sources += env.Glob('openal/*.cpp') + env.Glob('sdl/*.cpp') - incs += ' ' + env['BF_OPENAL_INC'] - incs += ' ' + env['BF_SDL_INC'] - defs = 'USE_OPENAL' -else: - defs = 'NO_SOUND' - -if not env['WITH_BF_SDL']: - defs += ' DISABLE_SDL' - -env.BlenderLib ('bf_soundsystem', sources, Split(incs), Split(defs), libtype=['intern','player'], priority = [25,135] ) diff --git a/intern/SoundSystem/SND_C-api.h b/intern/SoundSystem/SND_C-api.h deleted file mode 100644 index f8e439a9c26..00000000000 --- a/intern/SoundSystem/SND_C-api.h +++ /dev/null @@ -1,354 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 SND_BLENDER_H -#define SND_BLENDER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "SoundDefines.h" - -#define SND_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name - -SND_DECLARE_HANDLE(SND_AudioDeviceInterfaceHandle); -SND_DECLARE_HANDLE(SND_SceneHandle); -SND_DECLARE_HANDLE(SND_ObjectHandle); -SND_DECLARE_HANDLE(SND_ListenerHandle); - -/** - * set the specified type - */ -extern void SND_SetDeviceType(int device_type); - -/** - * get an audiodevice - */ -extern SND_AudioDeviceInterfaceHandle SND_GetAudioDevice(void); - -/** - * and let go of it - */ -extern void SND_ReleaseDevice(void); - -/** - * check if playback is desired - */ -extern int SND_IsPlaybackWanted(SND_SceneHandle scene); - -/** - * add memlocation to cache - */ -extern int SND_AddSample(SND_SceneHandle scene, - const char* filename, - void* memlocation, - int size); - -/** - * remove all samples - */ -extern void SND_RemoveAllSamples(SND_SceneHandle scene); - -/** - * forces the object to check its buffer, and fix it if it's wrong - */ -extern int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object); - -/** - * Creates a scene, initializes it and returns a handle to that scene. - * - * @param audiodevice: handle to the audiodevice. - */ -extern SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice); - -/** - * Stops all sounds, suspends the scene (so all resources will be freed) and deletes the scene. - * - * @param scene: handle to the soundscene. - */ -extern void SND_DeleteScene(SND_SceneHandle scene); - -/** - * Adds a soundobject to the scene, gets the buffer the sample is loaded into. - * - * @param scene: handle to the soundscene. - * @param object: handle to soundobject. - */ -extern void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object); - -/** - * Removes a soundobject from the scene. - * - * @param scene: handle to the soundscene. - * @param object: handle to soundobject. - */ -extern void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object); - -/** - * Removes all soundobjects from the scene. - * - * @param scene: handle to the soundscene. - */ -extern void SND_RemoveAllSounds(SND_SceneHandle scene); - -/** - * Stopss all soundobjects in the scene. - * - * @param scene: handle to the soundscene. - */ -extern void SND_StopAllSounds(SND_SceneHandle scene); - -/** - * Updates the listener, checks the status of all soundobjects, builds a list of all active - * objects, updates the active objects. - * - * @param audiodevice: handle to the audiodevice. - * @param scene: handle to the soundscene. - */ -extern void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene); - -/** - * Returns a handle to the listener. - * - * @param scene: handle to the soundscene. - */ -extern SND_ListenerHandle SND_GetListener(SND_SceneHandle scene); - -/** - * Sets the gain of the listener. - * - * @param scene: handle to the soundscene. - * @param gain: factor the gain gets multiplied with. - */ -extern void SND_SetListenerGain(SND_SceneHandle scene, double gain); - -/** - * Sets a scaling to exaggerate or deemphasize the Doppler (pitch) shift resulting from the - * calculation. - * @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$ - * @attention f: frequency in sample (soundobject) - * @attention f': effective Doppler shifted frequency - * - * @param object: handle to soundobject. - * @param dopplerfactor: the dopplerfactor. - */ -extern void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor); - -/** - * Sets the value of the propagation speed relative to which the source velocities are interpreted. - * @attention $f' = dopplerfactor * f * frac{dopplervelocity - listener_velocity}{dopplervelocity + object_velocity}$ - * @attention f: frequency in sample (soundobject) - * @attention f': effective Doppler shifted frequency - * - * @param object: handle to soundobject. - * @param dopplervelocity: the dopplervelocity. - */ -extern void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity); - -/** - * Creates a new soundobject and returns a handle to it. - */ -extern SND_ObjectHandle SND_CreateSound(void); - -/** - * Deletes a soundobject. - * - * @param object: handle to soundobject. - */ -extern void SND_DeleteSound(SND_ObjectHandle object); - -/** - * Sets a soundobject to SND_MUST_PLAY, so with the next proceed it will be updated and played. - * - * @param object: handle to soundobject. - */ -extern void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object); - -/** - * Sets a soundobject to SND_MUST_STOP, so with the next proceed it will be stopped. - * - * @param object: handle to soundobject. - */ -extern void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object); - -/** - * Sets a soundobject to SND_MUST_PAUSE, so with the next proceed it will be paused. - * - * @param object: handle to soundobject. - */ -extern void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object); - -/** - * Sets the name of the sample to reference the soundobject to it. - * - * @param object: handle to soundobject. - * @param samplename: the name of the sample - */ -extern void SND_SetSampleName(SND_ObjectHandle object, char* samplename); - -/** - * Sets the gain of a soundobject. - * - * @param object: handle to soundobject. - * @param gain: factor the gain gets multiplied with. - */ -extern void SND_SetGain(SND_ObjectHandle object, double gain); - -/** - * Sets the minimum gain of a soundobject. - * - * @param object: handle to soundobject. - * @param minimumgain: lower threshold for the gain. - */ -extern void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain); - -/** - * Sets the maximum gain of a soundobject. - * - * @param object: handle to soundobject. - * @param maximumgain: upper threshold for the gain. - */ -extern void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain); - -/** - * Sets the rollofffactor. The rollofffactor is a per-Source parameter the application - * can use to increase or decrease the range of a source by decreasing or increasing the - * attenuation, respectively. The default value is 1. The implementation is free to optimize - * for a rollofffactor value of 0, which indicates that the application does not wish any - * distance attenuation on the respective Source. - * - * @param object: handle to soundobject. - * @param rollofffactor: the rollofffactor. - */ -extern void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor); - -/** - * Sets the referencedistance at which the listener will experience gain. - * @attention G_dB = gain - 20 * log10(1 + rollofffactor * (dist - referencedistance)/referencedistance); - * - * @param object: handle to soundobject. - * @param distance: the reference distance. - */ -extern void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance); - -/** - * Sets the pitch of a soundobject. - * - * @param object: handle to soundobject. - * @param pitch: pitchingfactor: 2.0 for doubling the frequency, 0.5 for half the frequency. - */ -extern void SND_SetPitch(SND_ObjectHandle object, double pitch); - -/** - * Sets the position a soundobject. - * - * @param object: handle to soundobject. - * @param position: position[3]. - */ -extern void SND_SetPosition(SND_ObjectHandle object, double* position); - -/** - * Sets the velocity of a soundobject. - * - * @param object: handle to soundobject. - * @param velocity: velocity[3]. - */ -extern void SND_SetVelocity(SND_ObjectHandle object, double* velocity); - -/** - * Sets the orientation of a soundobject. - * - * @param object: handle to soundobject. - * @param orientation: orientation[9]. - */ -extern void SND_SetOrientation(SND_ObjectHandle object, double* orientation); - -/** - * Sets the loopmode of a soundobject. - * - * @param object: handle to soundobject. - * @param loopmode type of the loop (SND_LOOP_OFF, SND_LOOP_NORMAL, SND_LOOP_BIDIRECTIONAL); - */ -extern void SND_SetLoopMode(SND_ObjectHandle object, int loopmode); - -/** - * Sets the looppoints of a soundobject. - * - * @param object: handle to soundobject. - * @param loopstart startpoint of the loop - * @param loopend endpoint of the loop - */ -extern void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend); - -/** - * Gets the gain of a soundobject. - * - * @param object: handle to soundobject. - */ -extern float SND_GetGain(SND_ObjectHandle object); - -/** - * Gets the pitch of a soundobject. - * - * @param object: handle to soundobject. - */ -extern float SND_GetPitch(SND_ObjectHandle object); - -/** - * Gets the looping of a soundobject. - * 0: SND_LOOP_OFF - * 1: SND_LOOP_NORMAL - * 2: SND_LOOP_BIDIRECTIONAL - * - * @param object: handle to soundobject. - */ -extern int SND_GetLoopMode(SND_ObjectHandle object); - -/** - * Gets the playstate of a soundobject. - * SND_UNKNOWN = -1 - * SND_INITIAL - * SND_MUST_PLAY - * SND_PLAYING - * SND_MUST_STOP - * SND_STOPPED - * SND_MUST_PAUSE - * SND_PAUSED - * SND_MUST_BE_DELETED - * - * @param object: handle to soundobject. - */ -extern int SND_GetPlaystate(SND_ObjectHandle object); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/intern/SoundSystem/SND_CDObject.h b/intern/SoundSystem/SND_CDObject.h deleted file mode 100644 index c79f62d9862..00000000000 --- a/intern/SoundSystem/SND_CDObject.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * SND_CDObject.h - * - * Implementation for CD playback - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 __SND_CDOBJECT_H -#define __SND_CDOBJECT_H - -#include "SND_Object.h" - -class SND_CDObject : public SND_Object -{ -private: - - /** - * Private to enforce singleton - */ - SND_CDObject(); - SND_CDObject(const SND_CDObject&); - - static SND_CDObject* m_instance; - MT_Scalar m_gain; /* the gain of the object */ - int m_playmode; /* the way CD is played back (all, random, track, trackloop) */ - int m_track; /* the track for 'track' and 'trackloop' */ - int m_playstate; /* flag for current state of object */ - bool m_modified; - bool m_used; /* flag for checking if we used the cd, if not don't - call the stop cd at the end */ - -public: - static bool CreateSystem(); - static bool DisposeSystem(); - static SND_CDObject* Instance(); - - ~SND_CDObject(); - - void SetGain(MT_Scalar gain); - void SetPlaymode(int playmode); - void SetTrack(int track); - void SetPlaystate(int playstate); - void SetModified(bool modified); - void SetUsed(); - bool GetUsed(); - - bool IsModified() const; - - int GetTrack() const; - MT_Scalar GetGain() const; - int GetPlaymode() const; - int GetPlaystate() const; - -}; - -#endif //__SND_CDOBJECT_H - diff --git a/intern/SoundSystem/SND_DependKludge.h b/intern/SoundSystem/SND_DependKludge.h deleted file mode 100644 index 06d4ec9c0c9..00000000000 --- a/intern/SoundSystem/SND_DependKludge.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SND_DependKludge.h - * - * who needs what? - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 HAVE_CONFIG_H - -#ifndef NO_SOUND - -#if defined (_WIN32) && !defined(FREE_WINDOWS) -# define USE_OPENAL -#elif defined (__linux__) || (__FreeBSD__) || defined(__APPLE__) || defined(__sun) -# define USE_OPENAL -#else -# ifdef USE_OPENAL -# undef USE_OPENAL -# endif -#endif - -#endif /* NO_SOUND */ - -#endif /* HAVE_CONFIG_H */ diff --git a/intern/SoundSystem/SND_DeviceManager.h b/intern/SoundSystem/SND_DeviceManager.h deleted file mode 100644 index 708db030519..00000000000 --- a/intern/SoundSystem/SND_DeviceManager.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SND_DeviceManager.h - * - * singleton for creating, switching and deleting audiodevices - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 __SND_DEVICEMANAGER_H -#define __SND_DEVICEMANAGER_H - -#include "SND_IAudioDevice.h" - -class SND_DeviceManager -{ -public : - - /** - * a subscription is needed before instances are given away - * applications must call subscribe first, get an instance, and - * when they are finished with sound, unsubscribe - */ - static void Subscribe(); - static void Unsubscribe(); - - static SND_IAudioDevice* Instance(); - static void SetDeviceType(int device_type); - -private : - - /** - * Private to enforce singleton - */ - SND_DeviceManager(); - SND_DeviceManager(const SND_DeviceManager&); - ~SND_DeviceManager(); - - static SND_IAudioDevice* m_instance; - - /** - * The type of device to be created on a call - * to Instance(). - */ - static int m_device_type; - - /** - * Remember the number of subscriptions. - * if 0, delete the device - */ - static int m_subscriptions; -}; - -#endif //__SND_DEVICEMANAGER_H - diff --git a/intern/SoundSystem/SND_IAudioDevice.h b/intern/SoundSystem/SND_IAudioDevice.h deleted file mode 100644 index d6b3936e6ef..00000000000 --- a/intern/SoundSystem/SND_IAudioDevice.h +++ /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 ***** - */ -#ifndef SND_IAUDIODEVICE -#define SND_IAUDIODEVICE - -#include "SND_SoundObject.h" -#include "SND_CDObject.h" -#include "SND_WaveCache.h" -#include "SND_WaveSlot.h" -#include "MT_Matrix3x3.h" - -class SND_IAudioDevice -{ -public: - - /** - * constructor - */ - SND_IAudioDevice() {}; - - /** - * destructor - */ - virtual ~SND_IAudioDevice() {}; - - /** - * check to see if initialization was successfull - * - * @return indication of succes - */ - virtual bool IsInitialized()=0; - - /** - * get the wavecache (which does sample (un)loading) - * - * @return pointer to the wavecache - */ - virtual SND_WaveCache* GetWaveCache() const =0; - - /** - * loads a sample into the device - * - * @param samplename the name of the sample - * @param memlocation pointer where the sample is stored - * @param size size of the sample in memory - * - * @return pointer to the slot with sample data - */ - virtual SND_WaveSlot* LoadSample(const STR_String& samplename, - void* memlocation, - int size)=0; - - /** - * remove a sample from the wavecache - * - * @param filename pointer to filename - */ -// virtual void RemoveSample(const char* filename)=0; - - /** - * remove all samples from the wavecache - */ - virtual void RemoveAllSamples()=0; - - /** - * get a new id from the device - * - * @param pObject pointer to soundobject - * - * @return indication of success - */ - virtual bool GetNewId(SND_SoundObject* pObject)=0; - - /** - * clear an id - * - * @param pObject pointer to soundobject - */ - virtual void ClearId(SND_SoundObject* pObject)=0; - - /** - * initialize the listener - */ - virtual void InitListener()=0; - - /** - * set the value of the propagation speed relative to which the - * source velocities are interpreted. - * f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Vl) / (DOPPLER_VELOCITY + Vo) - * f: frequency in sample (soundobject) - * f': effective Doppler shifted frequency - * Vl: velocity listener - * Vo: velocity soundobject - * - * @param dopplervelocity scaling factor for doppler effect - */ - virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0; - - /** - * set a scaling to exaggerate or deemphasize the Doppler (pitch) - * shift resulting from the calculation. - * f' = DOPPLER_FACTOR * f * (DOPPLER_VELOCITY - Listener_velocity )/(DOPPLER_VELOCITY + object_velocity ) - * - * @param dopplerfactor scaling factor for doppler effect - */ - virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0; - - /** - * set the roll-off factor - * - * @param rollofffactor a global volume scaling factor - */ - virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0; - - /** - * make the context the current one - */ - virtual void MakeCurrent() const =0; - - /** - * update the device - */ - virtual void NextFrame() const =0; - - /** - * set the volume of the listener. - * - * @param gain the mastergain - */ - virtual void SetListenerGain(float gain) const =0; - - /** - * connect the buffer with the source - * - * @param id the id of the object - * @param buffer the buffer the sample is stored in - */ - virtual void SetObjectBuffer(int id, unsigned int buffer)=0; - - /** - * pause playback of the cd - * @param id the id of the object - * - * @return the state the object is in - */ - virtual int GetPlayState(int id) =0; - - /** - * play a sound belonging to an object. - * - * @param id the id of the object - */ - virtual void PlayObject(int id) =0; - - /** - * stop a sound belonging to an object. - * - * @param id the id of the object - */ - virtual void StopObject(int id) const =0; - - /** - * stop all sounds. - */ - virtual void StopAllObjects()=0; - - /** - * pause the sound belonging to an object. - * - * @param id the id of the object - */ - virtual void PauseObject(int id) const =0; - - /** - * set the sound to looping or non-looping. - * - * @param id the id of the object - * @param loopmode type of looping (no loop, normal, bidirectional) - */ - virtual void SetObjectLoop(int id, unsigned int loopmode) const =0; - - /** - * set the looppoints of a sound - * - * @param id the id of the object - * @param loopstart the startpoint of the loop (in samples) - * @param loopend the endpoint of the loop (in samples) - */ - virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0; - - /** - * set the pitch of the sound. - * - * @param id the id of the object - * @param pitch the pitch - */ - virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0; - - /** - * set the gain of the sound. - * - * @param id the id of the object - * @param gain the gain - */ - virtual void SetObjectGain(int id, MT_Scalar gain) const =0; - - /** - * ROLLOFF_FACTOR is per-Source parameter the application can use to increase or decrease - * the range of a source by decreasing or increasing the attenuation, respectively. The - * default value is 1. The implementation is free to optimize for a ROLLOFF_FACTOR value - * of 0, which indicates that the application does not wish any distance attenuation on - * the respective Source. - * - * @param id the id of the object - * @param rolloff a per-source volume scaling factor - */ - virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0; - - /** - * min_gain indicates the minimal gain which is always guaranteed for this sound - * - * @param id the id of the object - * @param mingain the minimum gain of the object - */ - virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0; - - /** - * max_gain indicates the maximal gain which is always guaranteed for this sound - * - * @param id the id of the object - * @param maxgain the maximum gain of the object - */ - virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0; - /** - * set the distance at which the Listener will experience gain. - * G_dB = GAIN - 20*log10(1 + ROLLOFF_FACTOR*(dist-REFERENCE_DISTANCE)/REFERENCE_DISTANCE ); - * - * @param id the id of the object - * @param referencedistance the distance at which the listener will start hearing - */ - virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0; - - /** - * set the position, velocity and orientation of a sound. - * - * @param id the id of the object - * @param position the position of the object - * @param velocity the velocity of the object - * @param orientation the orientation of the object - * @param lisposition the position of the listener - * @param rollofffactor the rollofffactor of the object - */ - virtual void SetObjectTransform(int id, - const MT_Vector3& position, - const MT_Vector3& velocity, - const MT_Matrix3x3& orientation, - const MT_Vector3& lisposition, - const MT_Scalar& rollofffactor) const =0; - - /** - * make a sound 2D - * - * @param id the id of the object - */ - virtual void ObjectIs2D(int id) const =0; - - /** - * tell the device we want cd suppport - */ - virtual void UseCD() const =0; - - /** - * start playback of the cd - * - * @param track the tracknumber to start playback from - */ - virtual void PlayCD(int track) const =0; - - /** - * pause playback of the cd (true == pause, false == resume) - */ - virtual void PauseCD(bool pause) const =0; - - /** - * stop playback of the cd - */ - virtual void StopCD() const =0; - - /** - * set the playbackmode of the cd - * SND_CD_ALL play all tracks - * SND_CD_TRACK play one track - * SND_CD_TRACKLOOP play one track looped - * SND_CD_RANDOM play all tracks in random order - * - * @param playmode playmode - */ - virtual void SetCDPlaymode(int playmode) const =0; - - /** - * set the volume playback of the cd - * - * @param gain the gain - */ - virtual void SetCDGain(MT_Scalar gain) const =0; - - virtual void StartUsingDSP() =0; - virtual float* GetSpectrum() =0; - virtual void StopUsingDSP() =0; - -protected: - - virtual void RevokeSoundObject(SND_SoundObject* pObject)=0; -}; - -#endif //SND_IAUDIODEVICE - diff --git a/intern/SoundSystem/SND_Scene.h b/intern/SoundSystem/SND_Scene.h deleted file mode 100644 index bb3ff932bce..00000000000 --- a/intern/SoundSystem/SND_Scene.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * SND_Scene.h - * - * The scene for sounds. - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 -#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning -#endif //WIN32 - -#ifndef __SND_SCENE_H -#define __SND_SCENE_H - -#include "SoundDefines.h" -#include "SND_SoundObject.h" -#include "SND_CDObject.h" -#include "SND_SoundListener.h" -#include "SND_WaveSlot.h" - -#include "MT_Vector3.h" -#include "MT_Matrix3x3.h" -#include "STR_String.h" - -#include - - -class SND_Scene -{ - std::set m_soundobjects; - - GEN_List m_activeobjects; - class SND_IAudioDevice* m_audiodevice; - class SND_WaveCache* m_wavecache; - class SND_SoundListener m_listener; - bool m_audio; // to check if audio works - bool m_audioplayback; // to check if audioplayback is wanted - - void UpdateListener(); - void BuildActiveList(MT_Scalar curtime); - void UpdateActiveObects(); - void UpdateCD(); - -public: - SND_Scene(SND_IAudioDevice* adi); - ~SND_Scene(); - - bool IsPlaybackWanted(); - - void AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime); - void RemoveActiveObject(SND_SoundObject* pObject); - void DeleteObjectWhenFinished(SND_SoundObject* pObject); - - void Proceed(); - - int LoadSample(const STR_String& samplename, - void* memlocation, - int size); - void RemoveAllSamples(); - bool CheckBuffer(SND_SoundObject* pObject); - bool IsSampleLoaded(STR_String& samplename); - - void AddObject(SND_SoundObject* pObject); - bool SetCDObject(SND_CDObject* cdobject); - void DeleteObject(SND_SoundObject* pObject); - void RemoveAllObjects(); - void StopAllObjects(); - int GetObjectStatus(SND_SoundObject* pObject) const; - - void SetListenerTransform(const MT_Vector3& pos, - const MT_Vector3& vel, - const MT_Matrix3x3& mat); - - SND_SoundListener* GetListener(); -}; - -#endif //__SND_SCENE_H - diff --git a/intern/SoundSystem/SND_SoundListener.h b/intern/SoundSystem/SND_SoundListener.h deleted file mode 100644 index 2f6a6e8cddd..00000000000 --- a/intern/SoundSystem/SND_SoundListener.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SND_SoundListener.h - * - * A SoundListener is for sound what a camera is for vision. - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 __SND_SOUNDLISTENER_H -#define __SND_SOUNDLISTENER_H - -#include "SND_Object.h" - -class SND_SoundListener : public SND_Object -{ -public: - SND_SoundListener(); - virtual ~SND_SoundListener(); - - void SetStateFlag(unsigned int stateflags); - void SetGain(MT_Scalar gain); - void SetPosition(const MT_Vector3& pos); - void SetVelocity(const MT_Vector3& vel); - void SetOrientation(const MT_Matrix3x3& ori); - void SetDopplerFactor(MT_Scalar dopplerfactor); - void SetDopplerVelocity(MT_Scalar dopplervelocity); - void SetScale(MT_Scalar scale); - - void SetModified(bool modified); - bool IsModified() const; - - unsigned int GetStateFlags() const; - MT_Scalar GetGain() const; - MT_Vector3 GetPosition() const; - MT_Vector3 GetVelocity() const; - MT_Matrix3x3 GetOrientation(); - - MT_Scalar GetDopplerFactor() const; - MT_Scalar GetDopplerVelocity() const; - MT_Scalar GetScale() const; - -private: - void* m_listener; - bool m_modified; - - MT_Scalar m_gain; /* overall gain */ - MT_Vector3 m_position; /* position; left/right, up/down, in/out */ - MT_Vector3 m_velocity; /* velocity of the listener */ - MT_Matrix3x3 m_orientation; /* orientation of the listener */ - - MT_Scalar m_dopplerfactor; /* scaling factor for the Doppler (pitch) shift */ - MT_Scalar m_dopplervelocity; /* factor for the reference velocity (for Dopplereffect) */ - MT_Scalar m_scale; -}; - -#endif //__SND_SOUNDLISTENER_H - diff --git a/intern/SoundSystem/SND_SoundObject.h b/intern/SoundSystem/SND_SoundObject.h deleted file mode 100644 index 7bd43fb4e66..00000000000 --- a/intern/SoundSystem/SND_SoundObject.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * SND_SoundObject.h - * - * Implementation of the abstract sound object - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 __SND_SOUNDOBJECT_H -#define __SND_SOUNDOBJECT_H - -#include "SND_Object.h" -#include "STR_String.h" - -/** - * SND_SoundObject is a class for api independent sounddata storage conected to an actuator - */ - -class SND_SoundObject : public SND_Object -{ -private: - STR_String m_samplename; /* name of the sample */ - STR_String m_objectname; /* name of the object */ - unsigned int m_buffer; - - bool m_active; /* is the object active or not? */ - int m_id; - MT_Scalar m_lifespan; /* the lifespan of the sound seconds */ - MT_Scalar m_timestamp; - - MT_Scalar m_length; /* length of the sample in seconds */ - - MT_Scalar m_gain; /* the gain of the object */ - MT_Scalar m_rollofffactor; /* the scaling factor to increase or decrease the range - of a source by decreasing or increasing the - attenuation, respectively */ - MT_Scalar m_referencedistance;/* the distance at which the listener will experience - gain */ - MT_Scalar m_mingain; /* indicates the minimal gain which is always guaranteed - for this source */ - MT_Scalar m_maxgain; /* indicates the maximal gain which is always guaranteed - for this source */ - - MT_Scalar m_pitch; /* the pitch of the object */ - MT_Vector3 m_position; /* position; left/right, up/down, in/out */ - MT_Vector3 m_velocity; /* velocity of the object */ - MT_Matrix3x3 m_orientation; /* orientation of the object */ - unsigned int m_loopmode; /* loop normal or bidirectional? */ - unsigned int m_loopstart; /* start of looppoint in samples! */ - unsigned int m_loopend; /* end of looppoint in samples! */ - bool m_is3d; /* is the object 3D or 2D? */ - int m_playstate; /* flag for current state of object */ - bool m_modified; - unsigned int m_running; - bool m_highpriority; /* may the sound be ditched when we run out of voices? */ - -public: - - SND_SoundObject(); - ~SND_SoundObject(); - - void SetBuffer(unsigned int buffer); - void SetActive(bool active); - - void StartSound(); - void StopSound(); - void PauseSound(); - void DeleteWhenFinished(); - - void SetObjectName(STR_String objectname); - void SetSampleName(STR_String samplename); - void SetLength(MT_Scalar length); - - void SetPitch(MT_Scalar pitch); - void SetGain(MT_Scalar gain); - void SetMinGain(MT_Scalar mingain); - void SetMaxGain(MT_Scalar maxgain); - void SetRollOffFactor(MT_Scalar rollofffactor); - void SetReferenceDistance(MT_Scalar distance); - void SetPosition(const MT_Vector3& pos); - void SetVelocity(const MT_Vector3& vel); - void SetOrientation(const MT_Matrix3x3& orient); - void SetLoopMode(unsigned int loopmode); - void SetLoopStart(unsigned int loopstart); - void SetLoopEnd(unsigned int loopend); - void Set3D(bool threedee); - void SetPlaystate(int playstate); - void SetHighPriority(bool priority); - - void SetId(int id); - void SetLifeSpan(); - void SetTimeStamp(MT_Scalar timestamp); - - void SetModified(bool modified); - - bool IsLifeSpanOver(MT_Scalar curtime) const; - bool IsActive() const; - bool IsModified() const; - bool IsHighPriority() const; - - void InitRunning(); - bool IsRunning() const; - void AddRunning(); - - int GetId() const; - MT_Scalar GetLifeSpan() const; - MT_Scalar GetTimestamp() const; - - unsigned int GetBuffer(); - const STR_String& GetSampleName(); - const STR_String& GetObjectName(); - - MT_Scalar GetLength() const; - MT_Scalar GetGain() const; - MT_Scalar GetPitch() const; - - MT_Scalar GetMinGain() const; - MT_Scalar GetMaxGain() const; - MT_Scalar GetRollOffFactor() const; - MT_Scalar GetReferenceDistance() const; - - MT_Vector3 GetPosition() const; - MT_Vector3 GetVelocity() const; - MT_Matrix3x3 GetOrientation() const; - unsigned int GetLoopMode() const; - unsigned int GetLoopStart() const; - unsigned int GetLoopEnd() const; - bool Is3D() const; - int GetPlaystate() const; - -}; - -#endif //__SND_SOUNDOBJECT_H - diff --git a/intern/SoundSystem/SND_Utils.h b/intern/SoundSystem/SND_Utils.h deleted file mode 100644 index 82b7c69a595..00000000000 --- a/intern/SoundSystem/SND_Utils.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 SND_UTILS_H -#define SND_UTILS_H - -#include "SND_WaveSlot.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef struct -{ - unsigned char riff[4]; - signed int size; - unsigned char type[4]; -} WavFileHeader; - -typedef struct -{ - unsigned short format; - unsigned short numberofchannels; - unsigned int samplerate; - unsigned int bytespersec; - unsigned short blockalignment; - unsigned short bitrate; -} WavFmtHeader; - -typedef struct -{ - unsigned short size; - unsigned short samplesperblock; -} WavFmtExHeader; - -typedef struct -{ - unsigned int Manufacturer; - unsigned int Product; - unsigned int SamplePeriod; - unsigned int Note; - unsigned int FineTune; - unsigned int SMPTEFormat; - unsigned int SMPTEOffest; - unsigned int loops; - unsigned int SamplerData; - struct - { - unsigned int Identifier; - unsigned int Type; - unsigned int Start; - unsigned int End; - unsigned int Fraction; - unsigned int Count; - } Loop[1]; -} WavSampleHeader; - -typedef struct -{ - unsigned char id[4]; - unsigned int size; -} WavChunkHeader; - -/** - * loads a sample and returns a pointer - */ -extern void* SND_LoadSample(char *filename); - -extern bool SND_IsSampleValid(const STR_String& name, void* memlocation); -extern unsigned int SND_GetSampleFormat(void* sample); -extern unsigned int SND_GetNumberOfChannels(void* sample); -extern unsigned int SND_GetSampleRate(void* sample); -extern unsigned int SND_GetBitRate(void* sample); -extern unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length); -extern unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length); -extern unsigned int SND_GetExtraChunk(void* sample); - -extern void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/intern/SoundSystem/SND_WaveCache.h b/intern/SoundSystem/SND_WaveCache.h deleted file mode 100644 index 2c457797768..00000000000 --- a/intern/SoundSystem/SND_WaveCache.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SND_WaveCache.h - * - * abstract wavecache, a way to organize samples - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 -#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning -#endif //WIN32 - -#ifndef __SND_WAVECACHE_H -#define __SND_WAVECACHE_H - -#include "SND_WaveSlot.h" -#include "SoundDefines.h" -#include "SND_SoundObject.h" -#include - -class SND_WaveCache -{ -public: - SND_WaveCache(); - virtual ~SND_WaveCache(); - - SND_WaveSlot* GetWaveSlot(const STR_String& samplename); - - void RemoveAllSamples(); - void RemoveSample(const STR_String& samplename, int buffer); - -private: - std::map m_samplecache; - - SND_WaveSlot* m_bufferList[NUM_BUFFERS]; - - void FreeSamples(); -}; - -#endif //__SND_WAVECACHE_H - diff --git a/intern/SoundSystem/SND_WaveSlot.h b/intern/SoundSystem/SND_WaveSlot.h deleted file mode 100644 index 75cddfa36d8..00000000000 --- a/intern/SoundSystem/SND_WaveSlot.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * SND_WaveSlot.cpp - * - * class for storing sample related information - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 __SND_WAVESLOT_H -#define __SND_WAVESLOT_H - -#include "STR_String.h" - -class SND_WaveSlot -{ - STR_String m_samplename; - bool m_loaded; - void* m_data; - unsigned int m_buffer; - unsigned int m_sampleformat; - unsigned int m_numberofchannels; - unsigned int m_samplerate; - unsigned int m_bitrate; - unsigned int m_numberofsamples; - unsigned int m_filesize; - -public: - - SND_WaveSlot(): m_loaded(false), - m_data(NULL), - m_buffer(0), - m_sampleformat(0), - m_numberofchannels(0), - m_samplerate(0), - m_bitrate(0), - m_numberofsamples(0), - m_filesize(0) - {}; - ~SND_WaveSlot(); - - void SetSampleName(STR_String samplename); - void SetLoaded(bool loaded); - void SetData(void* data); - void SetBuffer(unsigned int buffer); - void SetSampleFormat(unsigned int sampleformat); - void SetNumberOfChannels(unsigned int numberofchannels); - void SetSampleRate(unsigned int samplerate); - void SetBitRate(unsigned int bitrate); - void SetNumberOfSamples(unsigned int numberofsamples); - void SetFileSize(unsigned int filesize); - - - const STR_String& GetSampleName(); - bool IsLoaded() const; - void* GetData(); - unsigned int GetBuffer() const; - unsigned int GetSampleFormat() const; - unsigned int GetNumberOfChannels() const; - unsigned int GetSampleRate() const; - unsigned int GetBitRate() const; - unsigned int GetNumberOfSamples() const; - unsigned int GetFileSize() const; - -}; - -#endif //__SND_WAVESLOT_H - diff --git a/intern/SoundSystem/SND_test/Makefile b/intern/SoundSystem/SND_test/Makefile deleted file mode 100644 index 279eeace0d8..00000000000 --- a/intern/SoundSystem/SND_test/Makefile +++ /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. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# - -LIBNAME = soundsystem -DIR = $(OCGDIR)/intern/SoundSystem -ALLTARGETS = $(OBJS) $(DIR)/$(DEBUG_DIR)SoundSystem - -include nan_compile.mk - -CPPFLAGS += $(NAN_LEVEL_1_WARNINGS) - -CPPFLAGS += -I$(NAN_MOTO)/include -CPPFLAGS += -I.. -I../SND_BlenderWaveCache -I../SND_OpenAL - -TESTLIB = $(OCGDIR)/gameengine/OpenALSoundSystem/$(DEBUG_DIR)libOpenALSoundSystem.a -TESTLIB += $(OCGDIR)/gameengine/BlenderWaveCache/$(DEBUG_DIR)libBlenderWaveCache.a -TESTLIB += $(OCGDIR)/intern/SoundSystem/$(DEBUG_DIR)libsoundsystem.a -TESTLIB += $(NAN_OPENAL)/lib/libopenal.a - -$(DIR)/$(DEBUG_DIR)SoundSystem: $(OBJS) $(TESTLIB) - $(CC) $(LDFLAGS) -o $@ $(OBJS) $(TESTLIB) -lm -pthread -ldl -lstdc++ diff --git a/intern/SoundSystem/SND_test/SND_test.c b/intern/SoundSystem/SND_test/SND_test.c deleted file mode 100644 index 0d19dc2e131..00000000000 --- a/intern/SoundSystem/SND_test/SND_test.c +++ /dev/null @@ -1,154 +0,0 @@ -/* SND_test.c nov 2000 -* -* testfile for the SND module -* -* janco verduin -* -* $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 "SND_C-api.h" -#include "BlenderWaveCacheCApi.h" -#include "OpenALC-Api.h" -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if defined(WIN32) -#include -#else -#include -#endif -#include - -static int buf[3]; - -float oPos[3]={3.0, 0.0,-1.0}; -float oVel[3]={0.0, 0.0, 1.0}; -float oOri[6]={0.0, 0.0, 1.0, 0.0, 1.0, 0.0}; - -void* ReadFile(char *filename) -{ - int file, filelen; - void *data = NULL; - -#if defined(WIN32) - file = open(filename, O_BINARY|O_RDONLY); -#else - file = open(filename, 0|O_RDONLY); -#endif - - if (file == -1) { - printf("can't open file.\n"); - printf("press q for quit.\n"); - - } - else { - filelen = lseek(file, 0, SEEK_END); - lseek(file, 0, SEEK_SET); - - if (filelen != 0){ - data = malloc(filelen); - if (read(file, data, filelen) != filelen) { - free(data); - data = NULL; - } - } - close(file); - - } - return (data); -} - -int main(int argc, char* argv[]) -{ - int ch; - char* samplename = NULL; - void* sampleinmemory = NULL; - SND_CacheHandle wavecache = NULL; - SND_SceneHandle scene = NULL; - SND_ObjectHandle object = NULL; - - wavecache = SND_GetWaveCache(); - scene = SND_CreateOpenALScene(wavecache); - - samplename = "2.wav"; - sampleinmemory = ReadFile(samplename); - - if (sampleinmemory) { - - object = SND_CreateObject(); - SND_AddMemoryLocation(samplename, sampleinmemory); - SND_SetSampleName(object, samplename); - SND_AddObject(scene, object); - printf("go your gang...\n"); - printf("1: play\n"); - printf("2: stop\n"); - printf("q: quit\n"); - } - do - { - ch = getchar(); - ch = toupper(ch); - switch (ch) - { - case '1': - { - SND_SetPitch(object, 1.0); - SND_SetGain(object, 1.0); - SND_StartSound(object); - break; - } - case '2': - { - SND_StopSound(object); - break; - } - default: - break; - } - - SND_Proceed(scene); - - } while (ch != 'Q'); - - if (object) { - - SND_RemoveObject(scene, object); - SND_DeleteObject(object); - } - - SND_DeleteScene(scene); - SND_DeleteCache(); - - return 0; - -} diff --git a/intern/SoundSystem/SoundDefines.h b/intern/SoundSystem/SoundDefines.h deleted file mode 100644 index 5238507c866..00000000000 --- a/intern/SoundSystem/SoundDefines.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * SoundDefines.h - * - * this is where all kinds of defines are stored - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 __SOUNDDEFINES_H -#define __SOUNDDEFINES_H - -/* the types of devices */ -enum -{ - snd_e_dummydevice = 0, - snd_e_openaldevice -}; - -/* general stuff */ -#define NUM_BUFFERS 128 -#define NUM_SOURCES 24 /* 24 is the limit for openal on windows, was 16 in 2.47 and previous */ - -/* openal related stuff */ -#define AL_LOOPING 0x1007 - -/* activelist defines */ -enum -{ - SND_REMOVE_ACTIVE_OBJECT = 0, - SND_ADD_ACTIVE_OBJECT, - SND_DO_NOTHING -}; - -/* playstate flags */ -enum -{ - SND_UNKNOWN = -1, - SND_INITIAL, - SND_MUST_PLAY, - SND_PLAYING, - SND_MUST_STOP, - SND_STOPPED, - SND_MUST_PAUSE, - SND_PAUSED, - SND_MUST_RESUME, - SND_MUST_STOP_WHEN_FINISHED, - SND_MUST_BE_DELETED -}; - -/* loopmodes */ -enum -{ - SND_LOOP_OFF = 0, - SND_LOOP_NORMAL, - SND_LOOP_BIDIRECTIONAL -}; - - -/* cd playstate flags */ -enum -{ - SND_CD_ALL = 0, - SND_CD_TRACK, - SND_CD_TRACKLOOP -}; - -/* sample types */ -enum -{ - SND_WAVE_FORMAT_UNKNOWN = 0, - SND_WAVE_FORMAT_PCM, - SND_WAVE_FORMAT_ADPCM, - SND_WAVE_FORMAT_ALAW = 6, - SND_WAVE_FORMAT_MULAW, - SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 17, - SND_WAVE_FORMAT_CONTROL_RES_VQLPC = 34, - SND_WAVE_FORMAT_GSM_610 = 49, - SND_WAVE_FORMAT_MPEG3 = 85 -}; - -#endif //__SOUNDDEFINES_H - diff --git a/intern/SoundSystem/dummy/Makefile b/intern/SoundSystem/dummy/Makefile deleted file mode 100644 index 829135dde98..00000000000 --- a/intern/SoundSystem/dummy/Makefile +++ /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 ***** -# -# - -LIBNAME = DummySoundSystem -DIR = $(OCGDIR)/intern/$(LIBNAME) - -include nan_compile.mk - -CCFLAGS += $(LEVEL_1_CPP_WARNINGS) - -CPPFLAGS += -I$(NAN_STRING)/include -CPPFLAGS += -I$(NAN_MOTO)/include -CPPFLAGS += -I../intern -CPPFLAGS += -I.. -CPPFLAGS += -I. diff --git a/intern/SoundSystem/dummy/SND_DummyDevice.cpp b/intern/SoundSystem/dummy/SND_DummyDevice.cpp deleted file mode 100644 index 672c73e9c52..00000000000 --- a/intern/SoundSystem/dummy/SND_DummyDevice.cpp +++ /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 ***** - * SND_DummyDevice derived from SND_IAudioDevice - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning -#endif //WIN32 - -#include "SND_DummyDevice.h" - -SND_DummyDevice::SND_DummyDevice() -{ -} - -SND_DummyDevice::~SND_DummyDevice() -{ -#ifdef ONTKEVER - printf("SND_DummyDevice destructor"); -#endif -} - - diff --git a/intern/SoundSystem/dummy/SND_DummyDevice.h b/intern/SoundSystem/dummy/SND_DummyDevice.h deleted file mode 100644 index 988f731d1bf..00000000000 --- a/intern/SoundSystem/dummy/SND_DummyDevice.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 SND_DUMMYDEVICE -#define SND_DUMMYDEVICE - -#include "SND_AudioDevice.h" - -class SND_DummyDevice : public SND_AudioDevice -{ -public: - SND_DummyDevice(); - ~SND_DummyDevice(); - - bool Init() { return false; } - - SND_WaveSlot* LoadSample(const STR_String& samplename, - void* memlocation, - int size) { return NULL; } - - void InitListener() {}; - void SetListenerGain(float gain) const {}; - void SetDopplerVelocity(MT_Scalar dopplervelocity) const {}; - void SetDopplerFactor(MT_Scalar dopplerfactor) const {}; - void SetListenerRollOffFactor(MT_Scalar rollofffactor) const {}; - - void MakeCurrent() const {}; - - void NextFrame() const {}; - - void SetObjectBuffer(int id, unsigned int buffer) {}; - - int GetPlayState(int id) { return SND_UNKNOWN; } - void PlayObject(int id) {}; - void StopObject(int id) const {}; - void StopAllObjects() {}; - void PauseObject(int id) const {}; - - void SetObjectLoop(int id, unsigned int loopmode) const {}; - void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const {}; - void SetObjectPitch(int id, MT_Scalar pitch) const {}; - void SetObjectGain(int id, MT_Scalar gain) const {}; - void SetObjectMinGain(int id, MT_Scalar mingain) const {}; - void SetObjectMaxGain(int id, MT_Scalar maxgain) const {}; - void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const {}; - void SetObjectReferenceDistance(int id, MT_Scalar distance) const {}; - - void SetObjectTransform(int id, - const MT_Vector3& position, - const MT_Vector3& velocity, - const MT_Matrix3x3& orientation, - const MT_Vector3& lisposition, - const MT_Scalar& rollofffactor) const {}; - void ObjectIs2D(int id) const {}; - - void PlayCD(int track) const {}; - void PauseCD(bool pause) const {}; - void StopCD() const {}; - void SetCDPlaymode(int playmode) const {}; - void SetCDGain(MT_Scalar gain) const {}; - - void StartUsingDSP() {}; - float* GetSpectrum() { return NULL; } - void StopUsingDSP() {}; -}; - -#endif //SND_DUMMYDEVICE - diff --git a/intern/SoundSystem/intern/Makefile b/intern/SoundSystem/intern/Makefile deleted file mode 100644 index 7684b6b0bca..00000000000 --- a/intern/SoundSystem/intern/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 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 ***** -# -# - -LIBNAME = SoundSystem -DIR = $(OCGDIR)/intern/SoundSystem - -include nan_compile.mk - -CCFLAGS += $(LEVEL_1_CPP_WARNINGS) - -CPPFLAGS += -I$(NAN_STRING)/include -CPPFLAGS += -I$(NAN_MOTO)/include -CPPFLAGS += -I../../../source/blender/include -CPPFLAGS += -I../dummy -CPPFLAGS += -I../openal -CPPFLAGS += -I.. -CPPFLAGS += -I. diff --git a/intern/SoundSystem/intern/SND_AudioDevice.cpp b/intern/SoundSystem/intern/SND_AudioDevice.cpp deleted file mode 100644 index 4a5c0e2c498..00000000000 --- a/intern/SoundSystem/intern/SND_AudioDevice.cpp +++ /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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include "SND_AudioDevice.h" -#include "SND_SoundObject.h" - -#ifdef WIN32 -// This warning tells us about truncation of __long__ stl-generated names. -// It can occasionally cause DevStudio to have internal compiler warnings. -#pragma warning( disable : 4786 ) -#endif - - -SND_AudioDevice::SND_AudioDevice() -{ - m_wavecache = NULL; - m_audio = false; - - for (int i = 0; i < NUM_SOURCES; i++) - { - m_idObjectArray[i] = new SND_IdObject(); - m_idObjectArray[i]->SetId(i); - m_idObjectArray[i]->SetSoundObject(NULL); - m_idObjectList.addTail(m_idObjectArray[i]); - } -} - - - -SND_AudioDevice::~SND_AudioDevice() -{ - for (int i = 0; i < NUM_SOURCES; i++) - { - delete m_idObjectArray[i]; - m_idObjectArray[i] = NULL; - } - - if (m_wavecache) - { - delete m_wavecache; - m_wavecache = NULL; - } -} - - - -bool SND_AudioDevice::IsInitialized() -{ - return m_audio; -} - - - -SND_WaveCache* SND_AudioDevice::GetWaveCache() const -{ - return m_wavecache; -} - - - -/* seeks an unused id and returns it */ -bool SND_AudioDevice::GetNewId(SND_SoundObject* pObject) -{ -#ifdef ONTKEVER - printf("SND_AudioDevice::GetNewId\n"); -#endif - - bool result = false; - - // first, get the oldest (the first) idobject - SND_IdObject* pIdObject = (SND_IdObject*)m_idObjectList.getHead(); - - if (pIdObject->isTail()) - { - } - else - { - // find the first id object which doesn't have a high priority soundobject - bool ThisSoundMustStay = false; - bool OutOfIds = false; - - do - { - // if no soundobject present, it's seat may be taken - if (pIdObject->GetSoundObject()) - { - // and also if it ain't highprio - if (pIdObject->GetSoundObject()->IsHighPriority()) - { - ThisSoundMustStay = true; - pIdObject = (SND_IdObject*)pIdObject->getNext(); - - // if the last one is a priority sound too, then there are no id's left - // and we won't add any new sounds - if (pIdObject->isTail()) - OutOfIds = true; - } - else - { - ThisSoundMustStay = false; - } - } - else - { - ThisSoundMustStay = false; - } - - } while (ThisSoundMustStay && !OutOfIds); - - if (!OutOfIds) - { - SND_SoundObject* oldobject = pIdObject->GetSoundObject(); - - // revoke the old object if present - if (oldobject) - { -#ifdef ONTKEVER - printf("oldobject: %x\n", oldobject); -#endif - RevokeSoundObject(oldobject); - } - - // set the new soundobject into the idobject - pIdObject->SetSoundObject(pObject); - - // set the id into the soundobject - int id = pIdObject->GetId(); - pObject->SetId(id); - - // connect the new id to the buffer the sample is stored in - SetObjectBuffer(id, pObject->GetBuffer()); - - // remove the idobject from the list and add it in the back again - pIdObject->remove(); - m_idObjectList.addTail(pIdObject); - - result = true; - } - } - - return result; -} - - - -void SND_AudioDevice::ClearId(SND_SoundObject* pObject) -{ -#ifdef ONTKEVER - printf("SND_AudioDevice::ClearId\n"); -#endif - - if (pObject) - { - int id = pObject->GetId(); - - if (id != -1) - { - // lets get the idobject belonging to the soundobject - SND_IdObject* pIdObject = m_idObjectArray[id]; - SND_SoundObject* oldobject = pIdObject->GetSoundObject(); - - if (oldobject) - { - RevokeSoundObject(oldobject); - - // clear the idobject from the soundobject - pIdObject->SetSoundObject(NULL); - } - - // remove the idobject and place it in front - pIdObject->remove(); - m_idObjectList.addHead(pIdObject); - } - } -} - - - -void SND_AudioDevice::RevokeSoundObject(SND_SoundObject* pObject) -{ -#ifdef ONTKEVER - printf("SND_AudioDevice::RevokeSoundObject\n"); -#endif - - // stop the soundobject - int id = pObject->GetId(); - - if (id >= 0 && id < NUM_SOURCES) - { - StopObject(id); - - // remove the object from the 'activelist' - pObject->SetActive(false); - -#ifdef ONTKEVER - printf("pObject->remove();\n"); -#endif - } - - // make sure its id is invalid - pObject->SetId(-1); -} - -/* -void SND_AudioDevice::RemoveSample(const char* filename) -{ - if (m_wavecache) - m_wavecache->RemoveSample(filename); -} -*/ - -void SND_AudioDevice::RemoveAllSamples() -{ - if (m_wavecache) - m_wavecache->RemoveAllSamples(); -} - diff --git a/intern/SoundSystem/intern/SND_AudioDevice.h b/intern/SoundSystem/intern/SND_AudioDevice.h deleted file mode 100644 index 54e8feea90e..00000000000 --- a/intern/SoundSystem/intern/SND_AudioDevice.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 SND_AUDIODEVICE -#define SND_AUDIODEVICE - -#include "SND_IAudioDevice.h" -#include "SoundDefines.h" -#include "SND_IdObject.h" - -class SND_AudioDevice : public SND_IAudioDevice -{ -public: - SND_AudioDevice(); - virtual ~SND_AudioDevice(); - - virtual bool IsInitialized(); - - SND_WaveCache* GetWaveCache() const; - - bool GetNewId(SND_SoundObject* pObject); - void ClearId(SND_SoundObject* pObject); - - void UseCD() const {}; - - /* to be implemented in derived class - - virtual SND_WaveSlot* LoadSample(const STR_String& samplename, - void* memlocation, - int size) =0; - */ -// void RemoveSample(const char* filename); - void RemoveAllSamples(); - - /* to be implemented in derived class - - virtual void InitListener()=0; - virtual void SetListenerGain(float gain) const =0; - virtual void SetDopplerVelocity(MT_Scalar dopplervelocity) const =0; - virtual void SetDopplerFactor(MT_Scalar dopplerfactor) const =0; - virtual void SetListenerRollOffFactor(MT_Scalar rollofffactor) const =0; - - virtual void MakeCurrent() const =0; - - virtual void UpdateDevice() const =0; - - virtual void SetObjectBuffer(int id, unsigned int buffer)=0; - virtual int GetPlayState(int id)=0; - virtual void PlayObject(int id)=0; - virtual void StopObject(int id) const =0; - virtual void StopAllObjects()=0; - virtual void PauseObject(int id) const =0; - - virtual void SetObjectLoop(int id, bool loop) const =0; - virtual void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const =0; - virtual void SetObjectPitch(int id, MT_Scalar pitch) const =0; - virtual void SetObjectGain(int id, MT_Scalar gain) const =0; - virtual void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const =0; - virtual void SetObjectMinGain(int id, MT_Scalar mingain) const =0; - virtual void SetObjectMaxGain(int id, MT_Scalar maxgain) const =0; - virtual void SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const =0; - - virtual void SetObjectTransform(int id, - const MT_Vector3& position, - const MT_Vector3& velocity, - const MT_Matrix3x3& orientation, - const MT_Vector3& lisposition, - const MT_Scalar& rollofffactor) const =0; - virtual void ObjectIs2D(int id) const =0; - - virtual void PlayCD(int track) const =0; - virtual void PauseCD(bool pause) const =0; - virtual void StopCD() const =0; - virtual void SetCDPlaymode(int playmode) const =0; - virtual void SetCDGain(MT_Scalar gain) const =0; - virtual float* GetSpectrum() =0; - */ - -protected: - bool m_audio; - GEN_List m_idObjectList; - SND_IdObject* m_idObjectArray[NUM_SOURCES]; - SND_WaveCache* m_wavecache; - -private: - void RevokeSoundObject(SND_SoundObject* pObject); -}; - -#endif //SND_AUDIODEVICE - diff --git a/intern/SoundSystem/intern/SND_C-api.cpp b/intern/SoundSystem/intern/SND_C-api.cpp deleted file mode 100644 index 09846269dcc..00000000000 --- a/intern/SoundSystem/intern/SND_C-api.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/* - * SND_C-Api.cpp - * - * C Api for soundmodule - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 -#endif - -#include "SND_C-api.h" -#include "SND_DeviceManager.h" -#include "SND_Scene.h" - -#ifdef WIN32 -#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning -#endif //WIN32 - - - -void SND_SetDeviceType(int device_type) -{ - SND_DeviceManager::SetDeviceType(device_type); -} - - - -SND_AudioDeviceInterfaceHandle SND_GetAudioDevice() -{ - SND_IAudioDevice* audiodevice = NULL; - - SND_DeviceManager::Subscribe(); - audiodevice = SND_DeviceManager::Instance(); - - if (!audiodevice->IsInitialized()) - { - SND_DeviceManager::SetDeviceType(snd_e_dummydevice); - audiodevice = SND_DeviceManager::Instance(); - } - - return (SND_AudioDeviceInterfaceHandle)audiodevice; -} - - - -void SND_ReleaseDevice() -{ - SND_DeviceManager::Unsubscribe(); -} - - - -int SND_IsPlaybackWanted(SND_SceneHandle scene) -{ - assert(scene); - bool result = ((SND_Scene*)scene)->IsPlaybackWanted(); - - return (int)result; -} - - - -// create a scene -SND_SceneHandle SND_CreateScene(SND_AudioDeviceInterfaceHandle audiodevice) -{ - // initialize sound scene and object - SND_Scene* scene = new SND_Scene((SND_IAudioDevice*)audiodevice); - - return (SND_SceneHandle)scene; -} - - - -void SND_DeleteScene(SND_SceneHandle scene) -{ - assert(scene); - delete (SND_Scene*)scene; -} - - - -int SND_AddSample(SND_SceneHandle scene, - const char* filename, - void* memlocation, - int size) -{ - assert(scene); - assert(memlocation); - int buffer = ((SND_Scene*)scene)->LoadSample(filename, memlocation, size); - - return buffer; -} - - - -void SND_RemoveAllSamples(SND_SceneHandle scene) -{ - assert(scene); - ((SND_Scene*)scene)->RemoveAllSamples(); -} - - - -int SND_CheckBuffer(SND_SceneHandle scene, SND_ObjectHandle object) -{ - assert(scene); - assert(object); - int result = (int)((SND_Scene*)scene)->CheckBuffer((SND_SoundObject*)object); - - return result; -} - - - -void SND_AddSound(SND_SceneHandle scene, SND_ObjectHandle object) -{ - assert(scene); - assert(object); - ((SND_Scene*)scene)->AddObject((SND_SoundObject *)object); -} - - - -void SND_RemoveSound(SND_SceneHandle scene, SND_ObjectHandle object) -{ - assert(scene); - assert(object); - ((SND_Scene*)scene)->DeleteObject((SND_SoundObject *)object); -} - - - -void SND_RemoveAllSounds(SND_SceneHandle scene) -{ - assert(scene); - ((SND_Scene*)scene)->RemoveAllObjects(); -} - - - -void SND_StopAllSounds(SND_SceneHandle scene) -{ - assert(scene); - ((SND_Scene*)scene)->StopAllObjects(); -} - - - -void SND_Proceed(SND_AudioDeviceInterfaceHandle audiodevice, SND_SceneHandle scene) -{ - assert(scene); - ((SND_Scene*)scene)->Proceed(); - ((SND_IAudioDevice*)audiodevice)->NextFrame(); -} - - - -SND_ListenerHandle SND_GetListener(SND_SceneHandle scene) -{ - assert(scene); - return (SND_ListenerHandle)((SND_Scene*)scene)->GetListener(); -} - - - -void SND_SetListenerGain(SND_SceneHandle scene, double gain) -{ - assert(scene); - SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener(); - listener->SetGain((MT_Scalar)gain); -} - - - -void SND_SetDopplerFactor(SND_SceneHandle scene, double dopplerfactor) -{ - assert(scene); - SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener(); - listener->SetDopplerFactor(dopplerfactor); -} - - - -void SND_SetDopplerVelocity(SND_SceneHandle scene, double dopplervelocity) -{ - assert(scene); - SND_SoundListener* listener = ((SND_Scene*)scene)->GetListener(); - listener->SetDopplerVelocity(dopplervelocity); -} - - - -// Object instantiation -SND_ObjectHandle SND_CreateSound() -{ - return (SND_ObjectHandle)new SND_SoundObject(); -} - - - -void SND_DeleteSound(SND_ObjectHandle object) -{ - assert(object); - delete (SND_SoundObject*)object; -} - - - -// Object control -void SND_StartSound(SND_SceneHandle scene, SND_ObjectHandle object) -{ - assert(scene); - assert(object); - ((SND_Scene*)scene)->AddActiveObject((SND_SoundObject*)object, 0); -} - - - -void SND_StopSound(SND_SceneHandle scene, SND_ObjectHandle object) -{ - assert(scene); - assert(object); - ((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object); -} - - - -void SND_PauseSound(SND_SceneHandle scene, SND_ObjectHandle object) -{ - assert(scene); - assert(object); - ((SND_Scene*)scene)->RemoveActiveObject((SND_SoundObject*)object); -} - - - -void SND_SetSampleName(SND_ObjectHandle object, char* samplename) -{ - assert(object); - STR_String name = samplename; - ((SND_SoundObject*)object)->SetSampleName(name); -} - - - -void SND_SetGain(SND_ObjectHandle object, double gain) -{ - assert(object); - ((SND_SoundObject*)object)->SetGain(gain); -} - - - -void SND_SetMinimumGain(SND_ObjectHandle object, double minimumgain) -{ - assert(object); - ((SND_SoundObject*)object)->SetMinGain(minimumgain); -} - - - -void SND_SetMaximumGain(SND_ObjectHandle object, double maximumgain) -{ - assert(object); - ((SND_SoundObject*)object)->SetMaxGain(maximumgain); -} - - - -void SND_SetRollOffFactor(SND_ObjectHandle object, double rollofffactor) -{ - assert(object); - ((SND_SoundObject*)object)->SetRollOffFactor(rollofffactor); -} - - - -void SND_SetReferenceDistance(SND_ObjectHandle object, double referencedistance) -{ - assert(object); - ((SND_SoundObject*)object)->SetReferenceDistance(referencedistance); -} - - - -void SND_SetPitch(SND_ObjectHandle object, double pitch) -{ - assert(object); - ((SND_SoundObject*)object)->SetPitch(pitch); -} - - - -void SND_SetPosition(SND_ObjectHandle object, double* position) -{ - assert(object); - ((SND_SoundObject*)object)->SetPosition(position); -} - - - -void SND_SetVelocity(SND_ObjectHandle object, double* velocity) -{ - assert(object); - ((SND_SoundObject*)object)->SetVelocity(velocity); -} - - - -void SND_SetOrientation(SND_ObjectHandle object, double* orientation) -{ - assert(object); - ((SND_SoundObject*)object)->SetOrientation(orientation); -} - - - -void SND_SetLoopMode(SND_ObjectHandle object, int loopmode) -{ - assert(object); - ((SND_SoundObject*)object)->SetLoopMode(loopmode); -} - - - -void SND_SetLoopPoints(SND_ObjectHandle object, unsigned int loopstart, unsigned int loopend) -{ - assert(object); - ((SND_SoundObject*)object)->SetLoopStart(loopstart); - ((SND_SoundObject*)object)->SetLoopEnd(loopend); -} - - - -float SND_GetGain(SND_ObjectHandle object) -{ - assert(object); - MT_Scalar gain = ((SND_SoundObject*)object)->GetGain(); - return (float) gain; -} - - - -float SND_GetPitch(SND_ObjectHandle object) -{ - assert(object); - MT_Scalar pitch = ((SND_SoundObject*)object)->GetPitch(); - return (float) pitch; -} - - - -int SND_GetLoopMode(SND_ObjectHandle object) -{ - assert(object); - return ((SND_SoundObject*)object)->GetLoopMode(); -} - - - -int SND_GetPlaystate(SND_ObjectHandle object) -{ - assert(object); - return ((SND_SoundObject*)object)->GetPlaystate(); -} diff --git a/intern/SoundSystem/intern/SND_CDObject.cpp b/intern/SoundSystem/intern/SND_CDObject.cpp deleted file mode 100644 index 089e0d554e4..00000000000 --- a/intern/SoundSystem/intern/SND_CDObject.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/* - * SND_CDObject.cpp - * - * Implementation for CD playback - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 "SND_CDObject.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -SND_CDObject* SND_CDObject::m_instance = NULL; - -bool SND_CDObject::CreateSystem() -{ - bool result = false; - - if (!m_instance) - { - m_instance = new SND_CDObject(); - result = true; - } - - return result; -} - - - -bool SND_CDObject::DisposeSystem() -{ - bool result = false; - - if (m_instance) - { - delete m_instance; - m_instance = NULL; - result = true; - } - - return result; -} - - - -SND_CDObject* SND_CDObject::Instance() -{ - return m_instance; -} - - - -SND_CDObject::SND_CDObject() -{ - m_gain = 1; - m_playmode = SND_CD_ALL; - m_track = 1; - m_playstate = SND_STOPPED; - m_used = false; - - // don't set the cd standard on modified: - // if not used, we don't wanna touch it (performance) - m_modified = false; -} - - - -SND_CDObject::~SND_CDObject() -{ -} - - - -void SND_CDObject::SetGain(MT_Scalar gain) -{ - m_gain = gain; - m_modified = true; -} - - - -void SND_CDObject::SetPlaymode(int playmode) -{ - m_playmode = playmode; -} - - - -void SND_CDObject::SetPlaystate(int playstate) -{ - m_playstate = playstate; -} - - - -void SND_CDObject::SetTrack(int track) -{ - m_track = track; -} - - - -int SND_CDObject::GetTrack() const -{ - return m_track; -} - - - -MT_Scalar SND_CDObject::GetGain() const -{ - return m_gain; -} - - -int SND_CDObject::GetPlaystate() const -{ - return m_playstate; -} - - - -bool SND_CDObject::IsModified() const -{ - return m_modified; -} - - - -void SND_CDObject::SetModified(bool modified) -{ - m_modified = modified; -} - - - -int SND_CDObject::GetPlaymode() const -{ - return m_playmode; -} - - - -void SND_CDObject::SetUsed() -{ - m_used = true; -} - - - -bool SND_CDObject::GetUsed() -{ - return m_used; -} - diff --git a/intern/SoundSystem/intern/SND_DeviceManager.cpp b/intern/SoundSystem/intern/SND_DeviceManager.cpp deleted file mode 100644 index c4bc887dffe..00000000000 --- a/intern/SoundSystem/intern/SND_DeviceManager.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * SND_DeviceManager.h - * - * singleton for creating, switching and deleting audiodevices - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 -#endif - -#include "SND_DeviceManager.h" -#include "SND_DependKludge.h" -#include "SND_DummyDevice.h" -#ifdef USE_OPENAL -#include "SND_OpenALDevice.h" -#endif - -SND_IAudioDevice* SND_DeviceManager::m_instance = NULL; -int SND_DeviceManager::m_subscriptions = 0; - -#ifdef USE_OPENAL -int SND_DeviceManager::m_device_type = snd_e_openaldevice; -#else -int SND_DeviceManager::m_device_type = snd_e_dummydevice; -#endif - -void SND_DeviceManager::Subscribe() -{ - ++m_subscriptions; -} - - - -void SND_DeviceManager::Unsubscribe() -{ - --m_subscriptions; - - // only release memory if there is a m_instance but no subscriptions left - if (m_subscriptions == 0 && m_instance) - { - delete m_instance; - m_instance = NULL; - } - - if (m_subscriptions < 0) - m_subscriptions = 0; -} - - - -SND_IAudioDevice* SND_DeviceManager::Instance() -{ - // only give away an instance if there are subscriptions - if (m_subscriptions) - { - // if there's no instance yet, set and create a new one - if (m_instance == NULL) - { - SetDeviceType(m_device_type); - } - - return m_instance; - } - else - { - return NULL; - } -} - - - -void SND_DeviceManager::SetDeviceType(int device_type) -{ - // if we want to change devicetype, first delete the old one - if (m_instance) - { - delete m_instance; - m_instance = NULL; - } - - // let's create the chosen device - switch (device_type) - { -#ifdef USE_OPENAL - case snd_e_openaldevice: - { - m_instance = new SND_OpenALDevice(); - m_device_type = device_type; - break; - } -#endif - default: - { - m_instance = new SND_DummyDevice(); - m_device_type = device_type; - break; - } - } -} diff --git a/intern/SoundSystem/intern/SND_IdObject.cpp b/intern/SoundSystem/intern/SND_IdObject.cpp deleted file mode 100644 index b261442db0a..00000000000 --- a/intern/SoundSystem/intern/SND_IdObject.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * SND_IdObject.cpp - * - * Object for storing runtime data, like id's, soundobjects etc - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 "SND_IdObject.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -SND_IdObject::SND_IdObject() -{ -} - - - -SND_IdObject::~SND_IdObject() -{ -} - - - -SND_SoundObject* SND_IdObject::GetSoundObject() -{ - return m_soundObject; -} - - - -void SND_IdObject::SetSoundObject(SND_SoundObject* pObject) -{ - m_soundObject = pObject; -} - - - -int SND_IdObject::GetId() -{ - return m_id; -} - - - -void SND_IdObject::SetId(int id) -{ - m_id = id; -} diff --git a/intern/SoundSystem/intern/SND_IdObject.h b/intern/SoundSystem/intern/SND_IdObject.h deleted file mode 100644 index 86611b026f0..00000000000 --- a/intern/SoundSystem/intern/SND_IdObject.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SND_IdObject.h - * - * Object for storing runtime data, like id's, soundobjects etc - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 __SND_IDOBJECT_H -#define __SND_IDOBJECT_H - -#include "SND_SoundObject.h" -#include "GEN_List.h" -#include "SoundDefines.h" - -class SND_IdObject : public GEN_Link -{ - SND_SoundObject* m_soundObject; - int m_id; - -public: - SND_IdObject(); - virtual ~SND_IdObject(); - - SND_SoundObject* GetSoundObject(); - void SetSoundObject(SND_SoundObject* pObject); - - int GetId(); - void SetId(int id); -}; - -#endif //__SND_OBJECT_H - diff --git a/intern/SoundSystem/intern/SND_Scene.cpp b/intern/SoundSystem/intern/SND_Scene.cpp deleted file mode 100644 index af1b43a08aa..00000000000 --- a/intern/SoundSystem/intern/SND_Scene.cpp +++ /dev/null @@ -1,544 +0,0 @@ -/* -* SND_Scene.cpp -* -* The scene for sounds. -* -* $Id$ -* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 -#endif - -#ifdef WIN32 -#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning -#endif //WIN32 - -#include "SND_Scene.h" -#include "SND_DependKludge.h" -#include "SND_IAudioDevice.h" - -#include -#include - -//static unsigned int tijd = 0; - -SND_Scene::SND_Scene(SND_IAudioDevice* audiodevice) - : m_audiodevice(audiodevice) -{ - if (m_audiodevice) - m_wavecache = m_audiodevice->GetWaveCache(); - - if (!m_wavecache || !audiodevice) - { - m_audio = false; - } - else - { - //if so, go ahead! - m_audio = true; -#ifdef ONTKEVER - printf("SND_Scene::SND_Scene() m_audio == true\n"); -#endif - m_audiodevice->InitListener(); - } - - IsPlaybackWanted(); -} - - - -SND_Scene::~SND_Scene() -{ - StopAllObjects(); -} - - - -// check if audioplayback is wanted -bool SND_Scene::IsPlaybackWanted() -{ - /* Removed the functionality for checking if noaudio was provided on */ - /* the commandline. */ - if (m_audiodevice && m_wavecache) - { - m_audioplayback = true; - } - else - { - StopAllObjects(); - m_audioplayback = false; - } - - return m_audioplayback; -} - - - -int SND_Scene::LoadSample(const STR_String& samplename, - void* memlocation, - int size) -{ - int result = -1; - - if (m_audiodevice) - { - SND_WaveSlot* waveslot = m_audiodevice->LoadSample(samplename, memlocation, size); - - if (waveslot) - result = waveslot->GetBuffer(); - } - - return result; -} - - - -void SND_Scene::RemoveAllSamples() -{ - if (m_audio && m_audiodevice) - m_audiodevice->RemoveAllSamples(); -} - - - -bool SND_Scene::CheckBuffer(SND_SoundObject* pObject) -{ - bool result = false; - - if (pObject && m_wavecache) - { - SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(pObject->GetSampleName()); - - if (waveslot) - { - pObject->SetBuffer(waveslot->GetBuffer()); - - result = true; - } - } - - return result; -} - - - -bool SND_Scene::IsSampleLoaded(STR_String& samplename) -{ - bool result = false; - - if (samplename && m_wavecache) - { - SND_WaveSlot* waveslot = m_wavecache->GetWaveSlot(samplename); - - if (waveslot && waveslot->IsLoaded()) - result = true; - } - - return result; -} - - - -void SND_Scene::AddObject(SND_SoundObject* pObject) -{ - if (m_audio) - { - STR_String samplename = pObject->GetSampleName(); - SND_WaveSlot* slot = NULL; - - // don't add the object if no valid sample is referenced - if (samplename != "") - { - // check if the sample is already loaded - slot = m_wavecache->GetWaveSlot(samplename); - } - - if (slot) - { - pObject->SetBuffer(slot->GetBuffer()); - - // needed for expected lifespan of the sample, but ain't necesary anymore i think - MT_Scalar samplelength = slot->GetNumberOfSamples(); - MT_Scalar samplerate = slot->GetSampleRate(); - MT_Scalar soundlength = samplelength/samplerate; - pObject->SetLength(soundlength); - - // add the object to the list - m_soundobjects.insert((SND_SoundObject*)pObject); - } - } -} - - - -void SND_Scene::SetListenerTransform(const MT_Vector3& pos, - const MT_Vector3& vel, - const MT_Matrix3x3& ori) -{ - if (m_audio) - { - GetListener()->SetPosition(pos); - GetListener()->SetVelocity(vel); - GetListener()->SetOrientation(ori); - } -} - - - -void SND_Scene::UpdateListener() -{ - // process the listener if modified - if (m_listener.IsModified()) - { - m_audiodevice->SetListenerGain(m_listener.GetGain()); - m_audiodevice->SetDopplerVelocity(m_listener.GetDopplerVelocity()); - m_audiodevice->SetDopplerFactor(m_listener.GetDopplerFactor()); - m_listener.SetModified(false); - } -} - - - -void SND_Scene::AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime) -{ - if (m_audio) - { - if (pObject) - { -#ifdef ONTKEVER - printf("SND_Scene::AddActiveObject\n"); -#endif - - // first check if the object is already on the list - if (pObject->IsActive()) - { - pObject->SetTimeStamp(curtime); - pObject->StartSound(); - } - else - { - pObject->SetTimeStamp(curtime); - - // compute the expected lifespan - pObject->SetLifeSpan(); - - // lets give the new active-to-be object an id - if (m_audiodevice->GetNewId(pObject)) - { - // and add the object - m_activeobjects.addTail(pObject); - pObject->StartSound(); - pObject->SetActive(true); - } - } - } - } -} - - - -void SND_Scene::RemoveActiveObject(SND_SoundObject* pObject) -{ - if (m_audio) - { - if (pObject) - { -#ifdef ONTKEVER - printf("SND_Scene::RemoveActiveObject\n"); -#endif - // if inactive, remove it from the list - if (pObject->IsActive()) - { - // first make sure it is stopped - m_audiodevice->ClearId(pObject); - } - } - } -} - - - -void SND_Scene::UpdateActiveObects() -{ -// ++tijd; - - SND_SoundObject* pObject; - // update only the objects that need to be updated - for (pObject = (SND_SoundObject*)m_activeobjects.getHead(); - !pObject->isTail(); - pObject = (SND_SoundObject*)pObject->getNext()) - { - int id = pObject->GetId(); - - if (id >= 0) - { - if (pObject->Is3D()) - { - // Get the global positions and velocity vectors - // of the listener and soundobject - MT_Vector3 op = pObject->GetPosition(); - MT_Vector3 lp = m_listener.GetPosition(); - MT_Vector3 position = op - lp; - - // Calculate relative velocity in global coordinates - // of the sound with respect to the listener. - MT_Vector3 ov = pObject->GetVelocity(); - MT_Vector3 lv = m_listener.GetVelocity(); - MT_Vector3 velocity = ov - lv; - - // Now map the object position and velocity into - // the local coordinates of the listener. - MT_Matrix3x3 lo = m_listener.GetOrientation(); - - MT_Vector3 local_sound_pos = position * lo; - MT_Vector3 local_sound_vel = velocity * lo; - - m_audiodevice->SetObjectTransform( - id, - local_sound_pos, - local_sound_vel, - pObject->GetOrientation(), // make relative to listener! - lp, - pObject->GetRollOffFactor()); - } - else - { - m_audiodevice->ObjectIs2D(id); - } - - // update the situation - if (pObject->IsModified()) - { - m_audiodevice->SetObjectPitch(id, pObject->GetPitch()); - m_audiodevice->SetObjectGain(id, pObject->GetGain()); - m_audiodevice->SetObjectMinGain(id, pObject->GetMinGain()); - m_audiodevice->SetObjectMaxGain(id, pObject->GetMaxGain()); - m_audiodevice->SetObjectReferenceDistance(id, pObject->GetReferenceDistance()); - m_audiodevice->SetObjectRollOffFactor(id, pObject->GetRollOffFactor()); - m_audiodevice->SetObjectLoop(id, pObject->GetLoopMode()); - m_audiodevice->SetObjectLoopPoints(id, pObject->GetLoopStart(), pObject->GetLoopEnd()); - pObject->SetModified(false); - } - - pObject->AddRunning(); - -#ifdef ONTKEVER - STR_String naam = pObject->GetObjectName(); - STR_String sample = pObject->GetSampleName(); - - int id = pObject->GetId(); - int buffer = pObject->GetBuffer(); - - float gain = pObject->GetGain(); - float pitch = pObject->GetPitch(); - float timestamp = pObject->GetTimestamp(); - - printf("naam: %s, sample: %s \n", naam.Ptr(), sample.Ptr()); - printf("id: %d, buffer: %d \n", id, buffer); - printf("gain: %f, pitch: %f, ts: %f \n\n", gain, pitch, timestamp); -#endif -#ifdef USE_OPENAL - // ok, properties Set. now see if it must play - switch (pObject->GetPlaystate()){ - case SND_MUST_PLAY: - m_audiodevice->PlayObject(id); - pObject->SetPlaystate(SND_PLAYING); - break; - case SND_MUST_STOP: - RemoveActiveObject(pObject); - break; - case SND_MUST_PAUSE: - m_audiodevice->PauseObject(id); - pObject->SetPlaystate(SND_PAUSED); - break; - } -#endif - - // check to see if the sound is still playing - // if not: release its id - int playstate = m_audiodevice->GetPlayState(id); -#ifdef ONTKEVER - if (playstate != 2) - printf("%d - ",playstate); -#endif - - if ((playstate == SND_STOPPED) && !pObject->GetLoopMode()) - { - RemoveActiveObject(pObject); - } - } - } -} - - - -void SND_Scene::UpdateCD() -{ - if (m_audiodevice) - { - SND_CDObject* pCD = SND_CDObject::Instance(); - - if (pCD) - { - int playstate = pCD->GetPlaystate(); - - switch (playstate) - { - case SND_MUST_PLAY: - { - // initialize the cd only when you need it - m_audiodevice->SetCDGain(pCD->GetGain()); - m_audiodevice->SetCDPlaymode(pCD->GetPlaymode()); - m_audiodevice->PlayCD(pCD->GetTrack()); - pCD->SetPlaystate(SND_PLAYING); - pCD->SetUsed(); - break; - } - case SND_MUST_PAUSE: - { - m_audiodevice->PauseCD(true); - pCD->SetPlaystate(SND_PAUSED); - break; - } - case SND_MUST_RESUME: - { - m_audiodevice->PauseCD(false); - pCD->SetPlaystate(SND_PLAYING); - break; - } - case SND_MUST_STOP: - { - m_audiodevice->StopCD(); - pCD->SetPlaystate(SND_STOPPED); - break; - } - default: - { - } - } - - // this one is only for realtime modifying settings - if (pCD->IsModified()) - { - m_audiodevice->SetCDGain(pCD->GetGain()); - pCD->SetModified(false); - } - } - } -} - - - -void SND_Scene::Proceed() -{ - if (m_audio && m_audioplayback) - { - m_audiodevice->MakeCurrent(); - - UpdateListener(); - UpdateActiveObects(); - UpdateCD(); - -// m_audiodevice->UpdateDevice(); - } -} - - -void SND_Scene::DeleteObject(SND_SoundObject* pObject) -{ -#ifdef ONTKEVER - printf("SND_Scene::DeleteObject\n"); -#endif - - if (pObject) - { - if (m_audiodevice) - m_audiodevice->ClearId(pObject); - - // must remove object from m_activeList - std::set::iterator set_it; - set_it = m_soundobjects.find(pObject); - - if (set_it != m_soundobjects.end()) - m_soundobjects.erase(set_it); - - // release the memory - delete pObject; - pObject = NULL; - } -} - - - -void SND_Scene::RemoveAllObjects() -{ -#ifdef ONTKEVER - printf("SND_Scene::RemoveAllObjects\n"); -#endif - - StopAllObjects(); - - std::set::iterator it = m_soundobjects.begin(); - - while (it != m_soundobjects.end()) - { - delete (*it); - it++; - } - - m_soundobjects.clear(); -} - - - -void SND_Scene::StopAllObjects() -{ - if (m_audio) - { -#ifdef ONTKEVER - printf("SND_Scene::StopAllObjects\n"); -#endif - - SND_SoundObject* pObject; - - for (pObject = (SND_SoundObject*)m_activeobjects.getHead(); - !pObject->isTail(); - pObject = (SND_SoundObject*)pObject->getNext()) - { - m_audiodevice->ClearId(pObject); - } - } -} - - - -SND_SoundListener* SND_Scene::GetListener() -{ - return &m_listener; -} diff --git a/intern/SoundSystem/intern/SND_SoundListener.cpp b/intern/SoundSystem/intern/SND_SoundListener.cpp deleted file mode 100644 index 26163e87765..00000000000 --- a/intern/SoundSystem/intern/SND_SoundListener.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - * SND_SoundListener.cpp - * - * A SoundListener is for sound what a camera is for vision. - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 "SND_SoundListener.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -SND_SoundListener::SND_SoundListener() -{ - m_modified = true; - m_gain = 1.0; - m_dopplerfactor = 1.0; - m_dopplervelocity = 1.0; - m_scale = 1.0; - m_position[0] = 0.0; - m_position[1] = 0.0; - m_position[2] = 0.0; - m_velocity[0] = 0.0; - m_velocity[1] = 0.0; - m_velocity[2] = 0.0; - m_orientation[0][0] = 1.0; - m_orientation[0][1] = 0.0; - m_orientation[0][2] = 0.0; - m_orientation[1][0] = 0.0; - m_orientation[1][1] = 1.0; - m_orientation[1][2] = 0.0; - m_orientation[2][0] = 0.0; - m_orientation[2][1] = 0.0; - m_orientation[2][2] = 1.0; -} - - -SND_SoundListener::~SND_SoundListener() -{ - ; /* intentionally empty */ - -} - - - -void SND_SoundListener::SetGain(MT_Scalar gain) -{ - m_gain = gain; - m_modified = true; -} - - - -void SND_SoundListener::SetPosition (const MT_Vector3& pos) -{ - m_position = pos; -} - - - -void SND_SoundListener::SetVelocity(const MT_Vector3& vel) -{ - m_velocity = vel; -} - - - -void SND_SoundListener::SetOrientation(const MT_Matrix3x3& ori) -{ - m_orientation = ori; -} - - - -void SND_SoundListener::SetDopplerFactor(MT_Scalar dopplerfactor) -{ - m_dopplerfactor = dopplerfactor; - m_modified = true; -} - - - -void SND_SoundListener::SetDopplerVelocity(MT_Scalar dopplervelocity) -{ - m_dopplervelocity = dopplervelocity; - m_modified = true; -} - - - -void SND_SoundListener::SetScale(MT_Scalar scale) -{ - m_scale = scale; - m_modified = true; -} - - - -MT_Scalar SND_SoundListener::GetGain() const -{ - return m_gain; -} - - - -MT_Vector3 SND_SoundListener::GetPosition() const -{ - return m_position; -} - - - -MT_Vector3 SND_SoundListener::GetVelocity() const -{ - return m_velocity; -} - - - -MT_Matrix3x3 SND_SoundListener::GetOrientation() -{ - return m_orientation; -} - - - -MT_Scalar SND_SoundListener::GetDopplerFactor() const -{ - return m_dopplerfactor; -} - - - -MT_Scalar SND_SoundListener::GetDopplerVelocity() const -{ - return m_dopplervelocity; -} - - - -MT_Scalar SND_SoundListener::GetScale() const -{ - return m_scale; -} - - - -bool SND_SoundListener::IsModified() const -{ - return m_modified; -} - - - -void SND_SoundListener::SetModified(bool modified) -{ - m_modified = modified; -} diff --git a/intern/SoundSystem/intern/SND_SoundObject.cpp b/intern/SoundSystem/intern/SND_SoundObject.cpp deleted file mode 100644 index 7a244b5090d..00000000000 --- a/intern/SoundSystem/intern/SND_SoundObject.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/* - * SND_SoundObject.cpp - * - * Implementation of the abstract sound object - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 "SND_SoundObject.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -SND_SoundObject::SND_SoundObject()// : m_modified(true) -{ - m_samplename = ""; - m_length = 0; - m_buffer = 0; - - m_gain = 0.0; - m_pitch = 1.0; - - m_mingain = 0.0; - m_maxgain = 1.0; - m_rollofffactor = 1.0; - m_referencedistance = 1.0; - - m_position[0] = 0.0; - m_position[1] = 0.0; - m_position[2] = 0.0; - m_velocity[0] = 0.0; - m_velocity[1] = 0.0; - m_velocity[2] = 0.0; - m_orientation[0][0] = 1.0; - m_orientation[0][1] = 0.0; - m_orientation[0][2] = 0.0; - m_orientation[1][0] = 0.0; - m_orientation[1][1] = 1.0; - m_orientation[1][2] = 0.0; - m_orientation[2][0] = 0.0; - m_orientation[2][1] = 0.0; - m_orientation[2][2] = 1.0; - - m_loopstart = 0; - m_loopend = 0; - m_loopmode = SND_LOOP_NORMAL; - m_is3d = true; - m_playstate = SND_INITIAL; - m_active = false; - m_id = -1; - m_lifespan = 0; - m_timestamp = 0; - m_modified = true; - m_running = 0; - m_highpriority = false; -} - - - -SND_SoundObject::~SND_SoundObject() -{ -} - - - -void SND_SoundObject::StartSound() -{ - if (m_id >= 0) - m_playstate = SND_MUST_PLAY; -} - - - -void SND_SoundObject::StopSound() -{ - if (m_id >= 0) - m_playstate = SND_MUST_STOP; -} - - - -void SND_SoundObject::PauseSound() -{ - if (m_id >= 0) - m_playstate = SND_MUST_PAUSE; -} - - - -void SND_SoundObject::DeleteWhenFinished() -{ - m_playstate = SND_MUST_BE_DELETED; -} - - - -void SND_SoundObject::SetGain(MT_Scalar gain) -{ - m_gain = gain; - m_modified = true; -} - - - -void SND_SoundObject::SetMinGain(MT_Scalar mingain) -{ - m_mingain = mingain; - m_modified = true; -} - - - -void SND_SoundObject::SetMaxGain(MT_Scalar maxgain) -{ - m_maxgain = maxgain; - m_modified = true; -} - - - -void SND_SoundObject::SetRollOffFactor(MT_Scalar rollofffactor) -{ - m_rollofffactor = rollofffactor; - m_modified = true; -} - - - -void SND_SoundObject::SetReferenceDistance(MT_Scalar referencedistance) -{ - m_referencedistance = referencedistance; - m_modified = true; -} - - - -void SND_SoundObject::SetPitch(MT_Scalar pitch) -{ - m_pitch = pitch; - m_modified = true; -} - - - -void SND_SoundObject::SetLoopMode(unsigned int loopmode) -{ - m_loopmode = loopmode; - m_modified = true; -} - - - -void SND_SoundObject::SetLoopStart(unsigned int loopstart) -{ - m_loopstart = loopstart; - m_modified = true; -} - - - -void SND_SoundObject::SetLoopEnd(unsigned int loopend) -{ - m_loopend = loopend; - m_modified = true; -} - - - -void SND_SoundObject::Set3D(bool threedee) -{ - m_is3d = threedee; -} - - - -void SND_SoundObject::SetLifeSpan() -{ - m_lifespan = m_length / m_pitch; -} - - - -bool SND_SoundObject::IsLifeSpanOver(MT_Scalar curtime) const -{ - bool result = false; - - if ((curtime - m_timestamp) > m_lifespan) - result = true; - - return result; -} - - - -void SND_SoundObject::SetActive(bool active) -{ - m_active = active; - - if (!active) - { - m_playstate = SND_STOPPED; - (this)->remove(); - } -} - - - -void SND_SoundObject::SetBuffer(unsigned int buffer) -{ - m_buffer = buffer; -} - - - -void SND_SoundObject::SetObjectName(STR_String objectname) -{ - m_objectname = objectname; -} - - - -void SND_SoundObject::SetSampleName(STR_String samplename) -{ - m_samplename = samplename; -} - - - -void SND_SoundObject::SetLength(MT_Scalar length) -{ - m_length = length; -} - - - -void SND_SoundObject::SetPosition(const MT_Vector3& pos) -{ - m_position = pos; -} - - - -void SND_SoundObject::SetVelocity(const MT_Vector3& vel) -{ - m_velocity = vel; -} - - - -void SND_SoundObject::SetOrientation(const MT_Matrix3x3& orient) -{ - m_orientation = orient; -} - - - -void SND_SoundObject::SetPlaystate(int playstate) -{ - m_playstate = playstate; -} - - - -void SND_SoundObject::SetId(int id) -{ - m_id = id; -} - - - -void SND_SoundObject::SetTimeStamp(MT_Scalar timestamp) -{ - m_timestamp = timestamp; -} - - - -void SND_SoundObject::SetHighPriority(bool priority) -{ - m_highpriority = priority; -} - - - -bool SND_SoundObject::IsHighPriority() const -{ - return m_highpriority; -} - - - -bool SND_SoundObject::IsActive()const -{ - return m_active; -} - - - -int SND_SoundObject::GetId()const -{ - return m_id; -} - - - -MT_Scalar SND_SoundObject::GetLifeSpan()const -{ - return m_lifespan; -} - - - -MT_Scalar SND_SoundObject::GetTimestamp()const -{ - return m_timestamp; -} - - - -unsigned int SND_SoundObject::GetBuffer() -{ - return m_buffer; -} - - - -const STR_String& SND_SoundObject::GetSampleName() -{ - return m_samplename; -} - - - -const STR_String& SND_SoundObject::GetObjectName() -{ - return m_objectname; -} - - - -MT_Scalar SND_SoundObject::GetLength() const -{ - return m_length; -} - - - -MT_Scalar SND_SoundObject::GetGain() const -{ - return m_gain; -} - - - -MT_Scalar SND_SoundObject::GetPitch() const -{ - return m_pitch; -} - - - -MT_Scalar SND_SoundObject::GetMinGain() const -{ - return m_mingain; -} - - - -MT_Scalar SND_SoundObject::GetMaxGain() const -{ - return m_maxgain; -} - - - -MT_Scalar SND_SoundObject::GetRollOffFactor() const -{ - return m_rollofffactor; -} - - - -MT_Scalar SND_SoundObject::GetReferenceDistance() const -{ - return m_referencedistance; -} - - - -MT_Vector3 SND_SoundObject::GetPosition() const -{ - return m_position; -} - - - -MT_Vector3 SND_SoundObject::GetVelocity() const -{ - return m_velocity; -} - - - -MT_Matrix3x3 SND_SoundObject::GetOrientation() const -{ - return m_orientation; -} - - - -unsigned int SND_SoundObject::GetLoopMode() const -{ - return m_loopmode; -} - - - -unsigned int SND_SoundObject::GetLoopStart() const -{ - return m_loopstart; -} - - - -unsigned int SND_SoundObject::GetLoopEnd() const -{ - return m_loopend; -} - - - -bool SND_SoundObject::Is3D() const -{ - return m_is3d; -} - - - -int SND_SoundObject::GetPlaystate() const -{ - return m_playstate; -} - - - -bool SND_SoundObject::IsModified() const -{ - return m_modified; -} - - - -void SND_SoundObject::SetModified(bool modified) -{ - m_modified = modified; -} - - - -void SND_SoundObject::InitRunning() -{ - m_running = 0; -} - - - -bool SND_SoundObject::IsRunning() const -{ - bool result = false; - - if (m_running > 100) - result = true; - - return result; -} - - - -void SND_SoundObject::AddRunning() -{ - ++m_running; -} diff --git a/intern/SoundSystem/intern/SND_Utils.cpp b/intern/SoundSystem/intern/SND_Utils.cpp deleted file mode 100644 index dbc3135b35c..00000000000 --- a/intern/SoundSystem/intern/SND_Utils.cpp +++ /dev/null @@ -1,424 +0,0 @@ -/* - * SND_Utils.cpp - * - * Util functions for soundthingies - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 "SND_Utils.h" -#include "SoundDefines.h" -#include "SND_DependKludge.h" -#include -#include -#include -#include -#include - -#if defined(_WIN32) -#include -#define open _open -#define read _read -#define close _close -#define write _write -#define lseek _lseek -#else -#include -#endif - -#define BUFFERSIZE 32 - - -/***************************************************************************** - * Begin of temporary Endian stuff. - * I think there should be a central place to handle endian conversion but for - * the time being it suffices. Note that the defines come from the Blender - * source. - *****************************************************************************/ -typedef enum -{ - SND_endianBig = 0, - SND_endianLittle -} SND_TEndian; - -#if defined(__BIG_ENDIAN__) || defined(__sparc) || defined(__sparc__) -const SND_TEndian SND_fEndian = SND_endianBig; -#else -const SND_TEndian SND_fEndian = SND_endianLittle; -#endif - -/* This one swaps the bytes in a short */ -#define SWITCH_SHORT(a) { \ - char s_i, *p_i; \ - p_i= (char *)&(a); \ - s_i=p_i[0]; \ - p_i[0] = p_i[1]; \ - p_i[1] = s_i; } - -/* This one rotates the bytes in an int */ -#define SWITCH_INT(a) { \ - char s_i, *p_i; \ - p_i= (char *)&(a); \ - s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \ - s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; } -/***************************************************************************** - * End of temporary Endian stuff. - *****************************************************************************/ - - -/* loads a file */ -void* SND_LoadSample(char *filename) -{ - int file, filelen, buffersize = BUFFERSIZE; - void* data = NULL; - -#if defined(WIN32) - file = open(filename, O_BINARY|O_RDONLY); -#else - file = open(filename, 0|O_RDONLY); -#endif - - if (file == -1) - { - //printf("can't open file.\n"); - //printf("press q for quit.\n"); - } - else - { - filelen = lseek(file, 0, SEEK_END); - lseek(file, 0, SEEK_SET); - - if (filelen != 0) - { - data = malloc(buffersize); - - if (read(file, data, buffersize) != buffersize) - { - free(data); - data = NULL; - } - } - close(file); - - } - return (data); -} - - - -bool SND_IsSampleValid(const STR_String& name, void* memlocation) -{ - bool result = false; - bool loadedsample = false; - char buffer[BUFFERSIZE]; - - if (!memlocation) - { - STR_String samplename = name; - memlocation = SND_LoadSample(samplename.Ptr()); - - if (memlocation) - loadedsample = true; - } - - if (memlocation) - { - memcpy(&buffer, memlocation, BUFFERSIZE); - - if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8))) - { - /* This was endian unsafe. See top of the file for the define. */ - short shortbuf = *((short *) &buffer[20]); - if (SND_fEndian == SND_endianBig) SWITCH_SHORT(shortbuf); - - if (shortbuf == SND_WAVE_FORMAT_PCM) - result = true; - } - } - if (loadedsample) - { - free(memlocation); - memlocation = NULL; - } - - return result; -} - - - -/* checks if the passed pointer is a valid sample */ -static bool CheckSample(void* sample) -{ - bool valid = false; - char buffer[32]; - - memcpy(buffer, sample, 16); - - if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8))) - { - valid = true; - } - - return valid; -} - - - -/* gets the type of the sample (0 == unknown, 1 == PCM etc */ -unsigned int SND_GetSampleFormat(void* sample) -{ - short sampletype = 0; - - if (CheckSample(sample)) - { - memcpy(&sampletype, ((char*)sample) + 20, 2); - } - /* This was endian unsafe. See top of the file for the define. */ - if (SND_fEndian == SND_endianBig) SWITCH_SHORT(sampletype); - - return (unsigned int)sampletype; -} - - - -/* gets the number of channels in a sample */ -unsigned int SND_GetNumberOfChannels(void* sample) -{ - short numberofchannels = 0; - - if (CheckSample(sample)) - { - memcpy(&numberofchannels, ((char*)sample) + 22, 2); - } - /* This was endian unsafe. See top of the file for the define. */ - if (SND_fEndian == SND_endianBig) SWITCH_SHORT(numberofchannels); - - return (unsigned int)numberofchannels; -} - - - -/* gets the samplerate of a sample */ -unsigned int SND_GetSampleRate(void* sample) -{ - unsigned int samplerate = 0; - - if (CheckSample(sample)) - { - memcpy(&samplerate, ((char*)sample) + 24, 4); - } - /* This was endian unsafe. See top of the file for the define. */ - if (SND_fEndian == SND_endianBig) SWITCH_INT(samplerate); - - return samplerate; -} - - - -/* gets the bitrate of a sample */ -unsigned int SND_GetBitRate(void* sample) -{ - short bitrate = 0; - - if (CheckSample(sample)) - { - memcpy(&bitrate, ((char*)sample) + 34, 2); - } - /* This was endian unsafe. See top of the file for the define. */ - if (SND_fEndian == SND_endianBig) SWITCH_SHORT(bitrate); - - return (unsigned int)bitrate; -} - - - -/* gets the length of the actual sample data (without the header) */ -unsigned int SND_GetNumberOfSamples(void* sample, unsigned int sample_length) -{ - unsigned int chunklength, length = 0, offset; - unsigned short block_align; - if (CheckSample(sample)) - { - memcpy(&chunklength, ((char*)sample) + 16, 4); - memcpy(&block_align, ((char*)sample) + 32, 2); /* always 2 or 4 it seems */ - - /* This was endian unsafe. See top of the file for the define. */ - if (SND_fEndian == SND_endianBig) - { - SWITCH_INT(chunklength); - SWITCH_SHORT(block_align); - } - - offset = 16 + chunklength + 4; - - /* This seems very unsafe, what if data is never found (f.i. corrupt file)... */ - // lets find "data" - while (memcmp(((char*)sample) + offset, "data", 4)) - { - offset += block_align; - - if (offset+block_align > sample_length) /* save us from crashing */ - return 0; - } - offset += 4; - memcpy(&length, ((char*)sample) + offset, 4); - - /* This was endian unsafe. See top of the file for the define. */ - if (SND_fEndian == SND_endianBig) SWITCH_INT(length); - } - - return length; -} - - - -/* gets the size of the entire header (file - sampledata) */ -unsigned int SND_GetHeaderSize(void* sample, unsigned int sample_length) -{ - unsigned int chunklength, headersize = 0, offset = 16; - unsigned short block_align; - if (CheckSample(sample)) - { - memcpy(&chunklength, ((char*)sample) + offset, 4); - memcpy(&block_align, ((char*)sample) + 32, 2); /* always 2 or 4 it seems */ - - /* This was endian unsafe. See top of the file for the define. */ - if (SND_fEndian == SND_endianBig) - { - SWITCH_INT(chunklength); - SWITCH_SHORT(block_align); - } - offset = offset + chunklength + 4; - - // lets find "data" - while (memcmp(((char*)sample) + offset, "data", 4)) - { - offset += block_align; - - if (offset+block_align > sample_length) /* save us from crashing */ - return 0; - } - headersize = offset + 8; - } - - return headersize; -} - - -unsigned int SND_GetExtraChunk(void* sample) -{ - unsigned int extrachunk = 0, chunklength, offset = 16; - char data[4]; - - if (CheckSample(sample)) - { - memcpy(&chunklength, ((char*)sample) + offset, 4); - offset = offset + chunklength + 4; - memcpy(data, ((char*)sample) + offset, 4); - - // lets find "cue" - while (memcmp(data, "cue", 3)) - { - offset += 4; - memcpy(data, ((char*)sample) + offset, 4); - } - } - - return extrachunk; -} - - - -void SND_GetSampleInfo(signed char* sample, SND_WaveSlot* waveslot) -{ - WavFileHeader fileheader; - WavFmtHeader fmtheader; - WavFmtExHeader fmtexheader; - WavSampleHeader sampleheader; - WavChunkHeader chunkheader; - - if (CheckSample(sample)) - { - memcpy(&fileheader, sample, sizeof(WavFileHeader)); - fileheader.size = SND_GetHeaderSize(sample, waveslot->GetFileSize()); - if (fileheader.size) { /* this may fail for corrupt files */ - sample += sizeof(WavFileHeader); - fileheader.size = ((fileheader.size+1) & ~1) - 4; - - while ((fileheader.size > 0) && (memcpy(&chunkheader, sample, sizeof(WavChunkHeader)))) - { - sample += sizeof(WavChunkHeader); - if (!memcmp(chunkheader.id, "fmt ", 4)) - { - memcpy(&fmtheader, sample, sizeof(WavFmtHeader)); - waveslot->SetSampleFormat(fmtheader.format); - - if (fmtheader.format == 0x0001) - { - waveslot->SetNumberOfChannels(fmtheader.numberofchannels); - waveslot->SetBitRate(fmtheader.bitrate); - waveslot->SetSampleRate(fmtheader.samplerate); - sample += chunkheader.size; - } - else - { - memcpy(&fmtexheader, sample, sizeof(WavFmtExHeader)); - sample += chunkheader.size; - } - } - else if (!memcmp(chunkheader.id, "data", 4)) - { - if (fmtheader.format == 0x0001) - { - waveslot->SetNumberOfSamples(chunkheader.size); - sample += chunkheader.size; - } - else if (fmtheader.format == 0x0011) - { - //IMA ADPCM - } - else if (fmtheader.format == 0x0055) - { - //MP3 WAVE - } - } - else if (!memcmp(chunkheader.id, "smpl", 4)) - { - memcpy(&sampleheader, sample, sizeof(WavSampleHeader)); - //loop = sampleheader.loops; - sample += chunkheader.size; - } - else - sample += chunkheader.size; - - sample += chunkheader.size & 1; - fileheader.size -= (((chunkheader.size + 1) & ~1) + 8); - } - } - } -} diff --git a/intern/SoundSystem/intern/SND_WaveCache.cpp b/intern/SoundSystem/intern/SND_WaveCache.cpp deleted file mode 100644 index a678bd554bb..00000000000 --- a/intern/SoundSystem/intern/SND_WaveCache.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * SND_WaveCache.cpp - * - * abstract wavecache, a way to organize samples - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 -#endif - -#ifdef WIN32 -#pragma warning (disable:4786) // Get rid of stupid stl-visual compiler debug warning -#endif //WIN32 - -#include "SND_WaveCache.h" -#include - -#ifdef __APPLE__ -# include -#else -# ifdef __FreeBSD__ -# include -# else -# include -# endif -#endif - -SND_WaveCache::SND_WaveCache() -{ - // do the buffer administration - for (int i = 0; i < NUM_BUFFERS; i++) - m_bufferList[i] = NULL; -} - - - -SND_WaveCache::~SND_WaveCache() -{ - // clean up the mess - FreeSamples(); - RemoveAllSamples(); -} - - - -SND_WaveSlot* SND_WaveCache::GetWaveSlot(const STR_String& samplename) -{ - SND_WaveSlot* waveslot = NULL; - - std::map::iterator find_result = m_samplecache.find(samplename); - - // let's see if we have already loaded this sample - if (find_result != m_samplecache.end()) - { - waveslot = (*find_result).second; - } - else - { - // so the sample wasn't loaded, so do it here - for (int bufnum = 0; bufnum < NUM_BUFFERS; bufnum++) - { - // find an empty buffer - if (m_bufferList[bufnum] == NULL) - { - waveslot = new SND_WaveSlot(); - waveslot->SetSampleName(samplename); - waveslot->SetBuffer(bufnum); - m_bufferList[bufnum] = waveslot; - break; - } - } - m_samplecache.insert(std::pair(samplename, waveslot)); - } - - return waveslot; -} - - - -void SND_WaveCache::RemoveAllSamples() -{ - // remove all samples - m_samplecache.clear(); - - // reset the list of buffers - for (int i = 0; i < NUM_BUFFERS; i++) - m_bufferList[i] = NULL; -} - - - -void SND_WaveCache::RemoveSample(const STR_String& samplename, int buffer) -{ - m_samplecache.erase(samplename); - m_bufferList[buffer] = NULL; -} - - - -void SND_WaveCache::FreeSamples() -{ - // iterate through the bufferlist and delete the waveslot if present - for (int i = 0; i < NUM_BUFFERS; i++) - { - if (m_bufferList[i]) - { - delete m_bufferList[i]; - m_bufferList[i] = NULL; - } - } -} diff --git a/intern/SoundSystem/intern/SND_WaveSlot.cpp b/intern/SoundSystem/intern/SND_WaveSlot.cpp deleted file mode 100644 index 43b2bb55892..00000000000 --- a/intern/SoundSystem/intern/SND_WaveSlot.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/** - * $Id$ - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 "SND_WaveSlot.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -SND_WaveSlot::~SND_WaveSlot() -{ -#ifdef ONTKEVER - printf("neeeeeee...\n"); -#endif -} - - - -void SND_WaveSlot::SetSampleName(STR_String samplename) -{ - m_samplename = samplename; -} - - - -void SND_WaveSlot::SetLoaded(bool loaded) -{ - m_loaded = loaded; -} - - - -void SND_WaveSlot::SetData(void* data) -{ - m_data = data; -} - - - -void SND_WaveSlot::SetBuffer(unsigned int buffer) -{ - m_buffer = buffer; -} - - - -void SND_WaveSlot::SetSampleFormat(unsigned int sampleformat) -{ - m_sampleformat = sampleformat; -} - - - -void SND_WaveSlot::SetNumberOfChannels(unsigned int numberofchannels) -{ - m_numberofchannels = numberofchannels; -} - - - -void SND_WaveSlot::SetSampleRate(unsigned int samplerate) -{ - m_samplerate = samplerate; -} - - - -void SND_WaveSlot::SetBitRate(unsigned int bitrate) -{ - m_bitrate = bitrate; -} - - - -void SND_WaveSlot::SetNumberOfSamples(unsigned int numberofsamples) -{ - m_numberofsamples = numberofsamples; -} - - - -void SND_WaveSlot::SetFileSize(unsigned int filesize) -{ - m_filesize = filesize; -} - - - -const STR_String& SND_WaveSlot::GetSampleName() -{ - return m_samplename; -} - - - -bool SND_WaveSlot::IsLoaded() const -{ - return m_loaded; -} - - - -void* SND_WaveSlot::GetData() -{ - return m_data; -} - - - -unsigned int SND_WaveSlot::GetBuffer() const -{ - return m_buffer; -} - - - -unsigned int SND_WaveSlot::GetSampleFormat() const -{ - return m_sampleformat; -} - - - -unsigned int SND_WaveSlot::GetNumberOfChannels() const -{ - return m_numberofchannels; -} - - - -unsigned int SND_WaveSlot::GetSampleRate() const -{ - return m_samplerate; -} - - - -unsigned int SND_WaveSlot::GetBitRate() const -{ - return m_bitrate; -} - - - -unsigned int SND_WaveSlot::GetNumberOfSamples() const -{ - return m_numberofsamples; -} - - - -unsigned int SND_WaveSlot::GetFileSize() const -{ - return m_filesize; -} diff --git a/intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp b/intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp deleted file mode 100644 index 1bd973dfb6c..00000000000 --- a/intern/SoundSystem/make/msvc_6_0/SoundSystem.dsp +++ /dev/null @@ -1,206 +0,0 @@ -# Microsoft Developer Studio Project File - Name="SoundSystem" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=SoundSystem - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "SoundSystem.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SoundSystem.mak" CFG="SoundSystem - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "SoundSystem - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "SoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "SoundSystem - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\..\obj\windows\intern\soundsystem" -# PROP Intermediate_Dir "..\..\..\..\obj\windows\intern\soundsystem" -# PROP Target_Dir "" -LINK32=link.exe -lib -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/moto/include" /I "../../dummy" /I "../../openal" /I "..\..\..\string" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\..\obj\windows\intern\soundsystem\libSoundSystem.lib" -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Cmds=ECHO Copying header files XCOPY /Y ..\..\*.h ..\..\..\..\..\lib\windows\SoundSystem\include\*.h ECHO Copying lib XCOPY /Y ..\..\..\..\obj\windows\intern\soundsystem\*.lib ..\..\..\..\..\lib\windows\SoundSystem\lib\*.a ECHO Done -# End Special Build Tool - -!ELSEIF "$(CFG)" == "SoundSystem - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SoundSystem___Win32_Debug" -# PROP BASE Intermediate_Dir "SoundSystem___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\..\obj\windows\intern\soundsystem\debug" -# PROP Intermediate_Dir "..\..\..\..\obj\windows\intern\soundsystem\debug" -# PROP Target_Dir "" -LINK32=link.exe -lib -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../" /I "../../../../../lib/windows/string/include" /I "../../../../../lib/windows/moto/include" /I "../../dummy" /I "../../openal" /I "..\..\..\string" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\..\obj\windows\intern\soundsystem\debug\libSoundSystem.lib" -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Cmds=ECHO Copying header files XCOPY /Y ..\..\*.h ..\..\..\..\..\lib\windows\SoundSystem\include\*.h ECHO Copying lib XCOPY /Y ..\..\..\..\obj\windows\intern\soundsystem\debug\*.lib ..\..\..\..\..\lib\windows\SoundSystem\lib\debug\*.a ECHO Done -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "SoundSystem - Win32 Release" -# Name "SoundSystem - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\intern\SND_AudioDevice.cpp -# End Source File -# Begin Source File - -SOURCE="..\..\intern\SND_C-api.cpp" -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_CDObject.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_DeviceManager.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_IdObject.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_Scene.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_SoundListener.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_SoundObject.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_Utils.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_WaveCache.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_WaveSlot.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\intern\SND_AudioDevice.h -# End Source File -# Begin Source File - -SOURCE="..\..\SND_C-api.h" -# End Source File -# Begin Source File - -SOURCE=..\..\SND_CDObject.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_DependKludge.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_DeviceManager.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_IAudioDevice.h -# End Source File -# Begin Source File - -SOURCE=..\..\intern\SND_IdObject.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_Object.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_Scene.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_SoundListener.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_SoundObject.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_Utils.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_WaveCache.h -# End Source File -# Begin Source File - -SOURCE=..\..\SND_WaveSlot.h -# End Source File -# Begin Source File - -SOURCE=..\..\SoundDefines.h -# End Source File -# End Group -# End Target -# End Project diff --git a/intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp b/intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp deleted file mode 100644 index 2bf372d0382..00000000000 --- a/intern/SoundSystem/make/msvc_6_0/dummy/DummySoundSystem.dsp +++ /dev/null @@ -1,103 +0,0 @@ -# Microsoft Developer Studio Project File - Name="DummySoundSystem" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=DummySoundSystem - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "DummySoundSystem.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "DummySoundSystem.mak" CFG="DummySoundSystem - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "DummySoundSystem - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "DummySoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "DummySoundSystem - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy" -# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy" -# PROP Target_Dir "" -LINK32=link.exe -lib -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /J /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\dummy\libDummySoundSystem.lib" - -!ELSEIF "$(CFG)" == "DummySoundSystem - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug" -# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug" -# PROP Target_Dir "" -LINK32=link.exe -lib -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /J /FD /c -# SUBTRACT CPP /Fr -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\dummy\debug\libDummySoundSystem.lib" - -!ENDIF - -# Begin Target - -# Name "DummySoundSystem - Win32 Release" -# Name "DummySoundSystem - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\dummy\SND_DummyDevice.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\dummy\SND_DummyDevice.h -# End Source File -# End Group -# End Target -# End Project diff --git a/intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp b/intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp deleted file mode 100644 index ef0c10e8eff..00000000000 --- a/intern/SoundSystem/make/msvc_6_0/openal/OpenALSoundSystem.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="OpenALSoundSystem" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=OpenALSoundSystem - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "OpenALSoundSystem.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "OpenALSoundSystem.mak" CFG="OpenALSoundSystem - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "OpenALSoundSystem - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "OpenALSoundSystem - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "OpenALSoundSystem - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal" -# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal" -# PROP Target_Dir "" -LINK32=link.exe -lib -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\SoundSystem\sdl" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /I "..\..\..\..\..\..\lib\windows\openal\include" /I "..\..\..\..\..\..\lib\windows\sdl\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\openal\libOpenALSoundSystem.lib" - -!ELSEIF "$(CFG)" == "OpenALSoundSystem - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "OpenALSoundSystem___Win32_Debug" -# PROP BASE Intermediate_Dir "OpenALSoundSystem___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug" -# PROP Intermediate_Dir "..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug" -# PROP Target_Dir "" -LINK32=link.exe -lib -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\intern" /I "..\..\..\..\SoundSystem" /I "..\..\..\..\SoundSystem\sdl" /I "..\..\..\..\moto\include" /I "..\..\..\..\string" /I "..\..\..\..\..\..\lib\windows\sdl\include" /I "..\..\..\..\..\..\lib\windows\openal\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /J /FD /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\..\..\obj\windows\intern\soundsystem\openal\debug\libOpenALSoundSystem.lib" - -!ENDIF - -# Begin Target - -# Name "OpenALSoundSystem - Win32 Release" -# Name "OpenALSoundSystem - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\openal\SND_OpenALDevice.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\sdl\SND_SDLCDDevice.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\..\openal\SND_OpenALDevice.h -# End Source File -# End Group -# End Target -# End Project diff --git a/intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj b/intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj deleted file mode 100644 index f0952c582b7..00000000000 --- a/intern/SoundSystem/make/msvc_7_0/SoundSystem.vcproj +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj b/intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj deleted file mode 100644 index 103b589e732..00000000000 --- a/intern/SoundSystem/make/msvc_7_0/dummy/DummySoundSystem.vcproj +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj b/intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj deleted file mode 100644 index 8ce971ac1aa..00000000000 --- a/intern/SoundSystem/make/msvc_7_0/openal/OpenALSoundSystem.vcproj +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj b/intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj deleted file mode 100644 index bd75fe88d43..00000000000 --- a/intern/SoundSystem/make/msvc_9_0/SoundSystem.vcproj +++ /dev/null @@ -1,447 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/intern/SoundSystem/make/msvc_9_0/dummy/DummySoundSystem.vcproj b/intern/SoundSystem/make/msvc_9_0/dummy/DummySoundSystem.vcproj deleted file mode 100644 index 2109d92d430..00000000000 --- a/intern/SoundSystem/make/msvc_9_0/dummy/DummySoundSystem.vcproj +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/intern/SoundSystem/make/msvc_9_0/openal/OpenALSoundSystem.vcproj b/intern/SoundSystem/make/msvc_9_0/openal/OpenALSoundSystem.vcproj deleted file mode 100644 index 5593f00cb2b..00000000000 --- a/intern/SoundSystem/make/msvc_9_0/openal/OpenALSoundSystem.vcproj +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/intern/SoundSystem/openal/Makefile b/intern/SoundSystem/openal/Makefile deleted file mode 100644 index b28ab628d4c..00000000000 --- a/intern/SoundSystem/openal/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 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 ***** -# -# - -LIBNAME = OpenALSoundSystem -DIR = $(OCGDIR)/intern/$(LIBNAME) - -include nan_compile.mk - -CCFLAGS += $(LEVEL_1_CPP_WARNINGS) - -CPPFLAGS += -I$(NAN_OPENAL)/include -CPPFLAGS += -I$(NAN_STRING)/include -CPPFLAGS += -I$(NAN_MOTO)/include -CPPFLAGS += -I../intern -CPPFLAGS += -I.. -CPPFLAGS += -I. -CPPFLAGS += -I../sdl diff --git a/intern/SoundSystem/openal/SND_OpenALDevice.cpp b/intern/SoundSystem/openal/SND_OpenALDevice.cpp deleted file mode 100644 index 480f4ff6d74..00000000000 --- a/intern/SoundSystem/openal/SND_OpenALDevice.cpp +++ /dev/null @@ -1,854 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 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 ***** - * SND_OpenALDevice derived from SND_IAudioDevice - */ - -#ifdef WIN32 -#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning -#endif //WIN32 - -#include "SND_OpenALDevice.h" -#ifndef __APPLE__ -#include "SND_SDLCDDevice.h" -#endif -#include "SoundDefines.h" - -#include "SND_Utils.h" - -#ifdef APPLE_FRAMEWORK_FIX -#include -#include -#else -#include -#include -#endif - -#include -#include -#if defined(WIN32) -#include -#else -#include -#endif -#include - -#include - -/*************************** ALUT replacement *****************************/ - -/* instead of relying on alut, we just implement our own - * WAV loading functions, hopefully more reliable */ - -#include - -typedef struct /* WAV File-header */ -{ - ALubyte Id[4]; - ALsizei Size; - ALubyte Type[4]; -} WAVFileHdr_Struct; - -typedef struct /* WAV Fmt-header */ -{ - ALushort Format; - ALushort Channels; - ALuint SamplesPerSec; - ALuint BytesPerSec; - ALushort BlockAlign; - ALushort BitsPerSample; -} WAVFmtHdr_Struct; - -typedef struct /* WAV FmtEx-header */ -{ - ALushort Size; - ALushort SamplesPerBlock; -} WAVFmtExHdr_Struct; - -typedef struct /* WAV Smpl-header */ -{ - ALuint Manufacturer; - ALuint Product; - ALuint SamplePeriod; - ALuint Note; - ALuint FineTune; - ALuint SMPTEFormat; - ALuint SMPTEOffest; - ALuint Loops; - ALuint SamplerData; - struct - { - ALuint Identifier; - ALuint Type; - ALuint Start; - ALuint End; - ALuint Fraction; - ALuint Count; - } Loop[1]; -} WAVSmplHdr_Struct; - -typedef struct /* WAV Chunk-header */ -{ - ALubyte Id[4]; - ALuint Size; -} WAVChunkHdr_Struct; - -static void *SND_loadFileIntoMemory(const char *filename, int *len_r) -{ - FILE *fp= fopen(filename, "rb"); - void *data; - - if (!fp) { - *len_r= -1; - return NULL; - } - - fseek(fp, 0L, SEEK_END); - *len_r= ftell(fp); - fseek(fp, 0L, SEEK_SET); - - data= malloc(*len_r); - if (!data) { - *len_r= -1; - return NULL; - } - - if (fread(data, *len_r, 1, fp)!=1) { - *len_r= -1; - free(data); - return NULL; - } - - return data; -} - -#define TEST_SWITCH_INT(a) if(big_endian) { \ - char s_i, *p_i; \ - p_i= (char *)&(a); \ - s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \ - s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; } - -#define TEST_SWITCH_SHORT(a) if(big_endian) { \ - char s_i, *p_i; \ - p_i= (char *)&(a); \ - s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; } - -static int stream_read(void *out, ALbyte **stream, ALsizei size, ALsizei *memsize) -{ - if(size <= *memsize) { - memcpy(out, *stream, size); - return 1; - } - else { - memset(out, 0, size); - return 0; - } -} - -static int stream_skip(ALbyte **stream, ALsizei size, ALsizei *memsize) -{ - if(size <= *memsize) { - *stream += size; - *memsize -= size; - return 1; - } - else - return 0; -} - -ALvoid SND_alutLoadWAVMemory(ALbyte *memory,ALsizei memsize,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop) -{ - WAVChunkHdr_Struct ChunkHdr; - WAVFmtExHdr_Struct FmtExHdr; - WAVFileHdr_Struct FileHdr; - WAVSmplHdr_Struct SmplHdr; - WAVFmtHdr_Struct FmtHdr; - ALbyte *Stream= memory; - int test_endian= 1; - int big_endian= !((char*)&test_endian)[0]; - - *format=AL_FORMAT_MONO16; - *data=NULL; - *size=0; - *freq=22050; - *loop=AL_FALSE; - - if(!Stream) - return; - - stream_read(&FileHdr,&Stream,sizeof(WAVFileHdr_Struct),&memsize); - stream_skip(&Stream,sizeof(WAVFileHdr_Struct),&memsize); - - TEST_SWITCH_INT(FileHdr.Size); - FileHdr.Size=((FileHdr.Size+1)&~1)-4; - - while((FileHdr.Size!=0) && stream_read(&ChunkHdr,&Stream,sizeof(WAVChunkHdr_Struct),&memsize)) - { - TEST_SWITCH_INT(ChunkHdr.Size); - stream_skip(&Stream,sizeof(WAVChunkHdr_Struct),&memsize); - - if (!memcmp(ChunkHdr.Id,"fmt ",4)) - { - stream_read(&FmtHdr,&Stream,sizeof(WAVFmtHdr_Struct),&memsize); - - TEST_SWITCH_SHORT(FmtHdr.Format); - TEST_SWITCH_SHORT(FmtHdr.Channels); - TEST_SWITCH_INT(FmtHdr.SamplesPerSec); - TEST_SWITCH_INT(FmtHdr.BytesPerSec); - TEST_SWITCH_SHORT(FmtHdr.BlockAlign); - TEST_SWITCH_SHORT(FmtHdr.BitsPerSample); - - if (FmtHdr.Format==0x0001) - { - *format=(FmtHdr.Channels==1? - (FmtHdr.BitsPerSample==8?AL_FORMAT_MONO8:AL_FORMAT_MONO16): - (FmtHdr.BitsPerSample==8?AL_FORMAT_STEREO8:AL_FORMAT_STEREO16)); - *freq=FmtHdr.SamplesPerSec; - } - else - { - stream_read(&FmtExHdr,&Stream,sizeof(WAVFmtExHdr_Struct),&memsize); - TEST_SWITCH_SHORT(FmtExHdr.Size); - TEST_SWITCH_SHORT(FmtExHdr.SamplesPerBlock); - } - } - else if (!memcmp(ChunkHdr.Id,"data",4)) - { - if (FmtHdr.Format==0x0001) - { - if((ALsizei)ChunkHdr.Size <= memsize) - { - *size=ChunkHdr.Size; - *data=malloc(ChunkHdr.Size+31); - - if (*data) { - stream_read(*data,&Stream,ChunkHdr.Size,&memsize); - memset(((char *)*data)+ChunkHdr.Size,0,31); - - if(FmtHdr.BitsPerSample == 16 && big_endian) { - int a, len= *size/2; - short *samples= (short*)*data; - - for(a=0; aStopCD(); - SND_CDObject::DisposeSystem(); - } -#ifndef __APPLE__ - if (m_cdrom) - delete m_cdrom; -#endif - if (m_device) - alcCloseDevice((ALCdevice*) m_device); -} - - -SND_WaveSlot* SND_OpenALDevice::LoadSample(const STR_String& name, - void* memlocation, - int size) -{ - SND_WaveSlot* waveslot = NULL; - STR_String samplename = name; - - if (m_audio) - { - /* create the waveslot */ - waveslot = m_wavecache->GetWaveSlot(samplename); - - /* do we support this sample? */ - if (SND_IsSampleValid(name, memlocation)) - { - if (waveslot) - { - bool freemem = false; - int buffer = waveslot->GetBuffer(); - void* data = NULL; - char loop = 'a'; - int sampleformat, bitrate, numberofchannels; - ALenum al_error = alGetError(); - ALsizei samplerate, numberofsamples; // openal_2.14+ - - /* Give them some safe defaults just incase */ - bitrate = numberofchannels = 0; - - if (!(size && memlocation)) { - memlocation = SND_loadFileIntoMemory(samplename.Ptr(), &size); - freemem = true; - } - - /* load the sample from memory? */ - if (size && memlocation) - { - waveslot->SetFileSize(size); - - /* what was (our) buffer? */ - int buffer = waveslot->GetBuffer(); - - /* get some info out of the sample */ - SND_GetSampleInfo((signed char*)memlocation, waveslot); - numberofchannels = SND_GetNumberOfChannels(memlocation); - bitrate = SND_GetBitRate(memlocation); - - /* load the sample into openal */ - SND_alutLoadWAVMemory((ALbyte*)memlocation, size, &sampleformat, &data, &numberofsamples, &samplerate, &loop); - /* put it in the buffer */ - alBufferData(m_buffers[buffer], sampleformat, data, numberofsamples, samplerate); - } - - if(freemem) - free(memlocation); - - /* fill the waveslot with info */ - al_error = alGetError(); - if (al_error == AL_NO_ERROR && m_buffers[buffer]) - { - waveslot->SetData(data); - waveslot->SetSampleFormat(sampleformat); - waveslot->SetNumberOfChannels(numberofchannels); - waveslot->SetSampleRate(samplerate); - waveslot->SetBitRate(bitrate); - waveslot->SetNumberOfSamples(numberofsamples); - - /* if the loading succeeded, mark the waveslot */ - waveslot->SetLoaded(true); - } - else - { - /* or when it failed, free the waveslot */ - m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer()); - waveslot = NULL; - } - - /* and free the original stuff (copy was made in openal) */ - SND_alutUnloadWAV(sampleformat, data, numberofsamples, samplerate); - } - } - else - { - /* sample not supported, remove waveslot */ - m_wavecache->RemoveSample(waveslot->GetSampleName(), waveslot->GetBuffer()); - waveslot = NULL; - } - } - return waveslot; -} - - - -// listener's and general stuff ////////////////////////////////////////////////////// - - - -/* sets the global dopplervelocity */ -void SND_OpenALDevice::SetDopplerVelocity(MT_Scalar dopplervelocity) const -{ - alDopplerVelocity ((float)dopplervelocity); -} - - - -/* sets the global dopplerfactor */ -void SND_OpenALDevice::SetDopplerFactor(MT_Scalar dopplerfactor) const -{ - alDopplerFactor ((float)dopplerfactor); -} - - - -/* sets the global rolloff factor */ -void SND_OpenALDevice::SetListenerRollOffFactor(MT_Scalar rollofffactor) const -{ - // not implemented in openal -} - - - -void SND_OpenALDevice::NextFrame() const -{ - // CD -#ifndef __APPLE__ - m_cdrom->NextFrame(); -#endif - // not needed by openal -} - - - -// set the gain for the listener -void SND_OpenALDevice::SetListenerGain(float gain) const -{ - alListenerf (AL_GAIN, gain); -} - - - -void SND_OpenALDevice::InitListener() -{ - // initialize the listener with these values that won't change - // (as long as we can have only one listener) - // now we can superimpose all listeners on each other (for they - // have the same settings) - float lispos[3] = {0,0,0}; - float lisvel[3] = {0,0,0}; - float lisori[6] = {0,0,1,0,-1,0}; - - alListenerfv(AL_POSITION, lispos); - alListenerfv(AL_VELOCITY, lisvel); - alListenerfv(AL_ORIENTATION, lisori); -} - - - -// source playstate stuff //////////////////////////////////////////////////////////// - - - -/* sets the buffer */ -void SND_OpenALDevice::SetObjectBuffer(int id, unsigned int buffer) -{ - alSourcei (m_sources[id], AL_BUFFER, m_buffers[buffer]); -} - - - -// check if the sound's still playing -int SND_OpenALDevice::GetPlayState(int id) -{ - int alstate = 0; - int result = 0; - -#ifdef __APPLE__ - alGetSourcei(m_sources[id], AL_SOURCE_STATE, &alstate); -#else - alGetSourceiv(m_sources[id], AL_SOURCE_STATE, &alstate); -#endif - - switch(alstate) - { - case AL_INITIAL: - { - result = SND_INITIAL; - break; - } - case AL_PLAYING: - { - result = SND_PLAYING; - break; - } - case AL_PAUSED: - { - result = SND_PAUSED; - break; - } - case AL_STOPPED: - { - result = SND_STOPPED; - break; - } - default: - result = SND_UNKNOWN; - } - - return result; -} - - - -// make the source play -void SND_OpenALDevice::PlayObject(int id) -{ - alSourcePlay(m_sources[id]); -} - - - -// make the source stop -void SND_OpenALDevice::StopObject(int id) const -{ - float obpos[3] = {0,0,0}; - float obvel[3] = {0,0,0}; - - alSourcefv(m_sources[id], AL_POSITION, obpos); - alSourcefv(m_sources[id], AL_VELOCITY, obvel); - - alSourcef(m_sources[id], AL_GAIN, 1.0); - alSourcef(m_sources[id], AL_PITCH, 1.0); - alSourcei(m_sources[id], AL_LOOPING, AL_FALSE); - alSourceStop(m_sources[id]); -} - - - -// stop all sources -void SND_OpenALDevice::StopAllObjects() -{ - alSourceStopv(NUM_SOURCES, m_sources); -} - - - -// pause the source -void SND_OpenALDevice::PauseObject(int id) const -{ - alSourcePause(m_sources[id]); -} - - - -// source properties stuff //////////////////////////////////////////////////////////// - - - -// give openal the object's pitch -void SND_OpenALDevice::SetObjectPitch(int id, MT_Scalar pitch) const -{ - alSourcef (m_sources[id], AL_PITCH, (float)pitch); -} - - - -// give openal the object's gain -void SND_OpenALDevice::SetObjectGain(int id, MT_Scalar gain) const -{ - alSourcef (m_sources[id], AL_GAIN, (float)gain); -} - - - -// give openal the object's looping -void SND_OpenALDevice::SetObjectLoop(int id, unsigned int loopmode) const -{ - if (loopmode == SND_LOOP_OFF) - { - //printf("%d - ", id); - alSourcei (m_sources[id], AL_LOOPING, AL_FALSE); - } - else - alSourcei (m_sources[id], AL_LOOPING, AL_TRUE); -} - -void SND_OpenALDevice::SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const -{ - - -} - - -void SND_OpenALDevice::SetObjectMinGain(int id, MT_Scalar mingain) const -{ - alSourcef (m_sources[id], AL_MIN_GAIN, (float)mingain); -} - - - -void SND_OpenALDevice::SetObjectMaxGain(int id, MT_Scalar maxgain) const -{ - alSourcef (m_sources[id], AL_MAX_GAIN, (float)maxgain); -} - - - -void SND_OpenALDevice::SetObjectRollOffFactor(int id, MT_Scalar rollofffactor) const -{ - alSourcef (m_sources[id], AL_ROLLOFF_FACTOR, (float)rollofffactor); -} - - - -void SND_OpenALDevice::SetObjectReferenceDistance(int id, MT_Scalar referencedistance) const -{ - alSourcef (m_sources[id], AL_REFERENCE_DISTANCE, (float)referencedistance); -} - - - -// give openal the object's position -void SND_OpenALDevice::ObjectIs2D(int id) const -{ - float obpos[3] = {0,0,0}; - float obvel[3] = {0,0,0}; - - alSourcefv(m_sources[id], AL_POSITION, obpos); - alSourcefv(m_sources[id], AL_VELOCITY, obvel); -} - - - -void SND_OpenALDevice::SetObjectTransform(int id, - const MT_Vector3& position, - const MT_Vector3& velocity, - const MT_Matrix3x3& orientation, - const MT_Vector3& lisposition, - const MT_Scalar& rollofffactor) const -{ - float obpos[3]; - float obvel[3]; - - obpos[0] = (float)position[0] * (float)rollofffactor; //x (l/r) - obpos[1] = (float)position[1] * (float)rollofffactor; - obpos[2] = (float)position[2] * (float)rollofffactor; - - alSourcefv(m_sources[id], AL_POSITION, obpos); - - velocity.getValue(obvel); - alSourcefv(m_sources[id], AL_VELOCITY, obvel); -} - -void SND_OpenALDevice::PlayCD(int track) const -{ -#ifndef __APPLE__ - m_cdrom->PlayCD(track); -#endif -} - - -void SND_OpenALDevice::PauseCD(bool pause) const -{ -#ifndef __APPLE__ - m_cdrom->PauseCD(pause); -#endif -} - -void SND_OpenALDevice::StopCD() const -{ -#ifndef __APPLE__ - SND_CDObject* pCD = SND_CDObject::Instance(); - - if (pCD && pCD->GetUsed()) - { - m_cdrom->StopCD(); - } -#endif -} - -void SND_OpenALDevice::SetCDPlaymode(int playmode) const -{ -#ifndef __APPLE__ - m_cdrom->SetCDPlaymode(playmode); -#endif -} - -void SND_OpenALDevice::SetCDGain(MT_Scalar gain) const -{ -#ifndef __APPLE__ - m_cdrom->SetCDGain(gain); -#endif -} diff --git a/intern/SoundSystem/openal/SND_OpenALDevice.h b/intern/SoundSystem/openal/SND_OpenALDevice.h deleted file mode 100644 index a7b97cc314f..00000000000 --- a/intern/SoundSystem/openal/SND_OpenALDevice.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 ***** - */ -#ifndef SND_OPENALDEVICE -#define SND_OPENALDEVICE - -#include "SND_AudioDevice.h" -#include "SoundDefines.h" - -struct SDL_CD; - -class SND_OpenALDevice : public SND_AudioDevice -{ -public: - SND_OpenALDevice(); - virtual ~SND_OpenALDevice(); - - SND_WaveSlot* LoadSample(const STR_String& samplename, - void* memlocation, - int size); - - void InitListener(); - void SetListenerGain(float gain) const; - void SetDopplerVelocity(MT_Scalar dopplervelocity) const; - void SetDopplerFactor(MT_Scalar dopplerfactor) const; - void SetListenerRollOffFactor(MT_Scalar rollofffactor) const; - - void MakeCurrent() const; - - void NextFrame() const; - void UseCD() const; - - void SetObjectBuffer(int id, unsigned int buffer); - - int GetPlayState(int id); - void PlayObject(int id); - void StopObject(int id) const; - void StopAllObjects(); - void PauseObject(int id) const; - - void SetObjectLoop(int id, unsigned int loopmode) const; - void SetObjectLoopPoints(int id, unsigned int loopstart, unsigned int loopend) const; - void SetObjectPitch(int id, MT_Scalar pitch) const; - void SetObjectGain(int id, MT_Scalar gain) const; - void SetObjectMinGain(int id, MT_Scalar mingain) const; - void SetObjectMaxGain(int id, MT_Scalar maxgain) const; - void SetObjectRollOffFactor(int id, MT_Scalar rolloff) const; - void SetObjectReferenceDistance(int id, MT_Scalar distance) const; - - void SetObjectTransform(int id, - const MT_Vector3& position, - const MT_Vector3& velocity, - const MT_Matrix3x3& orientation, - const MT_Vector3& lisposition, - const MT_Scalar& rollofffactor) const; - void ObjectIs2D(int id) const; - - void PlayCD(int track) const; - void PauseCD(bool pause) const; - void StopCD() const; - void SetCDPlaymode(int playmode) const; - void SetCDGain(MT_Scalar gain) const; - - void StartUsingDSP() {}; - float* GetSpectrum() { return NULL; } - void StopUsingDSP() {}; - -private: - void* m_context; - void* m_device; - - unsigned int m_buffers[NUM_BUFFERS]; - unsigned int m_sources[NUM_SOURCES]; - bool m_buffersinitialized; - bool m_sourcesinitialized; -#ifndef __APPLE__ - class SND_SDLCDDevice* m_cdrom; -#endif -}; - -#endif //SND_OPENALDEVICE - diff --git a/intern/SoundSystem/openal/pthread_cancel.cpp b/intern/SoundSystem/openal/pthread_cancel.cpp deleted file mode 100644 index bb36d1dd136..00000000000 --- a/intern/SoundSystem/openal/pthread_cancel.cpp +++ /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 ***** - * FreeBSD 3.4 does not yet have pthread_cancel (3.5 and above do) - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef __FreeBSD__ - -#include - -#if (__FreeBSD_version < 350000) -#include - -#define FD_READ 0x1 -#define _FD_LOCK(_fd,_type,_ts) _thread_fd_lock(_fd, _type, _ts) -#define _FD_UNLOCK(_fd,_type) _thread_fd_unlock(_fd, _type) - -int pthread_cancel(pthread_t pthread) { - pthread_exit(NULL); - return 0; -} - -long fpathconf(int fd, int name) -{ - long ret; - - if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) { - ret = _thread_sys_fpathconf(fd, name); - _FD_UNLOCK(fd, FD_READ); - } - return ret; -} - -#endif - -int pthread_atfork(void *a, void *b, void *c) { - return 0; -} - -#endif diff --git a/intern/SoundSystem/sdl/Makefile b/intern/SoundSystem/sdl/Makefile deleted file mode 100644 index 669d7110797..00000000000 --- a/intern/SoundSystem/sdl/Makefile +++ /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. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# - -LIBNAME = SDLSoundSystem -DIR = $(OCGDIR)/intern/$(LIBNAME) - -include nan_compile.mk - -CCFLAGS += $(LEVEL_1_CPP_WARNINGS) - -CPPFLAGS += $(NAN_SDLCFLAGS) -CPPFLAGS += -I$(NAN_STRING)/include -CPPFLAGS += -I$(NAN_MOTO)/include -CPPFLAGS += -I../intern -CPPFLAGS += -I.. -CPPFLAGS += -I. diff --git a/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp b/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp deleted file mode 100644 index 5054c39e8a1..00000000000 --- a/intern/SoundSystem/sdl/SND_SDLCDDevice.cpp +++ /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 ***** - * SND_SDLCDDevice - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning -#endif //WIN32 - -#include "MT_Scalar.h" - -#include "SND_SDLCDDevice.h" -#include "SoundDefines.h" - -#ifndef DISABLE_SDL -#include -#else -#include -#endif - -SND_SDLCDDevice::SND_SDLCDDevice() : - m_cdrom(NULL), - m_cdplaying(false), - m_cdtrack(0), - m_cdplaymode(SND_CD_TRACK), - m_frame(0) -{ - init(); -} - -void SND_SDLCDDevice::init() -{ -#ifdef DISABLE_SDL - fprintf(stderr, "Blender compiled without SDL, no CDROM support\n"); - return; -#else - if (SDL_InitSubSystem(SDL_INIT_CDROM)) - { - fprintf(stderr, "Error initializing CDROM\n"); - return; - } - - /* Check for CD drives */ - if(!SDL_CDNumDrives()) - { - /* None found */ - fprintf(stderr, "No CDROM devices available\n"); - return; - } - - /* Open the default drive */ - m_cdrom = SDL_CDOpen(0); - - /* Did if open? Check if cdrom is NULL */ - if(!m_cdrom) - { - fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError()); - return; - } -#endif -} - -SND_SDLCDDevice::~SND_SDLCDDevice() -{ -#ifndef DISABLE_SDL - StopCD(); - SDL_CDClose(m_cdrom); -#endif -} - -void SND_SDLCDDevice::NextFrame() -{ -#ifndef DISABLE_SDL - m_frame++; - m_frame &= 127; - - if (!m_frame && m_cdrom && m_cdplaying && SDL_CDStatus(m_cdrom) == CD_STOPPED) - { - switch (m_cdplaymode) - { - case SND_CD_ALL: - if (m_cdtrack < m_cdrom->numtracks) - PlayCD(m_cdtrack + 1); - else - m_cdplaying = false; - break; - default: - case SND_CD_TRACK: - m_cdplaying = false; - break; - case SND_CD_TRACKLOOP: - PlayCD(m_cdtrack); - break; - } - - } -#endif -} - -void SND_SDLCDDevice::PlayCD(int track) -{ -#ifndef DISABLE_SDL - if ( m_cdrom && CD_INDRIVE(SDL_CDStatus(m_cdrom)) ) { - SDL_CDPlayTracks(m_cdrom, track-1, 0, track, 0); - m_cdplaying = true; - m_cdtrack = track; - } -#endif -} - - -void SND_SDLCDDevice::PauseCD(bool pause) -{ -#ifndef DISABLE_SDL - if (!m_cdrom) - return; - - if (pause) - SDL_CDPause(m_cdrom); - else - SDL_CDResume(m_cdrom); -#endif -} - -void SND_SDLCDDevice::StopCD() -{ -#ifndef DISABLE_SDL - if (m_cdrom) - SDL_CDStop(m_cdrom); - m_cdplaying = false; -#endif -} - -void SND_SDLCDDevice::SetCDPlaymode(int playmode) -{ - m_cdplaymode = playmode; -} - -void SND_SDLCDDevice::SetCDGain(MT_Scalar gain) -{ - -} diff --git a/intern/SoundSystem/sdl/SND_SDLCDDevice.h b/intern/SoundSystem/sdl/SND_SDLCDDevice.h deleted file mode 100644 index 96600d53630..00000000000 --- a/intern/SoundSystem/sdl/SND_SDLCDDevice.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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef SND_SDLCDDEVICE -#define SND_SDLCDDEVICE - -struct SDL_CD; - -class SND_SDLCDDevice -{ -public: - SND_SDLCDDevice(); - ~SND_SDLCDDevice(); - - void NextFrame(); - - void PlayCD(int track); - void PauseCD(bool pause); - void StopCD(); - void SetCDPlaymode(int playmode); - void SetCDGain(MT_Scalar gain); - -private: - void init(); - /* CD Audio */ - SDL_CD* m_cdrom; - bool m_cdplaying; - int m_cdtrack; - unsigned char m_cdplaymode; - unsigned char m_frame; -}; - -#endif diff --git a/intern/SoundSystem/SND_Object.h b/intern/container/CTR_HashedPtr.h similarity index 59% rename from intern/SoundSystem/SND_Object.h rename to intern/container/CTR_HashedPtr.h index f23827974e3..0291535d718 100644 --- a/intern/SoundSystem/SND_Object.h +++ b/intern/container/CTR_HashedPtr.h @@ -1,8 +1,4 @@ /* - * SND_Object.h - * - * Abstract sound object - * * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -19,7 +15,7 @@ * * You should have received a copy of the GNU General Public 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. @@ -29,26 +25,33 @@ * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** + * */ -#ifndef __SND_OBJECT_H -#define __SND_OBJECT_H - -#include "GEN_List.h" -#include "MT_Matrix3x3.h" -#include "SoundDefines.h" - -/** - * SND_Object is an interface class for soundobjects, listeners and other - * kinds of sound related thingies. +/** \file container/CTR_HashedPtr.h + * \ingroup ctr */ -class SND_Object : public GEN_Link +#ifndef CTR_HASHEDPTR_H +#define CTR_HASHEDPTR_H + +#include + +inline unsigned int CTR_Hash(void *inDWord) { + size_t key = (size_t)inDWord; + return (unsigned int)(key ^ (key>>4)); +} + +class CTR_HashedPtr +{ + void* m_valptr; public: - SND_Object() {}; - virtual ~SND_Object() {}; + CTR_HashedPtr(void* val) : m_valptr(val) {}; + unsigned int hash() const { return CTR_Hash(m_valptr);}; + inline friend bool operator ==(const CTR_HashedPtr & rhs, const CTR_HashedPtr & lhs) { return rhs.m_valptr == lhs.m_valptr;}; + void *getValue() const { return m_valptr; } }; -#endif //__SND_OBJECT_H +#endif //CTR_HASHEDPTR_H diff --git a/intern/decimation/SConscript b/intern/decimation/SConscript index 46405da2491..6e2929cb650 100644 --- a/intern/decimation/SConscript +++ b/intern/decimation/SConscript @@ -6,4 +6,3 @@ sources = env.Glob('intern/*.cpp') incs = '. ../moto/include ../container ../memutil' env.BlenderLib ('bf_intern_decimate', sources, Split(incs) , [], libtype=['core', 'player'], priority = [200, 100] ) - diff --git a/intern/elbeem/intern/elbeem.h b/intern/elbeem/intern/elbeem.h deleted file mode 100644 index e29890aba44..00000000000 --- a/intern/elbeem/intern/elbeem.h +++ /dev/null @@ -1,262 +0,0 @@ -/****************************************************************************** - * - * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method - * All code distributed as part of El'Beem is covered by the version 2 of the - * GNU General Public License. See the file COPYING for details. - * Copyright 2003-2006 Nils Thuerey - * - * API header - */ -#ifndef ELBEEM_API_H -#define ELBEEM_API_H - - -// simulation run callback function type (elbeemSimulationSettings->runsimCallback) -// best use with FLUIDSIM_CBxxx defines below. -// >parameters -// return values: 0=continue, 1=stop, 2=abort -// data pointer: user data pointer from elbeemSimulationSettings->runsimUserData -// status integer: 1=running simulation, 2=new frame saved -// frame integer: if status is 1, contains current frame number -typedef int (*elbeemRunSimulationCallback)(void *data, int status, int frame); -#define FLUIDSIM_CBRET_CONTINUE 0 -#define FLUIDSIM_CBRET_STOP 1 -#define FLUIDSIM_CBRET_ABORT 2 -#define FLUIDSIM_CBSTATUS_STEP 1 -#define FLUIDSIM_CBSTATUS_NEWFRAME 2 - - -// global settings for the simulation -typedef struct elbeemSimulationSettings { - /* version number */ - short version; - /* id number of simulation domain, needed if more than a - * single domain should be simulated */ - short domainId; // unused within blender - - /* geometrical extent */ - float geoStart[3], geoSize[3]; - - /* resolutions */ - short resolutionxyz; - short previewresxyz; - /* size of the domain in real units (meters along largest resolution x,y,z extent) */ - float realsize; - - /* fluid properties */ - double viscosity; - /* gravity strength */ - float gravity[3]; - /* anim start end time */ - float animStart, aniFrameTime; - /* no. of frames to simulate & output */ - short noOfFrames; - /* g star param (LBM compressibility) */ - float gstar; - /* activate refinement? */ - short maxRefine; - /* probability for surface particle generation (0.0=off) */ - float generateParticles; - /* amount of tracer particles to generate (0=off) */ - int numTracerParticles; - - /* store output path, and file prefix for baked fluid surface */ - char outputPath[160+80]; - - /* channel for frame time, visc & gravity animations */ - int channelSizeFrameTime; - float *channelFrameTime; - int channelSizeViscosity; - float *channelViscosity; - int channelSizeGravity; - float *channelGravity; // vector - - /* boundary types and settings for domain walls */ - short domainobsType; - float domainobsPartslip; - /* generate speed vectors for vertices (e.g. for image based motion blur)*/ - short generateVertexVectors; - /* strength of surface smoothing */ - float surfaceSmoothing; - /* no. of surface subdivisions */ - int surfaceSubdivs; - - /* global transformation to apply to fluidsim mesh */ - float surfaceTrafo[4*4]; - - /* development variables, testing for upcoming releases...*/ - float farFieldSize; - - /* callback function to notify calling program of performed simulation steps - * or newly available frame data, if NULL it is ignored */ - elbeemRunSimulationCallback runsimCallback; - /* pointer passed to runsimCallback for user data storage */ - void* runsimUserData; - -} elbeemSimulationSettings; - - -// defines for elbeemMesh->type below -/* please keep in sync with DNA_object_fluidsim.h */ -#define OB_FLUIDSIM_FLUID 4 -#define OB_FLUIDSIM_OBSTACLE 8 -#define OB_FLUIDSIM_INFLOW 16 -#define OB_FLUIDSIM_OUTFLOW 32 -#define OB_FLUIDSIM_PARTICLE 64 -#define OB_FLUIDSIM_CONTROL 128 - -// defines for elbeemMesh->obstacleType below -#define FLUIDSIM_OBSTACLE_NOSLIP 1 -#define FLUIDSIM_OBSTACLE_PARTSLIP 2 -#define FLUIDSIM_OBSTACLE_FREESLIP 3 - -#define OB_VOLUMEINIT_VOLUME 1 -#define OB_VOLUMEINIT_SHELL 2 -#define OB_VOLUMEINIT_BOTH (OB_VOLUMEINIT_SHELL|OB_VOLUMEINIT_VOLUME) - -// a single mesh object -typedef struct elbeemMesh { - /* obstacle,fluid or inflow or control ... */ - short type; - /* id of simulation domain it belongs to */ - short parentDomainId; - - /* vertices */ - int numVertices; - float *vertices; // = float[n][3]; - /* animated vertices */ - int channelSizeVertices; - float *channelVertices; // = float[channelSizeVertices* (n*3+1) ]; - - /* triangles */ - int numTriangles; - int *triangles; // = int[][3]; - - /* animation channels */ - int channelSizeTranslation; - float *channelTranslation; - int channelSizeRotation; - float *channelRotation; - int channelSizeScale; - float *channelScale; - - /* active channel */ - int channelSizeActive; - float *channelActive; - /* initial velocity channel (e.g. for inflow) */ - int channelSizeInitialVel; - float *channelInitialVel; // vector - /* use initial velocity in object coordinates? (e.g. for rotation) */ - short localInivelCoords; - /* boundary types and settings */ - short obstacleType; - float obstaclePartslip; - /* amount of force transfer from fluid to obj, 0=off, 1=normal */ - float obstacleImpactFactor; - /* init volume, shell or both? use OB_VOLUMEINIT_xxx defines above */ - short volumeInitType; - - /* name of the mesh, mostly for debugging */ - const char *name; - - /* fluid control settings */ - float cpsTimeStart; - float cpsTimeEnd; - float cpsQuality; - - int channelSizeAttractforceStrength; - float *channelAttractforceStrength; - int channelSizeAttractforceRadius; - float *channelAttractforceRadius; - int channelSizeVelocityforceStrength; - float *channelVelocityforceStrength; - int channelSizeVelocityforceRadius; - float *channelVelocityforceRadius; -} elbeemMesh; - -// API functions - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - - -// reset elbeemSimulationSettings struct with defaults -void elbeemResetSettings(struct elbeemSimulationSettings*); - -// start fluidsim init (returns !=0 upon failure) -int elbeemInit(void); - -// frees fluidsim -int elbeemFree(void); - -// start fluidsim init (returns !=0 upon failure) -int elbeemAddDomain(struct elbeemSimulationSettings*); - -// get failure message during simulation or init -// if an error occured (the string is copied into buffer, -// max. length = 256 chars ) -void elbeemGetErrorString(char *buffer); - -// reset elbeemMesh struct with zeroes -void elbeemResetMesh(struct elbeemMesh*); - -// add mesh as fluidsim object -int elbeemAddMesh(struct elbeemMesh*); - -// do the actual simulation -int elbeemSimulate(void); - -// continue a previously stopped simulation -int elbeemContinueSimulation(void); - - -// helper functions - -// simplify animation channels -// returns if the channel and its size changed -int elbeemSimplifyChannelFloat(float *channel, int *size); -int elbeemSimplifyChannelVec3(float *channel, int *size); - -// helper functions implemented in utilities.cpp - -/* set elbeem debug output level (0=off to 10=full on) */ -void elbeemSetDebugLevel(int level); -/* elbeem debug output function, prints if debug level >0 */ -void elbeemDebugOut(char *msg); - -/* estimate how much memory a given setup will require */ -double elbeemEstimateMemreq(int res, - float sx, float sy, float sz, - int refine, char *retstr); - - - -#ifdef __cplusplus -} -#endif // __cplusplus - - - -/******************************************************************************/ -// internal defines, do not use for initializing elbeemMesh -// structs, for these use OB_xxx defines above - -/*! fluid geometry init types */ -// type "int" used, so max is 8 -#define FGI_FLAGSTART 16 -#define FGI_FLUID (1<<(FGI_FLAGSTART+ 0)) -#define FGI_NO_FLUID (1<<(FGI_FLAGSTART+ 1)) -#define FGI_BNDNO (1<<(FGI_FLAGSTART+ 2)) -#define FGI_BNDFREE (1<<(FGI_FLAGSTART+ 3)) -#define FGI_BNDPART (1<<(FGI_FLAGSTART+ 4)) -#define FGI_NO_BND (1<<(FGI_FLAGSTART+ 5)) -#define FGI_MBNDINFLOW (1<<(FGI_FLAGSTART+ 6)) -#define FGI_MBNDOUTFLOW (1<<(FGI_FLAGSTART+ 7)) -#define FGI_CONTROL (1<<(FGI_FLAGSTART+ 8)) - -// all boundary types at once -#define FGI_ALLBOUNDS ( FGI_BNDNO | FGI_BNDFREE | FGI_BNDPART | FGI_MBNDINFLOW | FGI_MBNDOUTFLOW ) - - -#endif // ELBEEM_API_H diff --git a/intern/guardedalloc/SConscript b/intern/guardedalloc/SConscript index d5f41285faa..74d6e07269f 100644 --- a/intern/guardedalloc/SConscript +++ b/intern/guardedalloc/SConscript @@ -13,4 +13,3 @@ if env['WITH_BF_CXX_GUARDEDALLOC']: incs = '.' env.BlenderLib ('bf_intern_guardedalloc', sources, Split(incs), defs, libtype=['intern','player'], priority = [5,150] ) - diff --git a/intern/itasc/kdl/frameacc.hpp b/intern/itasc/kdl/frameacc.hpp index 4157237222e..43e38698ef3 100644 --- a/intern/itasc/kdl/frameacc.hpp +++ b/intern/itasc/kdl/frameacc.hpp @@ -98,9 +98,9 @@ public: Vector dw; //!< angular acceration vector public: RotationAcc():R(),w() {} - explicit RotationAcc(const Rotation& _R):R(_R),w(Vector::Zero()){} - RotationAcc(const Rotation& _R,const Vector& _w,const Vector& _dw): - R(_R),w(_w),dw(_dw) {} + explicit RotationAcc(const Rotation& R_):R(R_),w(Vector::Zero()){} + RotationAcc(const Rotation& R_,const Vector& _w,const Vector& _dw): + R(R_),w(_w),dw(_dw) {} IMETHOD RotationAcc& operator = (const RotationAcc& arg); IMETHOD RotationAcc& operator = (const Rotation& arg); IMETHOD static RotationAcc Identity(); @@ -152,9 +152,9 @@ public: VectorAcc p; //!< Translation, velocity and acceleration of origin. public: FrameAcc(){} - explicit FrameAcc(const Frame& _T):M(_T.M),p(_T.p) {} - FrameAcc(const Frame& _T,const Twist& _t,const Twist& _dt): - M(_T.M,_t.rot,_dt.rot),p(_T.p,_t.vel,_dt.vel) {} + explicit FrameAcc(const Frame& T_):M(T_.M),p(T_.p) {} + FrameAcc(const Frame& T_,const Twist& _t,const Twist& _dt): + M(T_.M,_t.rot,_dt.rot),p(T_.p,_t.vel,_dt.vel) {} FrameAcc(const RotationAcc& _M,const VectorAcc& _p):M(_M),p(_p) {} IMETHOD FrameAcc& operator = (const FrameAcc& arg); diff --git a/intern/opennl/superlu/sgstrf.c b/intern/opennl/superlu/sgstrf.c index 143b6bfd61e..335f21165ca 100644 --- a/intern/opennl/superlu/sgstrf.c +++ b/intern/opennl/superlu/sgstrf.c @@ -399,7 +399,7 @@ sgstrf (superlu_options_t *options, SuperMatrix *A, resetrep_col (nseg, segrep, &repfnz[k]); #ifdef DEBUG -// sprint_lu_col("[2]: ", jj, pivrow, xprune, &Glu); + sprint_lu_col("[2]: ", jj, pivrow, xprune, &Glu); #endif } diff --git a/intern/string/SConscript b/intern/string/SConscript index 7e84f3264db..dac0ead8e61 100644 --- a/intern/string/SConscript +++ b/intern/string/SConscript @@ -11,4 +11,3 @@ if env['WITH_BF_CXX_GUARDEDALLOC']: incs += ' #intern/guardedalloc' env.BlenderLib ('bf_intern_string', sources, Split(incs), defs, libtype=['intern','player'], priority = [50,10] ) - diff --git a/release/plugins/sequence/Makefile b/release/plugins/sequence/Makefile deleted file mode 100644 index ab847adf5fe..00000000000 --- a/release/plugins/sequence/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** - -all: plugins - -plugins: - @/bin/sh -c 'for i in *.c; do ../bmake $$i; done;' - -clean: - rm -rf *.o *.so diff --git a/release/scripts/export_cal3d.py b/release/scripts/export_cal3d.py deleted file mode 100644 index 990ac480e3d..00000000000 --- a/release/scripts/export_cal3d.py +++ /dev/null @@ -1,1112 +0,0 @@ -#!BPY -""" -Name: 'Cal3D (.cfg .xaf .xsf .xmf .xrf)...' -Blender: 243 -Group: 'Export' -Tip: 'Export armature/bone/mesh/action data to the Cal3D format.' -""" - -# export_cal3d.py -# Copyright (C) 2003-2004 Jean-Baptiste LAMY -- jibalamy@free.fr -# Copyright (C) 2004 Matthias Braun -- matze@braunis.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -__version__ = '0.9f' -__author__ = 'Jean-Baptiste, Jiba, Lamy, Campbell Barton (Ideasman42)' -__email__ = ['Authors email, jibalamy:free*fr'] -__url__ = ['Soya3ds homepage, http://home.gna.org/oomadness/en/soya/', 'Cal3d, http://cal3d.sourceforge.net'] -__bpydoc__ =\ -'''This script is a Blender => Cal3D converter. -(See http://blender.org and http://cal3d.sourceforge.net) - -USAGE: - -To install it, place the script in your $HOME/.blender/scripts directory. - -Then open the File->Export->Cal3d v0.9 menu. And select the filename of the .cfg file. -The exporter will create a set of other files with same prefix (ie. bla.cfg, bla.xsf, -bla_Action1.xaf, bla_Action2.xaf, ...). - -You should be able to open the .cfg file in cal3d_miniviewer. - - -NOT (YET) SUPPORTED: - - - Rotation, translation, or stretching Blender objects is still quite -buggy, so AVOID MOVING / ROTATING / RESIZE OBJECTS (either mesh or armature) ! -Instead, edit the object (with tab), select all points / bones (with "a"), -and move / rotate / resize them.
- - no support for exporting springs yet
- - no support for exporting material colors (most games should only use images -I think...) - - -KNOWN ISSUES: - - - Cal3D versions <=0.9.1 have a bug where animations aren't played when the root bone -is not animated;
- - Cal3D versions <=0.9.1 have a bug where objects that aren't influenced by any bones -are not drawn (fixed in Cal3D CVS). - - -NOTES: - -It requires a very recent version of Blender (>= 2.44). - -Build a model following a few rules:
- - Use only a single armature;
- - Use only a single rootbone (Cal3D doesn't support floating bones);
- - Use only locrot keys (Cal3D doesn't support bone's size change);
- - Don't try to create child/parent constructs in blender object, that gets exported -incorrectly at the moment;
- - Objects or animations whose names start by "_" are not exported (hidden object). - -You can pass as many parameters as you want at the end, "EXPORT_FOR_SOYA=1" is just an -example. The parameters are the same as below. -''' - -# True (=1) to export for the Soya 3D engine -# (http://oomadness.tuxfamily.org/en/soya). -# (=> rotate meshes and skeletons so as X is right, Y is top and -Z is front) -# EXPORT_FOR_SOYA = 0 - -# Enables LODs computation. LODs computation is quite slow, and the algo is -# surely not optimal :-( -LODS = 0 - -# Scale the model (not supported by Soya). - -# See also BASE_MATRIX below, if you want to rotate/scale/translate the model at -# the exportation. - -######################################################################################### -# Code starts here. -# The script should be quite re-useable for writing another Blender animation exporter. -# Most of the hell of it is to deal with Blender's head-tail-roll bone's definition. - -import math -import Blender -import BPyMesh -import BPySys -import BPyArmature -import BPyObject -import bpy - -def best_armature_root(armature): - ''' - Find the armature root bone with the most children, return that bone - ''' - - bones = [bone for bone in armature.bones.values() if bone.hasChildren() == True] - if len(bones) == 1: - return bones[0] - - # Get the best root since we have more then 1 - bones = [(len(bone.getAllChildren()), bone) for bone in bones] - bones.sort() - return bones[-1][1] # bone with most children - - -Vector = Blender.Mathutils.Vector -Quaternion = Blender.Mathutils.Quaternion -Matrix = Blender.Mathutils.Matrix - -# HACK -- it seems that some Blender versions don't define sys.argv, -# which may crash Python if a warning occurs. -# if not hasattr(sys, 'argv'): sys.argv = ['???'] - -def matrix_multiply(b, a): - return [ [ - a[0][0] * b[0][0] + a[0][1] * b[1][0] + a[0][2] * b[2][0], - a[0][0] * b[0][1] + a[0][1] * b[1][1] + a[0][2] * b[2][1], - a[0][0] * b[0][2] + a[0][1] * b[1][2] + a[0][2] * b[2][2], - 0.0, - ], [ - a[1][0] * b[0][0] + a[1][1] * b[1][0] + a[1][2] * b[2][0], - a[1][0] * b[0][1] + a[1][1] * b[1][1] + a[1][2] * b[2][1], - a[1][0] * b[0][2] + a[1][1] * b[1][2] + a[1][2] * b[2][2], - 0.0, - ], [ - a[2][0] * b[0][0] + a[2][1] * b[1][0] + a[2][2] * b[2][0], - a[2][0] * b[0][1] + a[2][1] * b[1][1] + a[2][2] * b[2][1], - a[2][0] * b[0][2] + a[2][1] * b[1][2] + a[2][2] * b[2][2], - 0.0, - ], [ - a[3][0] * b[0][0] + a[3][1] * b[1][0] + a[3][2] * b[2][0] + b[3][0], - a[3][0] * b[0][1] + a[3][1] * b[1][1] + a[3][2] * b[2][1] + b[3][1], - a[3][0] * b[0][2] + a[3][1] * b[1][2] + a[3][2] * b[2][2] + b[3][2], - 1.0, - ] ] - -# multiplies 2 quaternions in x,y,z,w notation -def quaternion_multiply(q1, q2): - return Quaternion(\ - q2[3] * q1[0] + q2[0] * q1[3] + q2[1] * q1[2] - q2[2] * q1[1], - q2[3] * q1[1] + q2[1] * q1[3] + q2[2] * q1[0] - q2[0] * q1[2], - q2[3] * q1[2] + q2[2] * q1[3] + q2[0] * q1[1] - q2[1] * q1[0], - q2[3] * q1[3] - q2[0] * q1[0] - q2[1] * q1[1] - q2[2] * q1[2],\ - ) - -def matrix_translate(m, v): - m[3][0] += v[0] - m[3][1] += v[1] - m[3][2] += v[2] - return m - -def matrix2quaternion(m): - s = math.sqrt(abs(m[0][0] + m[1][1] + m[2][2] + m[3][3])) - if s == 0.0: - x = abs(m[2][1] - m[1][2]) - y = abs(m[0][2] - m[2][0]) - z = abs(m[1][0] - m[0][1]) - if (x >= y) and (x >= z): return Quaternion(1.0, 0.0, 0.0, 0.0) - elif (y >= x) and (y >= z): return Quaternion(0.0, 1.0, 0.0, 0.0) - else: return Quaternion(0.0, 0.0, 1.0, 0.0) - - q = Quaternion([ - -(m[2][1] - m[1][2]) / (2.0 * s), - -(m[0][2] - m[2][0]) / (2.0 * s), - -(m[1][0] - m[0][1]) / (2.0 * s), - 0.5 * s, - ]) - q.normalize() - #print q - return q - -def vector_by_matrix_3x3(p, m): - return [p[0] * m[0][0] + p[1] * m[1][0] + p[2] * m[2][0], - p[0] * m[0][1] + p[1] * m[1][1] + p[2] * m[2][1], - p[0] * m[0][2] + p[1] * m[1][2] + p[2] * m[2][2]] - -def vector_add(v1, v2): - return [v1[0]+v2[0], v1[1]+v2[1], v1[2]+v2[2]] - -def vector_sub(v1, v2): - return [v1[0]-v2[0], v1[1]-v2[1], v1[2]-v2[2]] - -def quaternion2matrix(q): - xx = q[0] * q[0] - yy = q[1] * q[1] - zz = q[2] * q[2] - xy = q[0] * q[1] - xz = q[0] * q[2] - yz = q[1] * q[2] - wx = q[3] * q[0] - wy = q[3] * q[1] - wz = q[3] * q[2] - return Matrix([1.0 - 2.0 * (yy + zz), 2.0 * (xy + wz), 2.0 * (xz - wy), 0.0], - [ 2.0 * (xy - wz), 1.0 - 2.0 * (xx + zz), 2.0 * (yz + wx), 0.0], - [ 2.0 * (xz + wy), 2.0 * (yz - wx), 1.0 - 2.0 * (xx + yy), 0.0], - [0.0 , 0.0 , 0.0 , 1.0]) - -def matrix_invert(m): - det = (m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) - + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2])) - if det == 0.0: return None - det = 1.0 / det - r = [ [ - det * (m[1][1] * m[2][2] - m[2][1] * m[1][2]), - - det * (m[0][1] * m[2][2] - m[2][1] * m[0][2]), - det * (m[0][1] * m[1][2] - m[1][1] * m[0][2]), - 0.0, - ], [ - - det * (m[1][0] * m[2][2] - m[2][0] * m[1][2]), - det * (m[0][0] * m[2][2] - m[2][0] * m[0][2]), - - det * (m[0][0] * m[1][2] - m[1][0] * m[0][2]), - 0.0 - ], [ - det * (m[1][0] * m[2][1] - m[2][0] * m[1][1]), - - det * (m[0][0] * m[2][1] - m[2][0] * m[0][1]), - det * (m[0][0] * m[1][1] - m[1][0] * m[0][1]), - 0.0, - ] ] - r.append([ - -(m[3][0] * r[0][0] + m[3][1] * r[1][0] + m[3][2] * r[2][0]), - -(m[3][0] * r[0][1] + m[3][1] * r[1][1] + m[3][2] * r[2][1]), - -(m[3][0] * r[0][2] + m[3][1] * r[1][2] + m[3][2] * r[2][2]), - 1.0, - ]) - return r - - -def point_by_matrix(p, m): - return [p[0] * m[0][0] + p[1] * m[1][0] + p[2] * m[2][0] + m[3][0], - p[0] * m[0][1] + p[1] * m[1][1] + p[2] * m[2][1] + m[3][1], - p[0] * m[0][2] + p[1] * m[1][2] + p[2] * m[2][2] + m[3][2]] - -# Hack for having the model rotated right. -# Put in BASE_MATRIX your own rotation if you need some. - -BASE_MATRIX = None - - -# Cal3D data structures - -CAL3D_VERSION = 910 -MATERIALS = {} # keys are (mat.name, img.name) - -class Cal3DMaterial(object): - __slots__ = 'amb', 'diff', 'spec', 'shininess', 'maps_filenames', 'id' - def __init__(self, blend_world, blend_material, blend_images): - - # Material Settings - if blend_world: amb = [ int(c*255) for c in blend_world.amb ] - else: amb = [0,0,0] # Default value - - if blend_material: - self.amb = tuple([int(c*blend_material.amb) for c in amb] + [255]) - self.diff = tuple([int(c*255) for c in blend_material.rgbCol] + [int(blend_material.alpha*255)]) - self.spec = tuple([int(c*255) for c in blend_material.rgbCol] + [int(blend_material.alpha*255)]) - self.shininess = (float(blend_material.hard)-1)/5.10 - else: - self.amb = tuple(amb + [255]) - self.diff = (255,255,255,255) - self.spec = (255,255,255,255) - self.shininess = 1.0 - - self.maps_filenames = [] - for image in blend_images: - if image: - self.maps_filenames.append( image.filename.split('\\')[-1].split('/')[-1] ) - - self.id = len(MATERIALS) - MATERIALS[blend_material, blend_images] = self - - # new xml format - def writeCal3D(self, file): - file.write('\n') - file.write('
\n' % CAL3D_VERSION) - file.write('\n' % len(self.maps_filenames)) - file.write('\t%i %i %i %i\n' % self.amb) - file.write('\t%i %i %i %i\n' % self.diff) - file.write('\t%i %i %i %i\n' % self.spec) - file.write('\t%.6f\n' % self.shininess) - - for map_filename in self.maps_filenames: - file.write('\t%s\n' % map_filename) - - file.write('\n') - - -class Cal3DMesh(object): - __slots__ = 'name', 'submeshes', 'matrix', 'matrix_normal' - def __init__(self, ob, blend_mesh, blend_world): - self.name = ob.name - self.submeshes = [] - - BPyMesh.meshCalcNormals(blend_mesh) - - self.matrix = ob.matrixWorld - self.matrix_normal = self.matrix.copy().rotationPart() - - #if BASE_MATRIX: - # matrix = matrix_multiply(BASE_MATRIX, matrix) - - face_groups = {} - blend_materials = blend_mesh.materials - uvlayers = () - mat = None # incase we have no materials - if blend_mesh.faceUV: - uvlayers = blend_mesh.getUVLayerNames() - if len(uvlayers) == 1: - for f in blend_mesh.faces: - image = (f.image,) # bit in a tuple so we can match multi UV code - if blend_materials: mat = blend_materials[f.mat] # if no materials, mat will always be None - face_groups.setdefault( (mat,image), (mat,image,[]) )[2].append( f ) - else: - # Multi UV's - face_multi_images = [[] for i in xrange(len(blend_mesh.faces))] - face_multi_uvs = [[[] for i in xrange(len(f)) ] for f in blend_mesh.faces] - for uvlayer in uvlayers: - blend_mesh.activeUVLayer = uvlayer - for i, f in enumerate(blend_mesh.faces): - face_multi_images[i].append(f.image) - if f.image: - for j, uv in enumerate(f.uv): - face_multi_uvs[i][j].append( tuple(uv) ) - - # Convert UV's to tuples so they can be compared with eachother - # when creating new verts - for fuv in face_multi_uvs: - for i, uv in enumerate(fuv): - fuv[i] = tuple(uv) - - for i, f in enumerate(blend_mesh.faces): - image = tuple(face_multi_images[i]) - if blend_materials: mat = blend_materials[f.mat] - face_groups.setdefault( (mat,image), (mat,image,[]) )[2].append( f ) - else: - # No UV's - for f in blend_mesh.faces: - if blend_materials: mat = blend_materials[f.mat] - face_groups.setdefault( (mat,()), (mat,(),[]) )[2].append( f ) - - for blend_material, blend_images, faces in face_groups.itervalues(): - - try: material = MATERIALS[blend_material, blend_images] - except: material = MATERIALS[blend_material, blend_images] = Cal3DMaterial(blend_world, blend_material, blend_images) - - submesh = Cal3DSubMesh(self, material, len(self.submeshes)) - self.submeshes.append(submesh) - - # Check weather we need to write UVs, dont do it if theres no image - # Multilayer UV's have alredy checked that they have images when - # building face_multi_uvs - if len(uvlayers) == 1: - if blend_images == (None,): - write_single_layer_uvs = False - else: - write_single_layer_uvs = True - - - for face in faces: - - if not face.smooth: - normal = face.no - - face_vertices = [] - face_v = face.v - - - if len(uvlayers)>1: - for i, blend_vert in enumerate(face_v): - if face.smooth: normal = blend_vert.no - vertex = submesh.getVertex(blend_mesh, blend_vert, normal, face_multi_uvs[face.index][i]) - face_vertices.append(vertex) - - elif len(uvlayers)==1: - if write_single_layer_uvs: - face_uv = face.uv - - for i, blend_vert in enumerate(face_v): - if face.smooth: normal = blend_vert.no - if write_single_layer_uvs: uvs = (tuple(face_uv[i]),) - else: uvs = () - - vertex = submesh.getVertex(blend_mesh, blend_vert, normal, uvs ) - face_vertices.append(vertex) - else: - # No UVs - for i, blend_vert in enumerate(face_v): - if face.smooth: normal = blend_vert.no - vertex = submesh.getVertex(blend_mesh, blend_vert, normal, () ) - face_vertices.append(vertex) - - - # Split faces with more than 3 vertices - for i in xrange(1, len(face) - 1): - submesh.faces.append(Cal3DFace(face_vertices[0], face_vertices[i], face_vertices[i + 1])) - - def writeCal3D(self, file): - file.write('\n') - file.write('
\n' % CAL3D_VERSION) - file.write('\n' % len(self.submeshes)) - for submesh in self.submeshes: - submesh.writeCal3D(file, self.matrix, self.matrix_normal) - file.write('\n') - - -class Cal3DSubMesh(object): - __slots__ = 'material', 'vertices', 'vert_mapping', 'vert_count', 'faces', 'nb_lodsteps', 'springs', 'id' - def __init__(self, mesh, material, id): - self.material = material - self.vertices = [] - self.vert_mapping = {} # map original indicies to local - self.vert_count = 0 - self.faces = [] - self.nb_lodsteps = 0 - self.springs = [] - self.id = id - - def getVertex(self, blend_mesh, blend_vert, normal, maps): - ''' - Request a vertex, and create a new one or return a matching vertex - ''' - blend_index = blend_vert.index - index_map = self.vert_mapping.get(blend_index) - - if index_map == None: - vertex = Cal3DVertex(blend_vert.co, normal, maps, blend_mesh.getVertexInfluences(blend_index)) - self.vertices.append([vertex]) - self.vert_mapping[blend_index] = len(self.vert_mapping) - self.vert_count +=1 - return vertex - else: - vertex_list = self.vertices[index_map] - - for v in vertex_list: - if v.normal == normal and\ - v.maps == maps: - return v # reusing - - # No match, add a new vert - # Use the first verts influences - vertex = Cal3DVertex(blend_vert.co, normal, maps, vertex_list[0].influences) - vertex_list.append(vertex) - # self.vert_mapping[blend_index] = len(self.vert_mapping) - self.vert_count +=1 - return vertex - - - def compute_lods(self): - '''Computes LODs info for Cal3D (there's no Blender related stuff here).''' - - print 'Start LODs computation...' - vertex2faces = {} - for face in self.faces: - for vertex in (face.vertex1, face.vertex2, face.vertex3): - l = vertex2faces.get(vertex) - if not l: vertex2faces[vertex] = [face] - else: l.append(face) - - couple_treated = {} - couple_collapse_factor = [] - for face in self.faces: - for a, b in ((face.vertex1, face.vertex2), (face.vertex1, face.vertex3), (face.vertex2, face.vertex3)): - a = a.cloned_from or a - b = b.cloned_from or b - if a.id > b.id: a, b = b, a - if not couple_treated.has_key((a, b)): - # The collapse factor is simply the distance between the 2 points :-( - # This should be improved !! - if vector_dotproduct(a.normal, b.normal) < 0.9: continue - couple_collapse_factor.append((point_distance(a.loc, b.loc), a, b)) - couple_treated[a, b] = 1 - - couple_collapse_factor.sort() - - collapsed = {} - new_vertices = [] - new_faces = [] - for factor, v1, v2 in couple_collapse_factor: - # Determines if v1 collapses to v2 or v2 to v1. - # We choose to keep the vertex which is on the smaller number of faces, since - # this one has more chance of being in an extrimity of the body. - # Though heuristic, this rule yields very good results in practice. - if len(vertex2faces[v1]) < len(vertex2faces[v2]): v2, v1 = v1, v2 - elif len(vertex2faces[v1]) == len(vertex2faces[v2]): - if collapsed.get(v1, 0): v2, v1 = v1, v2 # v1 already collapsed, try v2 - - if (not collapsed.get(v1, 0)) and (not collapsed.get(v2, 0)): - collapsed[v1] = 1 - collapsed[v2] = 1 - - # Check if v2 is already colapsed - while v2.collapse_to: v2 = v2.collapse_to - - common_faces = filter(vertex2faces[v1].__contains__, vertex2faces[v2]) - - v1.collapse_to = v2 - v1.face_collapse_count = len(common_faces) - - for clone in v1.clones: - # Find the clone of v2 that correspond to this clone of v1 - possibles = [] - for face in vertex2faces[clone]: - possibles.append(face.vertex1) - possibles.append(face.vertex2) - possibles.append(face.vertex3) - clone.collapse_to = v2 - for vertex in v2.clones: - if vertex in possibles: - clone.collapse_to = vertex - break - - clone.face_collapse_count = 0 - new_vertices.append(clone) - - # HACK -- all faces get collapsed with v1 (and no faces are collapsed with v1's - # clones). This is why we add v1 in new_vertices after v1's clones. - # This hack has no other incidence that consuming a little few memory for the - # extra faces if some v1's clone are collapsed but v1 is not. - new_vertices.append(v1) - - self.nb_lodsteps += 1 + len(v1.clones) - - new_faces.extend(common_faces) - for face in common_faces: - face.can_collapse = 1 - - # Updates vertex2faces - vertex2faces[face.vertex1].remove(face) - vertex2faces[face.vertex2].remove(face) - vertex2faces[face.vertex3].remove(face) - vertex2faces[v2].extend(vertex2faces[v1]) - - new_vertices.extend(filter(lambda vertex: not vertex.collapse_to, self.vertices)) - new_vertices.reverse() # Cal3D want LODed vertices at the end - for i in xrange(len(new_vertices)): new_vertices[i].id = i - self.vertices = new_vertices - - new_faces.extend(filter(lambda face: not face.can_collapse, self.faces)) - new_faces.reverse() # Cal3D want LODed faces at the end - self.faces = new_faces - - print 'LODs computed : %s vertices can be removed (from a total of %s).' % (self.nb_lodsteps, len(self.vertices)) - - - def writeCal3D(self, file, matrix, matrix_normal): - - file.write('\t\n' % \ - (self.nb_lodsteps, len(self.springs), - len(self.material.maps_filenames))) - - i = 0 - for v in self.vertices: - for item in v: - item.id = i - item.writeCal3D(file, matrix, matrix_normal) - i += 1 - - for item in self.springs: - item.writeCal3D(file) - for item in self.faces: - item.writeCal3D(file) - - file.write('\t\n') - -class Cal3DVertex(object): - __slots__ = 'loc','normal','collapse_to','face_collapse_count','maps','influences','weight','cloned_from','clones','id' - def __init__(self, loc, normal, maps, blend_influences): - self.loc = loc - self.normal = normal - self.collapse_to = None - self.face_collapse_count = 0 - self.maps = maps - self.weight = None - - self.cloned_from = None - self.clones = [] - - self.id = -1 - - if len(blend_influences) == 0 or isinstance(blend_influences[0], Cal3DInfluence): - # This is a copy from another vert - self.influences = blend_influences - else: - # Pass the blender influences - - self.influences = [] - # should this really be a warning? (well currently enabled, - # because blender has some bugs where it doesn't return - # influences in python api though they are set, and because - # cal3d<=0.9.1 had bugs where objects without influences - # aren't drawn. - #if not blend_influences: - # print 'A vertex of object "%s" has no influences.\n(This occurs on objects placed in an invisible layer, you can fix it by using a single layer)' % ob.name - - # sum of influences is not always 1.0 in Blender ?!?! - sum = 0.0 - - for bone_name, weight in blend_influences: - sum += weight - - for bone_name, weight in blend_influences: - bone = BONES.get(bone_name) - if not bone: # keys - # print 'Couldnt find bone "%s" which influences object "%s"' % (bone_name, ob.name) - continue - - if weight: - self.influences.append(Cal3DInfluence(bone, weight / sum)) - - - def writeCal3D(self, file, matrix, matrix_normal): - if self.collapse_to: - collapse_id = self.collapse_to.id - else: - collapse_id = -1 - file.write('\t\t\n' % \ - (self.id, len(self.influences))) - file.write('\t\t\t%.6f %.6f %.6f\n' % tuple(self.loc*matrix)) - file.write('\t\t\t%.6f %.6f %.6f\n' % tuple( (self.normal*matrix_normal).normalize() )) - if collapse_id != -1: - file.write('\t\t\t%i\n' % collapse_id) - file.write('\t\t\t%i\n' % \ - self.face_collapse_count) - - for uv in self.maps: - # we cant have more UV's then our materials image maps - # check for this - file.write('\t\t\t%.6f %.6f\n' % uv) - - for item in self.influences: - item.writeCal3D(file) - - if self.weight != None: - file.write('\t\t\t%.6f\n' % len(self.weight)) - file.write('\t\t\n') - -class Cal3DInfluence(object): - __slots__ = 'bone', 'weight' - def __init__(self, bone, weight): - self.bone = bone - self.weight = weight - - def writeCal3D(self, file): - file.write('\t\t\t%.6f\n' % \ - (self.bone.id, self.weight)) - -class Cal3DSpring(object): - __slots__ = 'vertex1', 'vertex2', 'spring_coefficient', 'idlelength' - def __init__(self, vertex1, vertex2): - self.vertex1 = vertex1 - self.vertex2 = vertex2 - self.spring_coefficient = 0.0 - self.idlelength = 0.0 - - def writeCal3D(self, file): - file.write('\t\t\n' % \ - (self.vertex1.id, self.vertex2.id, self.spring_coefficient, self.idlelength)) - -class Cal3DFace(object): - __slots__ = 'vertex1', 'vertex2', 'vertex3', 'can_collapse', - def __init__(self, vertex1, vertex2, vertex3): - self.vertex1 = vertex1 - self.vertex2 = vertex2 - self.vertex3 = vertex3 - self.can_collapse = 0 - - def writeCal3D(self, file): - file.write('\t\t\n' % \ - (self.vertex1.id, self.vertex2.id, self.vertex3.id)) - -class Cal3DSkeleton(object): - __slots__ = 'bones' - def __init__(self): - self.bones = [] - - def writeCal3D(self, file): - file.write('\n') - file.write('
\n' % CAL3D_VERSION) - file.write('\n' % len(self.bones)) - for item in self.bones: - item.writeCal3D(file) - - file.write('\n') - -BONES = {} -POSEBONES= {} -class Cal3DBone(object): - __slots__ = 'head', 'tail', 'name', 'cal3d_parent', 'loc', 'quat', 'children', 'matrix', 'lloc', 'lquat', 'id' - def __init__(self, skeleton, blend_bone, arm_matrix, cal3d_parent=None): - - # def treat_bone(b, parent = None): - head = blend_bone.head['BONESPACE'] - tail = blend_bone.tail['BONESPACE'] - #print parent.quat - # Turns the Blender's head-tail-roll notation into a quaternion - #quat = matrix2quaternion(blender_bone2matrix(head, tail, blend_bone.roll['BONESPACE'])) - quat = matrix2quaternion(blend_bone.matrix['BONESPACE'].copy().resize4x4()) - - # Pose location - ploc = POSEBONES[blend_bone.name].loc - - if cal3d_parent: - # Compute the translation from the parent bone's head to the child - # bone's head, in the parent bone coordinate system. - # The translation is parent_tail - parent_head + child_head, - # but parent_tail and parent_head must be converted from the parent's parent - # system coordinate into the parent system coordinate. - - parent_invert_transform = matrix_invert(quaternion2matrix(cal3d_parent.quat)) - parent_head = vector_by_matrix_3x3(cal3d_parent.head, parent_invert_transform) - parent_tail = vector_by_matrix_3x3(cal3d_parent.tail, parent_invert_transform) - ploc = vector_add(ploc, blend_bone.head['BONESPACE']) - - # EDIT!!! FIX BONE OFFSET BE CAREFULL OF THIS PART!!! ?? - #diff = vector_by_matrix_3x3(head, parent_invert_transform) - parent_tail= vector_add(parent_tail, head) - # DONE!!! - - parentheadtotail = vector_sub(parent_tail, parent_head) - # hmm this should be handled by the IPos, but isn't for non-animated - # bones which are transformed in the pose mode... - loc = parentheadtotail - - else: - # Apply the armature's matrix to the root bones - head = point_by_matrix(head, arm_matrix) - tail = point_by_matrix(tail, arm_matrix) - - loc = head - quat = matrix2quaternion(matrix_multiply(arm_matrix, quaternion2matrix(quat))) # Probably not optimal - - self.head = head - self.tail = tail - - self.cal3d_parent = cal3d_parent - self.name = blend_bone.name - self.loc = loc - self.quat = quat - self.children = [] - - self.matrix = matrix_translate(quaternion2matrix(quat), loc) - if cal3d_parent: - self.matrix = matrix_multiply(cal3d_parent.matrix, self.matrix) - - # lloc and lquat are the bone => model space transformation (translation and rotation). - # They are probably specific to Cal3D. - m = matrix_invert(self.matrix) - self.lloc = m[3][0], m[3][1], m[3][2] - self.lquat = matrix2quaternion(m) - - self.id = len(skeleton.bones) - skeleton.bones.append(self) - BONES[self.name] = self - - if not blend_bone.hasChildren(): return - for blend_child in blend_bone.children: - self.children.append(Cal3DBone(skeleton, blend_child, arm_matrix, self)) - - - def writeCal3D(self, file): - file.write('\t\n' % \ - (self.id, self.name, len(self.children))) - # We need to negate quaternion W value, but why ? - file.write('\t\t%.6f %.6f %.6f\n' % \ - (self.loc[0], self.loc[1], self.loc[2])) - file.write('\t\t%.6f %.6f %.6f %.6f\n' % \ - (self.quat[0], self.quat[1], self.quat[2], -self.quat[3])) - file.write('\t\t%.6f %.6f %.6f\n' % \ - (self.lloc[0], self.lloc[1], self.lloc[2])) - file.write('\t\t%.6f %.6f %.6f %.6f\n' % \ - (self.lquat[0], self.lquat[1], self.lquat[2], -self.lquat[3])) - if self.cal3d_parent: - file.write('\t\t%i\n' % self.cal3d_parent.id) - else: - file.write('\t\t%i\n' % -1) - - for item in self.children: - file.write('\t\t%i\n' % item.id) - - file.write('\t\n') - -class Cal3DAnimation: - def __init__(self, name, duration = 0.0): - self.name = name - self.duration = duration - self.tracks = {} # Map bone names to tracks - - def writeCal3D(self, file): - file.write('\n') - file.write('
\n' % CAL3D_VERSION) - file.write('\n' % \ - (self.duration, len(self.tracks))) - - for item in self.tracks.itervalues(): - item.writeCal3D(file) - - file.write('\n') - -class Cal3DTrack(object): - __slots__ = 'bone', 'keyframes' - def __init__(self, bone): - self.bone = bone - self.keyframes = [] - - def writeCal3D(self, file): - file.write('\t\n' % - (self.bone.id, len(self.keyframes))) - for item in self.keyframes: - item.writeCal3D(file) - file.write('\t\n') - -class Cal3DKeyFrame(object): - __slots__ = 'time', 'loc', 'quat' - def __init__(self, time, loc, quat): - self.time = time - self.loc = loc - self.quat = quat - - def writeCal3D(self, file): - file.write('\t\t\n' % self.time) - file.write('\t\t\t%.6f %.6f %.6f\n' % \ - (self.loc[0], self.loc[1], self.loc[2])) - # We need to negate quaternion W value, but why ? - file.write('\t\t\t%.6f %.6f %.6f %.6f\n' % \ - (self.quat[0], self.quat[1], self.quat[2], -self.quat[3])) - file.write('\t\t\n') - -def export_cal3d(filename, PREF_SCALE=0.1, PREF_BAKE_MOTION = True, PREF_ACT_ACTION_ONLY=True, PREF_SCENE_FRAMES=False): - if not filename.endswith('.cfg'): - filename += '.cfg' - - file_only = filename.split('/')[-1].split('\\')[-1] - file_only_noext = file_only.split('.')[0] - base_only = filename[:-len(file_only)] - - def new_name(dataname, ext): - return file_only_noext + '_' + BPySys.cleanName(dataname) + ext - - #if EXPORT_FOR_SOYA: - # global BASE_MATRIX - # BASE_MATRIX = matrix_rotate_x(-math.pi / 2.0) - # Get the sce - - sce = bpy.data.scenes.active - blend_world = sce.world - # ---- Export skeleton (armature) ---------------------------------------- - - skeleton = Cal3DSkeleton() - blender_armature = [ob for ob in sce.objects.context if ob.type == 'Armature'] - if len(blender_armature) > 1: print "Found multiple armatures! using ",armatures[0].name - if blender_armature: blender_armature = blender_armature[0] - else: - # Try find a meshes armature - for ob in sce.objects.context: - blender_armature = BPyObject.getObjectArmature(ob) - if blender_armature: - break - - if not blender_armature: - Blender.Draw.PupMenu('Aborting%t|No Armature in selection') - return - - # we need pose bone locations - for pbone in blender_armature.getPose().bones.values(): - POSEBONES[pbone.name] = pbone - - Cal3DBone(skeleton, best_armature_root(blender_armature.getData()), blender_armature.matrixWorld) - - # ---- Export Mesh data --------------------------------------------------- - meshes = [] - for ob in sce.objects.context: - if ob.type != 'Mesh': continue - blend_mesh = ob.getData(mesh=1) - - if not blend_mesh.faces: continue - meshes.append( Cal3DMesh(ob, blend_mesh, blend_world) ) - - # ---- Export animations -------------------------------------------------- - backup_action = blender_armature.action - - ANIMATIONS = [] - SUPPORTED_IPOS = 'QuatW', 'QuatX', 'QuatY', 'QuatZ', 'LocX', 'LocY', 'LocZ' - - if PREF_ACT_ACTION_ONLY: action_items = [(blender_armature.action.name, blender_armature.action)] - else: action_items = Blender.Armature.NLA.GetActions().items() - - print len(action_items), 'action_items' - - for animation_name, blend_action in action_items: - - # get frame range - if PREF_SCENE_FRAMES: - action_start= Blender.Get('staframe') - action_end= Blender.Get('endframe') - else: - _frames = blend_action.getFrameNumbers() - action_start= min(_frames); - action_end= max(_frames); - del _frames - - blender_armature.action = blend_action - - if PREF_BAKE_MOTION: - # We need to set the action active if we are getting baked data - pose_data = BPyArmature.getBakedPoseData(blender_armature, action_start, action_end) - - # Fake, all we need is bone names - blend_action_ipos_items = [(pbone, True) for pbone in POSEBONES.iterkeys()] - else: - # real (bone_name, ipo) pairs - blend_action_ipos_items = blend_action.getAllChannelIpos().items() - - # Now we mau have some bones with no channels, easiest to add their names and an empty list here - # this way they are exported with dummy keyfraames at teh first used frame - action_bone_names = [name for name, ipo in blend_action_ipos_items] - for bone_name in BONES: # iterkeys - if bone_name not in action_bone_names: - blend_action_ipos_items.append( (bone_name, []) ) - - animation = Cal3DAnimation(animation_name) - # ---------------------------- - ANIMATIONS.append(animation) - animation.duration = 0.0 - - for bone_name, ipo in blend_action_ipos_items: - # Baked bones may have no IPO's width motion still - if bone_name not in BONES: - print '\tNo Bone "' + bone_name + '" in (from Animation "' + animation_name + '") ?!?' - continue - - # So we can loop without errors - if ipo==None: ipo = [] - - bone = BONES[bone_name] - track = animation.tracks[bone_name] = Cal3DTrack(bone) - - if PREF_BAKE_MOTION: - for i in xrange(action_end - action_start): - cal3dtime = i / 25.0 # assume 25FPS by default - - if cal3dtime > animation.duration: - animation.duration = cal3dtime - - #print pose_data[i][bone_name], i - loc, quat = pose_data[i][bone_name] - - loc = vector_by_matrix_3x3(loc, bone.matrix) - loc = vector_add(bone.loc, loc) - quat = quaternion_multiply(quat, bone.quat) - quat = Quaternion(quat) - - quat.normalize() - quat = tuple(quat) - - track.keyframes.append( Cal3DKeyFrame(cal3dtime, loc, quat) ) - - else: - #run 1: we need to find all time values where we need to produce keyframes - times = set() - for curve in ipo: - curve_name = curve.name - if curve_name in SUPPORTED_IPOS: - for p in curve.bezierPoints: - times.add( p.pt[0] ) - - times = list(times) - times.sort() - - # Incase we have no keys here or ipo==None - if not times: times.append(action_start) - - # run2: now create keyframes - for time in times: - cal3dtime = (time-1) / 25.0 # assume 25FPS by default - if cal3dtime > animation.duration: - animation.duration = cal3dtime - - trans = Vector() - quat = Quaternion() - - for curve in ipo: - val = curve.evaluate(time) - # val = 0.0 - curve_name= curve.name - if curve_name == 'LocX': trans[0] = val - elif curve_name == 'LocY': trans[1] = val - elif curve_name == 'LocZ': trans[2] = val - elif curve_name == 'QuatW': quat[3] = val - elif curve_name == 'QuatX': quat[0] = val - elif curve_name == 'QuatY': quat[1] = val - elif curve_name == 'QuatZ': quat[2] = val - - transt = vector_by_matrix_3x3(trans, bone.matrix) - loc = vector_add(bone.loc, transt) - quat = quaternion_multiply(quat, bone.quat) - quat = Quaternion(quat) - - quat.normalize() - quat = tuple(quat) - - track.keyframes.append( Cal3DKeyFrame(cal3dtime, loc, quat) ) - - - if animation.duration <= 0: - print 'Ignoring Animation "' + animation_name + '": duration is 0.\n' - continue - - # Restore the original armature - blender_armature.action = backup_action - # ------------------------------------- End Animation - - - - cfg = open((filename), 'wb') - cfg.write('# Cal3D model exported from Blender with export_cal3d.py\n# from %s\n' % Blender.Get('filename')) - - if PREF_SCALE != 1.0: cfg.write('scale=%.6f\n' % PREF_SCALE) - - fname = file_only_noext + '.xsf' - file = open( base_only + fname, 'wb') - skeleton.writeCal3D(file) - file.close() - - cfg.write('skeleton=%s\n' % fname) - - for animation in ANIMATIONS: - if not animation.name.startswith('_'): - if animation.duration > 0.1: # Cal3D does not support animation with only one state - fname = new_name(animation.name, '.xaf') - file = open(base_only + fname, 'wb') - animation.writeCal3D(file) - file.close() - cfg.write('animation=%s\n' % fname) - - for mesh in meshes: - if not mesh.name.startswith('_'): - fname = new_name(mesh.name, '.xmf') - file = open(base_only + fname, 'wb') - mesh.writeCal3D(file) - file.close() - - cfg.write('mesh=%s\n' % fname) - - materials = MATERIALS.values() - materials.sort(key = lambda a: a.id) - for material in materials: - # Just number materials, its less trouble - fname = new_name(str(material.id), '.xrf') - - file = open(base_only + fname, 'wb') - material.writeCal3D(file) - file.close() - - cfg.write('material=%s\n' % fname) - - print 'Cal3D Saved to "%s.cfg"' % file_only_noext - - # Warnings - if len(animation.tracks) < 2: - Blender.Draw.PupMenu('Warning, the armature has less then 2 tracks, file may not load in Cal3d') - - -def export_cal3d_ui(filename): - - PREF_SCALE= Blender.Draw.Create(1.0) - PREF_BAKE_MOTION = Blender.Draw.Create(1) - PREF_ACT_ACTION_ONLY= Blender.Draw.Create(1) - PREF_SCENE_FRAMES= Blender.Draw.Create(0) - - block = [\ - ('Scale: ', PREF_SCALE, 0.01, 100, 'The scale to set in the Cal3d .cfg file (unsupported by soya)'),\ - ('Baked Motion', PREF_BAKE_MOTION, 'use final pose position instead of ipo keyframes (IK and constraint support)'),\ - ('Active Action', PREF_ACT_ACTION_ONLY, 'Only export action applied to this armature, else export all actions.'),\ - ('Scene Frames', PREF_SCENE_FRAMES, 'Use scene frame range, else the actions start/end'),\ - ] - - if not Blender.Draw.PupBlock('Cal3D Options', block): - return - - Blender.Window.WaitCursor(1) - export_cal3d(filename, 1.0/PREF_SCALE.val, PREF_BAKE_MOTION.val, PREF_ACT_ACTION_ONLY.val, PREF_SCENE_FRAMES.val) - Blender.Window.WaitCursor(0) - - -#import os -if __name__ == '__main__': - Blender.Window.FileSelector(export_cal3d_ui, 'Cal3D Export', Blender.Get('filename').replace('.blend', '.cfg')) - #export_cal3d('/cally/data/skeleton/skeleton' + '.cfg', 1.0, True, False, False) - #export_cal3d('/test' + '.cfg') - #export_cal3d_ui('/test' + '.cfg') - #os.system('cd /; wine /cal3d_miniviewer.exe /skeleton.cfg') - #os.system('cd /cally/;wine cally') diff --git a/release/scripts/modules/bpy/app.py b/release/scripts/modules/bpy/app.py deleted file mode 100644 index da45ab8eb30..00000000000 --- a/release/scripts/modules/bpy/app.py +++ /dev/null @@ -1,26 +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. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -# constants -import _bpy -version = _bpy._VERSION -version_string = _bpy._VERSION_STR -home = _bpy._HOME -binary_path = _bpy._BINPATH diff --git a/release/scripts/modules/bpy_ops.py b/release/scripts/modules/bpy_ops.py deleted file mode 100644 index 9551429e4c4..00000000000 --- a/release/scripts/modules/bpy_ops.py +++ /dev/null @@ -1,200 +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. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -# for slightly faster access -from bpy.__ops__ import add as op_add -from bpy.__ops__ import remove as op_remove -from bpy.__ops__ import dir as op_dir -from bpy.__ops__ import call as op_call -from bpy.__ops__ import as_string as op_as_string -from bpy.__ops__ import get_rna as op_get_rna - -# Keep in sync with WM_types.h -context_dict = { - 'INVOKE_DEFAULT': 0, - 'INVOKE_REGION_WIN': 1, - 'INVOKE_AREA': 2, - 'INVOKE_SCREEN': 3, - 'EXEC_DEFAULT': 4, - 'EXEC_REGION_WIN': 5, - 'EXEC_AREA': 6, - 'EXEC_SCREEN': 7, -} - - -class bpy_ops(object): - ''' - Fake module like class. - - bpy.ops - ''' - - def __getattr__(self, module): - ''' - gets a bpy.ops submodule - ''' - if module.startswith('__'): - raise AttributeError(module) - return bpy_ops_submodule(module) - - def add(self, pyop): - op_add(pyop) - - def remove(self, pyop): - op_remove(pyop) - - def __dir__(self): - - submodules = set() - - # add this classes functions - for id_name in dir(self.__class__): - if not id_name.startswith('__'): - submodules.add(id_name) - - for id_name in op_dir(): - id_split = id_name.split('_OT_', 1) - - if len(id_split) == 2: - submodules.add(id_split[0].lower()) - else: - submodules.add(id_split[0]) - - return list(submodules) - - def __repr__(self): - return "" - - -class bpy_ops_submodule(object): - ''' - Utility class to fake submodules. - - eg. bpy.ops.object - ''' - __keys__ = ('module',) - - def __init__(self, module): - self.module = module - - def __getattr__(self, func): - ''' - gets a bpy.ops.submodule function - ''' - if func.startswith('__'): - raise AttributeError(func) - return bpy_ops_submodule_op(self.module, func) - - def __dir__(self): - - functions = set() - - module_upper = self.module.upper() - - for id_name in op_dir(): - id_split = id_name.split('_OT_', 1) - if len(id_split) == 2 and module_upper == id_split[0]: - functions.add(id_split[1]) - - return list(functions) - - def __repr__(self): - return "" % self.module - - -class bpy_ops_submodule_op(object): - ''' - Utility class to fake submodule operators. - - eg. bpy.ops.object.somefunc - ''' - - __keys__ = ('module', 'func') - - - def _get_doc(self): - return op_as_string(self.idname()) - - __doc__ = property(_get_doc) - - - def _get_doc(self): - return op_as_string(self.idname()) - - __doc__ = property(_get_doc) - - def __init__(self, module, func): - self.module = module - self.func = func - - def idname(self): - # submod.foo -> SUBMOD_OT_foo - return self.module.upper() + '_OT_' + self.func - - def __call__(self, *args, **kw): - - # Get the operator from blender - if len(args) > 2: - raise ValueError("1 or 2 args execution context is supported") - - C_dict = None - - if args: - - C_exec = 'EXEC_DEFAULT' - - if len(args) == 2: - C_exec = args[0] - C_dict = args[1] - else: - if type(args[0]) != str: - C_dict = args[0] - else: - C_exec = args[0] - - try: - context = context_dict[C_exec] - except: - raise ValueError("Expected a single context argument in: " + \ - str(list(context_dict.keys()))) - - if len(args) == 2: - C_dict = args[1] - - return op_call(self.idname(), C_dict, kw, context) - - else: - return op_call(self.idname(), C_dict, kw) - - def get_rna(self): - ''' - currently only used for 'bl_rna' - ''' - return op_get_rna(self.idname()) - - def __repr__(self): # useful display, repr(op) - return op_as_string(self.idname()) - - def __str__(self): # used for print(...) - return "" % \ - (self.module, self.func, id(self)) - -import bpy -bpy.ops = bpy_ops() diff --git a/release/scripts/modules/dynamic_menu.py b/release/scripts/modules/dynamic_menu.py deleted file mode 100644 index 84960a29e7f..00000000000 --- a/release/scripts/modules/dynamic_menu.py +++ /dev/null @@ -1,111 +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. -# -# ##### END GPL LICENSE BLOCK ##### - -import bpy - -def collect_baseclasses(_class, bases): - - if _class is type or _class is object: - return bases - - bases.append(_class) - for _superclass in _class.__bases__: - collect_baseclasses(_superclass, bases) - - return bases - -def collect_subclasses(_class, subs): - - if _class is type or _class is object: - return subs - - subs.append(_class) - for _subclass in _class.__subclasses__(): - collect_subclasses(_subclass, subs) - - return subs - -class DynMenu(bpy.types.Menu): - - def draw(self, context): - ''' - This is a draw function that is used to call all subclasses draw functions - starting from the registered classes draw function and working down. - - DynMenu.setup() must be called first. - - Sort/group classes could be nice - ''' - - subclass_ls = [] - collect_subclasses(self.__class__, subclass_ls) - # print(subclass_ls) - - for subclass in subclass_ls: - # print("drawwing", subclass) # , dir(subclass)) - subclass.internal_draw(self, context) - # print("subclass.internal_draw", subclass.internal_draw) - -def setup(menu_class): - ''' - Setup subclasses (not needed when self.add() is used) - ''' - bases = collect_baseclasses(menu_class, []) - - # Incase 'DynMenu' isnt last - while bases[-1] is not DynMenu: - bases.pop() - bases.pop() # remove 'DynMenu' - - root_class = bases[-1] # this is the registered class - - for subclass in collect_subclasses(root_class, []): - #print(subclass) - - draw = getattr(subclass, 'draw', None) - if draw and not hasattr(subclass, 'internal_draw'): - # print("replace", subclass, draw) - try: - del subclass.draw - except: - pass - subclass.internal_draw = draw - - root_class.draw = DynMenu.draw - -def add(menu_class, func): - ''' - Add a single function directly without having to make a class - - important that the returned value should be stored in the module that called it. - ''' - - newclass = type('', (menu_class,), {}) - newclass.internal_draw = func - setup(menu_class) - return newclass - -''' -# so we dont need to import this module -DynMenu.setup = setup -DynMenu.add = add - -# Only so we can access as bpy.types. -# dont ever use this directly! -bpy.types.register(DynMenu) -''' diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py deleted file mode 100644 index db4f90f05d1..00000000000 --- a/release/scripts/op/add_mesh_torus.py +++ /dev/null @@ -1,154 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# -import bpy -import mathutils -from math import cos, sin, pi - - -def add_torus(major_rad, minor_rad, major_seg, minor_seg): - Vector = mathutils.Vector - Quaternion = mathutils.Quaternion - - PI_2 = pi * 2.0 - z_axis = 0.0, 0.0, 1.0 - - verts = [] - faces = [] - i1 = 0 - tot_verts = major_seg * minor_seg - for major_index in range(major_seg): - quat = Quaternion(z_axis, (major_index / major_seg) * PI_2) - - for minor_index in range(minor_seg): - angle = 2 * pi * minor_index / minor_seg - - vec = Vector((major_rad + (cos(angle) * minor_rad), 0.0, - (sin(angle) * minor_rad))) * quat - - verts.extend(vec[:]) - - if minor_index + 1 == minor_seg: - i2 = (major_index) * minor_seg - i3 = i1 + minor_seg - i4 = i2 + minor_seg - - else: - i2 = i1 + 1 - i3 = i1 + minor_seg - i4 = i3 + 1 - - if i2 >= tot_verts: - i2 = i2 - tot_verts - if i3 >= tot_verts: - i3 = i3 - tot_verts - if i4 >= tot_verts: - i4 = i4 - tot_verts - - # stupid eekadoodle - if i2: - faces.extend([i1, i3, i4, i2]) - else: - faces.extend([i2, i1, i3, i4]) - - i1 += 1 - - return verts, faces - -from bpy.props import * - - -class AddTorus(bpy.types.Operator): - '''Add a torus mesh''' - bl_idname = "mesh.primitive_torus_add" - bl_label = "Add Torus" - bl_options = {'REGISTER', 'UNDO'} - - major_radius = FloatProperty(name="Major Radius", - description="Radius from the origin to the center of the cross sections", - default=1.0, min=0.01, max=100.0) - minor_radius = FloatProperty(name="Minor Radius", - description="Radius of the torus' cross section", - default=0.25, min=0.01, max=100.0) - major_segments = IntProperty(name="Major Segments", - description="Number of segments for the main ring of the torus", - default=48, min=3, max=256) - minor_segments = IntProperty(name="Minor Segments", - description="Number of segments for the minor ring of the torus", - default=12, min=3, max=256) - use_abso = BoolProperty(name="Use Int+Ext Controls", - description="Use the Int / Ext controls for torus dimensions", - default=False) - abso_major_rad = FloatProperty(name="Exterior Radius", - description="Total Exterior Radius of the torus", - default=1.0, min=0.01, max=100.0) - abso_minor_rad = FloatProperty(name="Inside Radius", - description="Total Interior Radius of the torus", - default=0.5, min=0.01, max=100.0) - - # generic transform props - view_align = BoolProperty(name="Align to View", - default=False) - location = FloatVectorProperty(name="Location", - subtype='TRANSLATION') - rotation = FloatVectorProperty(name="Rotation", - subtype='EULER') - - def execute(self, context): - - if self.use_abso == True: - extra_helper = (self.abso_major_rad - self.abso_minor_rad) * 0.5 - self.major_radius = self.abso_minor_rad + extra_helper - self.minor_radius = extra_helper - - verts_loc, faces = add_torus(self.major_radius, - self.minor_radius, - self.major_segments, - self.minor_segments) - - mesh = bpy.data.meshes.new("Torus") - - mesh.vertices.add(len(verts_loc) // 3) - mesh.faces.add(len(faces) // 4) - - mesh.vertices.foreach_set("co", verts_loc) - mesh.faces.foreach_set("vertices_raw", faces) - mesh.update() - - import add_object_utils - add_object_utils.object_data_add(context, mesh, operator=self) - - return {'FINISHED'} - - -def menu_func(self, context): - self.layout.operator(AddTorus.bl_idname, text="Torus", icon='MESH_TORUS') - - -def register(): - bpy.utils.register_class(AddTorus) - bpy.types.INFO_MT_mesh_add.append(menu_func) - - -def unregister(): - bpy.utils.unregister_class(AddTorus) - bpy.types.INFO_MT_mesh_add.remove(menu_func) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/animsys_update.py b/release/scripts/op/animsys_update.py deleted file mode 100644 index 9262ff40a37..00000000000 --- a/release/scripts/op/animsys_update.py +++ /dev/null @@ -1,708 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -data_path_update = [ - ("ClothCollisionSettings", "min_distance", "distance_min"), - ("ClothCollisionSettings", "self_min_distance", "self_distance_min"), - ("ClothCollisionSettings", "enable_collision", "use_collision"), - ("ClothCollisionSettings", "enable_self_collision", "use_self_collision"), - ("ClothSettings", "pin_cloth", "use_pin_cloth"), - ("ClothSettings", "stiffness_scaling", "use_stiffness_scale"), - ("CollisionSettings", "random_damping", "damping_random"), - ("CollisionSettings", "random_friction", "friction_random"), - ("CollisionSettings", "inner_thickness", "thickness_inner"), - ("CollisionSettings", "outer_thickness", "thickness_outer"), - ("CollisionSettings", "kill_particles", "use_particle_kill"), - ("Constraint", "proxy_local", "is_proxy_local"), - ("ActionConstraint", "maximum", "max"), - ("ActionConstraint", "minimum", "min"), - ("FollowPathConstraint", "use_fixed_position", "use_fixed_location"), - ("KinematicConstraint", "chain_length", "chain_count"), - ("KinematicConstraint", "pos_lock_x", "lock_location_x"), - ("KinematicConstraint", "pos_lock_y", "lock_location_y"), - ("KinematicConstraint", "pos_lock_z", "lock_location_z"), - ("KinematicConstraint", "rot_lock_x", "lock_rotation_x"), - ("KinematicConstraint", "rot_lock_y", "lock_rotation_y"), - ("KinematicConstraint", "rot_lock_z", "lock_rotation_z"), - ("KinematicConstraint", "axis_reference", "reference_axis"), - ("KinematicConstraint", "use_position", "use_location"), - ("LimitLocationConstraint", "maximum_x", "max_x"), - ("LimitLocationConstraint", "maximum_y", "max_y"), - ("LimitLocationConstraint", "maximum_z", "max_z"), - ("LimitLocationConstraint", "minimum_x", "min_x"), - ("LimitLocationConstraint", "minimum_y", "min_y"), - ("LimitLocationConstraint", "minimum_z", "min_z"), - ("LimitLocationConstraint", "use_maximum_x", "use_max_x"), - ("LimitLocationConstraint", "use_maximum_y", "use_max_y"), - ("LimitLocationConstraint", "use_maximum_z", "use_max_z"), - ("LimitLocationConstraint", "use_minimum_x", "use_min_x"), - ("LimitLocationConstraint", "use_minimum_y", "use_min_y"), - ("LimitLocationConstraint", "use_minimum_z", "use_min_z"), - ("LimitLocationConstraint", "limit_transform", "use_transform_limit"), - ("LimitRotationConstraint", "maximum_x", "max_x"), - ("LimitRotationConstraint", "maximum_y", "max_y"), - ("LimitRotationConstraint", "maximum_z", "max_z"), - ("LimitRotationConstraint", "minimum_x", "min_x"), - ("LimitRotationConstraint", "minimum_y", "min_y"), - ("LimitRotationConstraint", "minimum_z", "min_z"), - ("LimitRotationConstraint", "limit_transform", "use_transform_limit"), - ("LimitScaleConstraint", "maximum_x", "max_x"), - ("LimitScaleConstraint", "maximum_y", "max_y"), - ("LimitScaleConstraint", "maximum_z", "max_z"), - ("LimitScaleConstraint", "minimum_x", "min_x"), - ("LimitScaleConstraint", "minimum_y", "min_y"), - ("LimitScaleConstraint", "minimum_z", "min_z"), - ("LimitScaleConstraint", "use_maximum_x", "use_max_x"), - ("LimitScaleConstraint", "use_maximum_y", "use_max_y"), - ("LimitScaleConstraint", "use_maximum_z", "use_max_z"), - ("LimitScaleConstraint", "use_minimum_x", "use_min_x"), - ("LimitScaleConstraint", "use_minimum_y", "use_min_y"), - ("LimitScaleConstraint", "use_minimum_z", "use_min_z"), - ("LimitScaleConstraint", "limit_transform", "use_transform_limit"), - ("PivotConstraint", "enabled_rotation_range", "rotation_range"), - ("PivotConstraint", "use_relative_position", "use_relative_location"), - ("PythonConstraint", "number_of_targets", "target_count"), - ("SplineIKConstraint", "chain_length", "chain_count"), - ("SplineIKConstraint", "chain_offset", "use_chain_offset"), - ("SplineIKConstraint", "even_divisions", "use_even_divisions"), - ("SplineIKConstraint", "y_stretch", "use_y_stretch"), - ("SplineIKConstraint", "xz_scaling_mode", "xz_scale_mode"), - ("StretchToConstraint", "original_length", "rest_length"), - ("TrackToConstraint", "target_z", "use_target_z"), - ("TransformConstraint", "extrapolate_motion", "use_motion_extrapolate"), - ("FieldSettings", "do_location", "apply_to_location"), - ("FieldSettings", "do_rotation", "apply_to_rotation"), - ("FieldSettings", "maximum_distance", "distance_max"), - ("FieldSettings", "minimum_distance", "distance_min"), - ("FieldSettings", "radial_maximum", "radial_max"), - ("FieldSettings", "radial_minimum", "radial_min"), - ("FieldSettings", "force_2d", "use_2d_force"), - ("FieldSettings", "do_absorption", "use_absorption"), - ("FieldSettings", "global_coordinates", "use_global_coords"), - ("FieldSettings", "guide_path_add", "use_guide_path_add"), - ("FieldSettings", "multiple_springs", "use_multiple_springs"), - ("FieldSettings", "use_coordinates", "use_object_coords"), - ("FieldSettings", "root_coordinates", "use_root_coords"), - ("ControlFluidSettings", "reverse_frames", "use_reverse_frames"), - ("DomainFluidSettings", "real_world_size", "simulation_scale"), - ("DomainFluidSettings", "surface_smoothing", "surface_smooth"), - ("DomainFluidSettings", "reverse_frames", "use_reverse_frames"), - ("DomainFluidSettings", "generate_speed_vectors", "use_speed_vectors"), - ("DomainFluidSettings", "override_time", "use_time_override"), - ("FluidFluidSettings", "export_animated_mesh", "use_animated_mesh"), - ("InflowFluidSettings", "export_animated_mesh", "use_animated_mesh"), - ("InflowFluidSettings", "local_coordinates", "use_local_coords"), - ("ObstacleFluidSettings", "export_animated_mesh", "use_animated_mesh"), - ("OutflowFluidSettings", "export_animated_mesh", "use_animated_mesh"), - ("ParticleFluidSettings", "drops", "use_drops"), - ("ParticleFluidSettings", "floats", "use_floats"), - ("Armature", "drawtype", "draw_type"), - ("Armature", "layer_protection", "layers_protected"), - ("Armature", "auto_ik", "use_auto_ik"), - ("Armature", "delay_deform", "use_deform_delay"), - ("Armature", "deform_envelope", "use_deform_envelopes"), - ("Armature", "deform_quaternion", "use_deform_preserve_volume"), - ("Armature", "deform_vertexgroups", "use_deform_vertex_groups"), - ("Armature", "x_axis_mirror", "use_mirror_x"), - ("Curve", "width", "offset"), - ("Image", "animation_speed", "fps"), - ("Image", "animation_end", "frame_end"), - ("Image", "animation_start", "frame_start"), - ("Image", "animated", "use_animation"), - ("Image", "clamp_x", "use_clamp_x"), - ("Image", "clamp_y", "use_clamp_y"), - ("Image", "premultiply", "use_premultiply"), - ("AreaLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"), - ("AreaLamp", "only_shadow", "use_only_shadow"), - ("AreaLamp", "shadow_layer", "use_shadow_layer"), - ("AreaLamp", "umbra", "use_umbra"), - ("PointLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"), - ("PointLamp", "only_shadow", "use_only_shadow"), - ("PointLamp", "shadow_layer", "use_shadow_layer"), - ("PointLamp", "sphere", "use_sphere"), - ("SpotLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"), - ("SpotLamp", "auto_clip_end", "use_auto_clip_end"), - ("SpotLamp", "auto_clip_start", "use_auto_clip_start"), - ("SpotLamp", "only_shadow", "use_only_shadow"), - ("SpotLamp", "shadow_layer", "use_shadow_layer"), - ("SpotLamp", "sphere", "use_sphere"), - ("SunLamp", "only_shadow", "use_only_shadow"), - ("SunLamp", "shadow_layer", "use_shadow_layer"), - ("Material", "z_offset", "offset_z"), - ("Material", "shadow_casting_alpha", "shadow_cast_alpha"), - ("Material", "cast_approximate", "use_cast_approximate"), - ("Material", "cast_buffer_shadows", "use_cast_buffer_shadows"), - ("Material", "cast_shadows_only", "use_cast_shadows_only"), - ("Material", "face_texture", "use_face_texture"), - ("Material", "face_texture_alpha", "use_face_texture_alpha"), - ("Material", "full_oversampling", "use_full_oversampling"), - ("Material", "light_group_exclusive", "use_light_group_exclusive"), - ("Material", "object_color", "use_object_color"), - ("Material", "only_shadow", "use_only_shadow"), - ("Material", "ray_shadow_bias", "use_ray_shadow_bias"), - ("Material", "traceable", "use_raytrace"), - ("Material", "shadeless", "use_shadeless"), - ("Material", "tangent_shading", "use_tangent_shading"), - ("Material", "transparency", "use_transparency"), - ("Material", "receive_transparent_shadows", "use_transparent_shadows"), - ("Material", "vertex_color_light", "use_vertex_color_light"), - ("Material", "vertex_color_paint", "use_vertex_color_paint"), - ("Mesh", "autosmooth_angle", "auto_smooth_angle"), - ("Mesh", "autosmooth", "use_auto_smooth"), - ("Object", "max_draw_type", "draw_type"), - ("Object", "use_dupli_verts_rotation", "use_dupli_vertices_rotation"), - ("Object", "shape_key_edit_mode", "use_shape_key_edit_mode"), - ("Object", "slow_parent", "use_slow_parent"), - ("Object", "time_offset_add_parent", "use_time_offset_add_parent"), - ("Object", "time_offset_edit", "use_time_offset_edit"), - ("Object", "time_offset_parent", "use_time_offset_parent"), - ("Object", "time_offset_particle", "use_time_offset_particle"), - ("ParticleSettings", "adaptive_pix", "adaptive_pixel"), - ("ParticleSettings", "child_effector", "apply_effector_to_children"), - ("ParticleSettings", "child_guide", "apply_guide_to_children"), - ("ParticleSettings", "billboard_split_offset", "billboard_offset_split"), - ("ParticleSettings", "billboard_random_tilt", "billboard_tilt_random"), - ("ParticleSettings", "child_length_thres", "child_length_threshold"), - ("ParticleSettings", "child_random_size", "child_size_random"), - ("ParticleSettings", "clumppow", "clump_shape"), - ("ParticleSettings", "damp_factor", "damping"), - ("ParticleSettings", "draw_as", "draw_method"), - ("ParticleSettings", "random_factor", "factor_random"), - ("ParticleSettings", "grid_invert", "invert_grid"), - ("ParticleSettings", "random_length", "length_random"), - ("ParticleSettings", "random_lifetime", "lifetime_random"), - ("ParticleSettings", "billboard_lock", "lock_billboard"), - ("ParticleSettings", "boids_2d", "lock_boids_to_surface"), - ("ParticleSettings", "object_aligned_factor", "object_align_factor"), - ("ParticleSettings", "random_phase_factor", "phase_factor_random"), - ("ParticleSettings", "ren_as", "render_type"), - ("ParticleSettings", "rendered_child_nbr", "rendered_child_count"), - ("ParticleSettings", "random_rotation_factor", "rotation_factor_random"), - ("ParticleSettings", "rough1", "roughness_1"), - ("ParticleSettings", "rough1_size", "roughness_1_size"), - ("ParticleSettings", "rough2", "roughness_2"), - ("ParticleSettings", "rough2_size", "roughness_2_size"), - ("ParticleSettings", "rough2_thres", "roughness_2_threshold"), - ("ParticleSettings", "rough_end_shape", "roughness_end_shape"), - ("ParticleSettings", "rough_endpoint", "roughness_endpoint"), - ("ParticleSettings", "random_size", "size_random"), - ("ParticleSettings", "abs_path_time", "use_absolute_path_time"), - ("ParticleSettings", "animate_branching", "use_animate_branching"), - ("ParticleSettings", "branching", "use_branching"), - ("ParticleSettings", "died", "use_dead"), - ("ParticleSettings", "die_on_collision", "use_die_on_collision"), - ("ParticleSettings", "rotation_dynamic", "use_dynamic_rotation"), - ("ParticleSettings", "even_distribution", "use_even_distribution"), - ("ParticleSettings", "rand_group", "use_group_pick_random"), - ("ParticleSettings", "hair_bspline", "use_hair_bspline"), - ("ParticleSettings", "sizemass", "use_multiply_size_mass"), - ("ParticleSettings", "react_multiple", "use_react_multiple"), - ("ParticleSettings", "react_start_end", "use_react_start_end"), - ("ParticleSettings", "render_adaptive", "use_render_adaptive"), - ("ParticleSettings", "self_effect", "use_self_effect"), - ("ParticleSettings", "enable_simplify", "use_simplify"), - ("ParticleSettings", "size_deflect", "use_size_deflect"), - ("ParticleSettings", "render_strand", "use_strand_primitive"), - ("ParticleSettings", "symmetric_branching", "use_symmetric_branching"), - ("ParticleSettings", "velocity_length", "use_velocity_length"), - ("ParticleSettings", "whole_group", "use_whole_group"), - ("CloudsTexture", "noise_size", "noise_scale"), - ("DistortedNoiseTexture", "noise_size", "noise_scale"), - ("EnvironmentMapTexture", "filter_size_minimum", "use_filter_size_min"), - ("EnvironmentMapTexture", "mipmap_gauss", "use_mipmap_gauss"), - ("ImageTexture", "calculate_alpha", "use_calculate_alpha"), - ("ImageTexture", "checker_even", "use_checker_even"), - ("ImageTexture", "checker_odd", "use_checker_odd"), - ("ImageTexture", "filter_size_minimum", "use_filter_size_min"), - ("ImageTexture", "flip_axis", "use_flip_axis"), - ("ImageTexture", "mipmap_gauss", "use_mipmap_gauss"), - ("ImageTexture", "mirror_x", "use_mirror_x"), - ("ImageTexture", "mirror_y", "use_mirror_y"), - ("ImageTexture", "normal_map", "use_normal_map"), - ("MarbleTexture", "noise_size", "noise_scale"), - ("MarbleTexture", "noisebasis2", "noisebasis_2"), - ("MusgraveTexture", "highest_dimension", "dimension_max"), - ("MusgraveTexture", "noise_size", "noise_scale"), - ("StucciTexture", "noise_size", "noise_scale"), - ("VoronoiTexture", "coloring", "color_mode"), - ("VoronoiTexture", "noise_size", "noise_scale"), - ("WoodTexture", "noise_size", "noise_scale"), - ("WoodTexture", "noisebasis2", "noisebasis_2"), - ("World", "blend_sky", "use_sky_blend"), - ("World", "paper_sky", "use_sky_paper"), - ("World", "real_sky", "use_sky_real"), - ("ImageUser", "auto_refresh", "use_auto_refresh"), - ("MaterialHalo", "flares_sub", "flare_subflare_count"), - ("MaterialHalo", "flare_subsize", "flare_subflare_size"), - ("MaterialHalo", "line_number", "line_count"), - ("MaterialHalo", "rings", "ring_count"), - ("MaterialHalo", "star_tips", "star_tip_count"), - ("MaterialHalo", "xalpha", "use_extreme_alpha"), - ("MaterialHalo", "flare_mode", "use_flare_mode"), - ("MaterialHalo", "vertex_normal", "use_vertex_normal"), - ("MaterialPhysics", "align_to_normal", "use_normal_align"), - ("MaterialStrand", "min_size", "size_min"), - ("MaterialStrand", "blender_units", "use_blender_units"), - ("MaterialStrand", "surface_diffuse", "use_surface_diffuse"), - ("MaterialStrand", "tangent_shading", "use_tangent_shading"), - ("MaterialSubsurfaceScattering", "error_tolerance", "error_threshold"), - ("MaterialVolume", "depth_cutoff", "depth_threshold"), - ("MaterialVolume", "lighting_mode", "light_method"), - ("MaterialVolume", "step_calculation", "step_method"), - ("MaterialVolume", "external_shadows", "use_external_shadows"), - ("MaterialVolume", "light_cache", "use_light_cache"), - ("ArmatureModifier", "multi_modifier", "use_multi_modifier"), - ("ArrayModifier", "constant_offset_displacement", "constant_offset_displace"), - ("ArrayModifier", "merge_distance", "merge_threshold"), - ("ArrayModifier", "relative_offset_displacement", "relative_offset_displace"), - ("ArrayModifier", "constant_offset", "use_constant_offset"), - ("ArrayModifier", "merge_adjacent_vertices", "use_merge_vertices"), - ("ArrayModifier", "merge_end_vertices", "use_merge_vertices_cap"), - ("ArrayModifier", "add_offset_object", "use_object_offset"), - ("ArrayModifier", "relative_offset", "use_relative_offset"), - ("BevelModifier", "only_vertices", "use_only_vertices"), - ("CastModifier", "from_radius", "use_radius_as_size"), - ("DisplaceModifier", "midlevel", "mid_level"), - ("DisplaceModifier", "texture_coordinates", "texture_coords"), - ("EdgeSplitModifier", "use_sharp", "use_edge_sharp"), - ("ExplodeModifier", "split_edges", "use_edge_split"), - ("MirrorModifier", "merge_limit", "merge_threshold"), - ("MirrorModifier", "mirror_u", "use_mirror_u"), - ("MirrorModifier", "mirror_v", "use_mirror_v"), - ("MirrorModifier", "mirror_vertex_groups", "use_mirror_vertex_groups"), - ("ParticleInstanceModifier", "particle_system_number", "particle_system_index"), - ("ParticleInstanceModifier", "keep_shape", "use_preserve_shape"), - ("ShrinkwrapModifier", "cull_back_faces", "use_cull_back_faces"), - ("ShrinkwrapModifier", "cull_front_faces", "use_cull_front_faces"), - ("ShrinkwrapModifier", "keep_above_surface", "use_keep_above_surface"), - ("SimpleDeformModifier", "lock_x_axis", "lock_x"), - ("SimpleDeformModifier", "lock_y_axis", "lock_y"), - ("SmokeModifier", "smoke_type", "type"), - ("SubsurfModifier", "subsurf_uv", "use_subsurf_uv"), - ("UVProjectModifier", "num_projectors", "projector_count"), - ("UVProjectModifier", "override_image", "use_image_override"), - ("WaveModifier", "texture_coordinates", "texture_coords"), - ("WaveModifier", "x_normal", "use_normal_x"), - ("WaveModifier", "y_normal", "use_normal_y"), - ("WaveModifier", "z_normal", "use_normal_z"), - ("NlaStrip", "blending", "blend_type"), - ("NlaStrip", "animated_influence", "use_animated_influence"), - ("NlaStrip", "animated_time", "use_animated_time"), - ("NlaStrip", "animated_time_cyclic", "use_animated_time_cyclic"), - ("NlaStrip", "auto_blending", "use_auto_blend"), - ("CompositorNodeAlphaOver", "convert_premul", "use_premultiply"), - ("CompositorNodeBlur", "sizex", "size_x"), - ("CompositorNodeBlur", "sizey", "size_y"), - ("CompositorNodeChannelMatte", "algorithm", "limit_method"), - ("CompositorNodeChromaMatte", "acceptance", "tolerance"), - ("CompositorNodeColorBalance", "correction_formula", "correction_method"), - ("CompositorNodeColorSpill", "algorithm", "limit_method"), - ("CompositorNodeColorSpill", "unspill", "use_unspill"), - ("CompositorNodeCrop", "x2", "max_x"), - ("CompositorNodeCrop", "y2", "max_y"), - ("CompositorNodeCrop", "x1", "min_x"), - ("CompositorNodeCrop", "y1", "min_y"), - ("CompositorNodeCrop", "crop_size", "use_crop_size"), - ("CompositorNodeDefocus", "max_blur", "blur_max"), - ("CompositorNodeDefocus", "gamma_correction", "use_gamma_correction"), - ("CompositorNodeGlare", "rotate_45", "use_rotate_45"), - ("CompositorNodeImage", "auto_refresh", "use_auto_refresh"), - ("CompositorNodeLensdist", "projector", "use_projector"), - ("CompositorNodeVecBlur", "max_speed", "speed_max"), - ("CompositorNodeVecBlur", "min_speed", "speed_min"), - ("ShaderNodeMapping", "maximum", "max"), - ("ShaderNodeMapping", "minimum", "min"), - ("ShaderNodeMapping", "clamp_maximum", "use_max"), - ("ShaderNodeMapping", "clamp_minimum", "use_min"), - ("VertexPaint", "all_faces", "use_all_faces"), - ("VertexPaint", "spray", "use_spray"), - ("ParticleEdit", "add_keys", "default_key_count"), - ("ParticleEdit", "selection_mode", "select_mode"), - ("ParticleEdit", "auto_velocity", "use_auto_velocity"), - ("ParticleEdit", "add_interpolate", "use_default_interpolate"), - ("ParticleEdit", "emitter_deflect", "use_emitter_deflect"), - ("ParticleEdit", "fade_time", "use_fade_time"), - ("ParticleEdit", "keep_lengths", "use_preserve_length"), - ("ParticleEdit", "keep_root", "use_preserve_root"), - ("ParticleSystem", "vertex_group_clump_negate", "invert_vertex_group_clump"), - ("ParticleSystem", "vertex_group_density_negate", "invert_vertex_group_density"), - ("ParticleSystem", "vertex_group_field_negate", "invert_vertex_group_field"), - ("ParticleSystem", "vertex_group_kink_negate", "invert_vertex_group_kink"), - ("ParticleSystem", "vertex_group_length_negate", "invert_vertex_group_length"), - ("ParticleSystem", "vertex_group_rotation_negate", "invert_vertex_group_rotation"), - ("ParticleSystem", "vertex_group_roughness1_negate", "invert_vertex_group_roughness_1"), - ("ParticleSystem", "vertex_group_roughness2_negate", "invert_vertex_group_roughness_2"), - ("ParticleSystem", "vertex_group_roughness_end_negate", "invert_vertex_group_roughness_end"), - ("ParticleSystem", "vertex_group_size_negate", "invert_vertex_group_size"), - ("ParticleSystem", "vertex_group_tangent_negate", "invert_vertex_group_tangent"), - ("ParticleSystem", "vertex_group_velocity_negate", "invert_vertex_group_velocity"), - ("ParticleSystem", "hair_dynamics", "use_hair_dynamics"), - ("ParticleSystem", "keyed_timing", "use_keyed_timing"), - ("PointDensity", "falloff_softness", "falloff_soft"), - ("PointDensity", "particle_cache", "particle_cache_space"), - ("PointDensity", "turbulence_size", "turbulence_scale"), - ("PointDensity", "turbulence", "use_turbulence"), - ("PointDensity", "vertices_cache", "vertex_cache_space"), - ("PoseBone", "ik_lin_weight", "ik_linear_weight"), - ("PoseBone", "ik_rot_weight", "ik_rotation_weight"), - ("PoseBone", "ik_limit_x", "use_ik_limit_x"), - ("PoseBone", "ik_limit_y", "use_ik_limit_y"), - ("PoseBone", "ik_limit_z", "use_ik_limit_z"), - ("PoseBone", "ik_lin_control", "use_ik_linear_control"), - ("PoseBone", "ik_rot_control", "use_ik_rotation_control"), - ("Bone", "use_hinge", "use_inherit_rotation"), - ("SPHFluidSettings", "spring_k", "spring_force"), - ("SPHFluidSettings", "stiffness_k", "stiffness"), - ("SPHFluidSettings", "stiffness_knear", "stiffness_near"), - ("SceneGameData", "framing_color", "frame_color"), - ("SceneGameData", "framing_type", "frame_type"), - ("SceneGameData", "eye_separation", "stereo_eye_separation"), - ("SceneGameData", "activity_culling", "use_activity_culling"), - ("SceneGameData", "auto_start", "use_auto_start"), - ("SceneGameData", "glsl_extra_textures", "use_glsl_extra_textures"), - ("SceneGameData", "glsl_lights", "use_glsl_lights"), - ("SceneGameData", "glsl_nodes", "use_glsl_nodes"), - ("SceneGameData", "glsl_ramps", "use_glsl_ramps"), - ("SceneGameData", "glsl_shaders", "use_glsl_shaders"), - ("SceneGameData", "glsl_shadows", "use_glsl_shadows"), - ("Sequence", "blend_opacity", "blend_alpha"), - ("Sequence", "blend_mode", "blend_type"), - ("Sequence", "frame_final_length", "frame_final_duration"), - ("Sequence", "use_effect_default_fade", "use_default_fade"), - ("SequenceColorBalance", "inverse_gain", "invert_gain"), - ("SequenceColorBalance", "inverse_gamma", "invert_gamma"), - ("SequenceColorBalance", "inverse_lift", "invert_lift"), - ("EffectSequence", "multiply_colors", "color_multiply"), - ("EffectSequence", "de_interlace", "use_deinterlace"), - ("EffectSequence", "flip_x", "use_flip_x"), - ("EffectSequence", "flip_y", "use_flip_y"), - ("EffectSequence", "convert_float", "use_float"), - ("EffectSequence", "premultiply", "use_premultiply"), - ("EffectSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("EffectSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("EffectSequence", "reverse_frames", "use_reverse_frames"), - ("GlowSequence", "blur_distance", "blur_radius"), - ("GlowSequence", "only_boost", "use_only_boost"), - ("SpeedControlSequence", "curve_compress_y", "use_curve_compress_y"), - ("SpeedControlSequence", "curve_velocity", "use_curve_velocity"), - ("SpeedControlSequence", "frame_blending", "use_frame_blend"), - ("TransformSequence", "uniform_scale", "use_uniform_scale"), - ("ImageSequence", "animation_end_offset", "animation_offset_end"), - ("ImageSequence", "animation_start_offset", "animation_offset_start"), - ("ImageSequence", "multiply_colors", "color_multiply"), - ("ImageSequence", "de_interlace", "use_deinterlace"), - ("ImageSequence", "flip_x", "use_flip_x"), - ("ImageSequence", "flip_y", "use_flip_y"), - ("ImageSequence", "convert_float", "use_float"), - ("ImageSequence", "premultiply", "use_premultiply"), - ("ImageSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("ImageSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("ImageSequence", "reverse_frames", "use_reverse_frames"), - ("MetaSequence", "animation_end_offset", "animation_offset_end"), - ("MetaSequence", "animation_start_offset", "animation_offset_start"), - ("MetaSequence", "multiply_colors", "color_multiply"), - ("MetaSequence", "de_interlace", "use_deinterlace"), - ("MetaSequence", "flip_x", "use_flip_x"), - ("MetaSequence", "flip_y", "use_flip_y"), - ("MetaSequence", "convert_float", "use_float"), - ("MetaSequence", "premultiply", "use_premultiply"), - ("MetaSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("MetaSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("MetaSequence", "reverse_frames", "use_reverse_frames"), - ("MovieSequence", "animation_end_offset", "animation_offset_end"), - ("MovieSequence", "animation_start_offset", "animation_offset_start"), - ("MovieSequence", "multiply_colors", "color_multiply"), - ("MovieSequence", "de_interlace", "use_deinterlace"), - ("MovieSequence", "flip_x", "use_flip_x"), - ("MovieSequence", "flip_y", "use_flip_y"), - ("MovieSequence", "convert_float", "use_float"), - ("MovieSequence", "premultiply", "use_premultiply"), - ("MovieSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("MovieSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("MovieSequence", "reverse_frames", "use_reverse_frames"), - ("MulticamSequence", "animation_end_offset", "animation_offset_end"), - ("MulticamSequence", "animation_start_offset", "animation_offset_start"), - ("MulticamSequence", "multiply_colors", "color_multiply"), - ("MulticamSequence", "de_interlace", "use_deinterlace"), - ("MulticamSequence", "flip_x", "use_flip_x"), - ("MulticamSequence", "flip_y", "use_flip_y"), - ("MulticamSequence", "convert_float", "use_float"), - ("MulticamSequence", "premultiply", "use_premultiply"), - ("MulticamSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("MulticamSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("MulticamSequence", "reverse_frames", "use_reverse_frames"), - ("SceneSequence", "animation_end_offset", "animation_offset_end"), - ("SceneSequence", "animation_start_offset", "animation_offset_start"), - ("SceneSequence", "multiply_colors", "color_multiply"), - ("SceneSequence", "de_interlace", "use_deinterlace"), - ("SceneSequence", "flip_x", "use_flip_x"), - ("SceneSequence", "flip_y", "use_flip_y"), - ("SceneSequence", "convert_float", "use_float"), - ("SceneSequence", "premultiply", "use_premultiply"), - ("SceneSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("SceneSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("SceneSequence", "reverse_frames", "use_reverse_frames"), - ("SoundSequence", "animation_end_offset", "animation_offset_end"), - ("SoundSequence", "animation_start_offset", "animation_offset_start"), - ("SmokeDomainSettings", "smoke_domain_colli", "collision_extents"), - ("SmokeDomainSettings", "smoke_cache_high_comp", "point_cache_compress_high_type"), - ("SmokeDomainSettings", "smoke_cache_comp", "point_cache_compress_type"), - ("SmokeDomainSettings", "maxres", "resolution_max"), - ("SmokeDomainSettings", "smoothemitter", "smooth_emitter"), - ("SmokeDomainSettings", "dissolve_smoke", "use_dissolve_smoke"), - ("SmokeDomainSettings", "dissolve_smoke_log", "use_dissolve_smoke_log"), - ("SmokeDomainSettings", "highres", "use_high_resolution"), - ("SoftBodySettings", "bending", "bend"), - ("SoftBodySettings", "error_limit", "error_threshold"), - ("SoftBodySettings", "lcom", "location_mass_center"), - ("SoftBodySettings", "lrot", "rotation_estimate"), - ("SoftBodySettings", "lscale", "scale_estimate"), - ("SoftBodySettings", "maxstep", "step_max"), - ("SoftBodySettings", "minstep", "step_min"), - ("SoftBodySettings", "diagnose", "use_diagnose"), - ("SoftBodySettings", "edge_collision", "use_edge_collision"), - ("SoftBodySettings", "estimate_matrix", "use_estimate_matrix"), - ("SoftBodySettings", "face_collision", "use_face_collision"), - ("SoftBodySettings", "self_collision", "use_self_collision"), - ("SoftBodySettings", "stiff_quads", "use_stiff_quads"), - ("TexMapping", "maximum", "max"), - ("TexMapping", "minimum", "min"), - ("TexMapping", "has_maximum", "use_max"), - ("TexMapping", "has_minimum", "use_min"), - ("TextCharacterFormat", "bold", "use_bold"), - ("TextCharacterFormat", "italic", "use_italic"), - ("TextCharacterFormat", "underline", "use_underline"), - ("TextureSlot", "rgb_to_intensity", "use_rgb_to_intensity"), - ("TextureSlot", "stencil", "use_stencil"), - ("LampTextureSlot", "texture_coordinates", "texture_coords"), - ("LampTextureSlot", "map_color", "use_map_color"), - ("LampTextureSlot", "map_shadow", "use_map_shadow"), - ("MaterialTextureSlot", "coloremission_factor", "color_emission_factor"), - ("MaterialTextureSlot", "colordiff_factor", "diffuse_color_factor"), - ("MaterialTextureSlot", "x_mapping", "mapping_x"), - ("MaterialTextureSlot", "y_mapping", "mapping_y"), - ("MaterialTextureSlot", "z_mapping", "mapping_z"), - ("MaterialTextureSlot", "colorreflection_factor", "reflection_color_factor"), - ("MaterialTextureSlot", "colorspec_factor", "specular_color_factor"), - ("MaterialTextureSlot", "texture_coordinates", "texture_coords"), - ("MaterialTextureSlot", "colortransmission_factor", "transmission_color_factor"), - ("MaterialTextureSlot", "from_dupli", "use_from_dupli"), - ("MaterialTextureSlot", "from_original", "use_from_original"), - ("MaterialTextureSlot", "map_alpha", "use_map_alpha"), - ("MaterialTextureSlot", "map_ambient", "use_map_ambient"), - ("MaterialTextureSlot", "map_colordiff", "use_map_color_diff"), - ("MaterialTextureSlot", "map_coloremission", "use_map_color_emission"), - ("MaterialTextureSlot", "map_colorreflection", "use_map_color_reflection"), - ("MaterialTextureSlot", "map_colorspec", "use_map_color_spec"), - ("MaterialTextureSlot", "map_colortransmission", "use_map_color_transmission"), - ("MaterialTextureSlot", "map_density", "use_map_density"), - ("MaterialTextureSlot", "map_diffuse", "use_map_diffuse"), - ("MaterialTextureSlot", "map_displacement", "use_map_displacement"), - ("MaterialTextureSlot", "map_emission", "use_map_emission"), - ("MaterialTextureSlot", "map_emit", "use_map_emit"), - ("MaterialTextureSlot", "map_hardness", "use_map_hardness"), - ("MaterialTextureSlot", "map_mirror", "use_map_mirror"), - ("MaterialTextureSlot", "map_normal", "use_map_normal"), - ("MaterialTextureSlot", "map_raymir", "use_map_raymir"), - ("MaterialTextureSlot", "map_reflection", "use_map_reflect"), - ("MaterialTextureSlot", "map_scattering", "use_map_scatter"), - ("MaterialTextureSlot", "map_specular", "use_map_specular"), - ("MaterialTextureSlot", "map_translucency", "use_map_translucency"), - ("MaterialTextureSlot", "map_warp", "use_map_warp"), - ("WorldTextureSlot", "texture_coordinates", "texture_coords"), - ("WorldTextureSlot", "map_blend", "use_map_blend"), - ("WorldTextureSlot", "map_horizon", "use_map_horizon"), - ("WorldTextureSlot", "map_zenith_down", "use_map_zenith_down"), - ("WorldTextureSlot", "map_zenith_up", "use_map_zenith_up"), - ("VoxelData", "still_frame_number", "still_frame"), - ("WorldLighting", "ao_blend_mode", "ao_blend_type"), - ("WorldLighting", "error_tolerance", "error_threshold"), - ("WorldLighting", "use_ambient_occlusion", "use_ambient_occlusian"), - ("WorldLighting", "pixel_cache", "use_cache"), - ("WorldLighting", "use_environment_lighting", "use_environment_light"), - ("WorldLighting", "use_indirect_lighting", "use_indirect_light"), - ("WorldStarsSettings", "color_randomization", "color_random"), - ("WorldStarsSettings", "min_distance", "distance_min"), - ("WorldLighting", "falloff", "use_falloff"), - ("Constraint", "disabled", "is_valid"), - ("ClampToConstraint", "cyclic", "use_cyclic"), - ("ImageTexture", "filter", "filter_type"), - ("ImageTexture", "interpolation", "use_interpolation"), - ("ImageTexture", "mipmap", "use_mipmap"), - ("ImageUser", "frames", "frame_duration"), - ("ImageUser", "offset", "frame_offset"), - ("ImageUser", "cyclic", "use_cyclic"), - ("ArmatureModifier", "invert", "invert_vertex_group"), - ("ArmatureModifier", "quaternion", "use_deform_preserve_volume"), - ("ArrayModifier", "length", "fit_length"), - ("BevelModifier", "angle", "angle_limit"), - ("BuildModifier", "length", "frame_duration"), - ("BuildModifier", "randomize", "use_random_order"), - ("CastModifier", "x", "use_x"), - ("CastModifier", "y", "use_y"), - ("CastModifier", "z", "use_z"), - ("ExplodeModifier", "size", "use_size"), - ("MaskModifier", "invert", "invert_vertex_group"), - ("MeshDeformModifier", "invert", "invert_vertex_group"), - ("MeshDeformModifier", "dynamic", "use_dynamic_bind"), - ("MirrorModifier", "clip", "use_clip"), - ("MirrorModifier", "x", "use_x"), - ("MirrorModifier", "y", "use_y"), - ("MirrorModifier", "z", "use_z"), - ("ParticleInstanceModifier", "children", "use_children"), - ("ParticleInstanceModifier", "normal", "use_normal"), - ("ParticleInstanceModifier", "size", "use_size"), - ("ShrinkwrapModifier", "negative", "use_negative_direction"), - ("ShrinkwrapModifier", "positive", "use_positive_direction"), - ("ShrinkwrapModifier", "x", "use_project_x"), - ("ShrinkwrapModifier", "y", "use_project_y"), - ("ShrinkwrapModifier", "z", "use_project_z"), - ("ShrinkwrapModifier", "mode", "wrap_method"), - ("SimpleDeformModifier", "mode", "deform_method"), - ("SimpleDeformModifier", "relative", "use_relative"), - ("SmoothModifier", "repeat", "iterations"), - ("SmoothModifier", "x", "use_x"), - ("SmoothModifier", "y", "use_y"), - ("SmoothModifier", "z", "use_z"), - ("SolidifyModifier", "invert", "invert_vertex_group"), - ("WaveModifier", "cyclic", "use_cyclic"), - ("WaveModifier", "normals", "use_normal"), - ("WaveModifier", "x", "use_x"), - ("WaveModifier", "y", "use_y"), - ("DampedTrackConstraint", "track", "track_axis"), - ("FloorConstraint", "sticky", "use_sticky"), - ("FollowPathConstraint", "forward", "forward_axis"), - ("FollowPathConstraint", "up", "up_axis"), - ("LockedTrackConstraint", "lock", "lock_axis"), - ("LockedTrackConstraint", "track", "track_axis"), - ("MaintainVolumeConstraint", "axis", "free_axis"), - ("TrackToConstraint", "track", "track_axis"), - ("TrackToConstraint", "up", "up_axis"), - ("GameProperty", "debug", "show_debug"), - ("Image", "tiles", "use_tiles"), - ("Lamp", "diffuse", "use_diffuse"), - ("Lamp", "negative", "use_negative"), - ("Lamp", "layer", "use_own_layer"), - ("Lamp", "specular", "use_specular"), - ("AreaLamp", "dither", "use_dither"), - ("AreaLamp", "jitter", "use_jitter"), - ("SpotLamp", "square", "use_square"), - ("Material", "cubic", "use_cubic"), - ("Material", "shadows", "use_shadows"), - ("ParticleSettings", "amount", "count"), - ("ParticleSettings", "display", "draw_percentage"), - ("ParticleSettings", "velocity", "show_velocity"), - ("ParticleSettings", "trand", "use_emit_random"), - ("ParticleSettings", "parent", "use_parent_particles"), - ("ParticleSettings", "emitter", "use_render_emitter"), - ("ParticleSettings", "viewport", "use_simplify_viewport"), - ("Texture", "brightness", "intensity"), - ("CloudsTexture", "stype", "cloud_type"), - ("EnvironmentMapTexture", "filter", "filter_type"), - ("EnvironmentMapTexture", "mipmap", "use_mipmap"), - ("MarbleTexture", "stype", "marble_type"), - ("StucciTexture", "stype", "stucci_type"), - ("WoodTexture", "stype", "wood_type"), - ("World", "range", "color_range"), - ("World", "lighting", "light_settings"), - ("World", "mist", "mist_settings"), - ("World", "stars", "star_settings"), - ("MaterialHalo", "lines", "use_lines"), - ("MaterialHalo", "ring", "use_ring"), - ("MaterialHalo", "soft", "use_soft"), - ("MaterialHalo", "star", "use_star"), - ("MaterialHalo", "texture", "use_texture"), - ("MaterialPhysics", "damp", "damping"), - ("MaterialRaytraceTransparency", "limit", "depth_max"), - ("NlaStrip", "reversed", "use_reverse"), - ("CompositorNodeBlur", "bokeh", "use_bokeh"), - ("CompositorNodeBlur", "gamma", "use_gamma_correction"), - ("CompositorNodeBlur", "relative", "use_relative"), - ("CompositorNodeChannelMatte", "high", "limit_max"), - ("CompositorNodeChannelMatte", "low", "limit_min"), - ("CompositorNodeChannelMatte", "channel", "matte_channel"), - ("CompositorNodeChromaMatte", "cutoff", "threshold"), - ("CompositorNodeColorMatte", "h", "color_hue"), - ("CompositorNodeColorMatte", "s", "color_saturation"), - ("CompositorNodeColorMatte", "v", "color_value"), - ("CompositorNodeDBlur", "wrap", "use_wrap"), - ("CompositorNodeDefocus", "preview", "use_preview"), - ("CompositorNodeHueSat", "hue", "color_hue"), - ("CompositorNodeHueSat", "sat", "color_saturation"), - ("CompositorNodeHueSat", "val", "color_value"), - ("CompositorNodeImage", "frames", "frame_duration"), - ("CompositorNodeImage", "offset", "frame_offset"), - ("CompositorNodeImage", "start", "frame_start"), - ("CompositorNodeImage", "cyclic", "use_cyclic"), - ("CompositorNodeInvert", "alpha", "invert_alpha"), - ("CompositorNodeInvert", "rgb", "invert_rgb"), - ("CompositorNodeLensdist", "fit", "use_fit"), - ("CompositorNodeLensdist", "jitter", "use_jitter"), - ("CompositorNodeMixRGB", "alpha", "use_alpha"), - ("CompositorNodeRotate", "filter", "filter_type"), - ("CompositorNodeTime", "end", "frame_end"), - ("CompositorNodeTime", "start", "frame_start"), - ("CompositorNodeVecBlur", "curved", "use_curved"), - ("ShaderNodeExtendedMaterial", "diffuse", "use_diffuse"), - ("ShaderNodeExtendedMaterial", "specular", "use_specular"), - ("ShaderNodeMaterial", "diffuse", "use_diffuse"), - ("ShaderNodeMaterial", "specular", "use_specular"), - ("ShaderNodeMixRGB", "alpha", "use_alpha"), - ("TextureNodeCurveTime", "end", "frame_end"), - ("TextureNodeCurveTime", "start", "frame_start"), - ("TextureNodeMixRGB", "alpha", "use_alpha"), - ("TextureSlot", "negate", "invert"), - ("TextureSlot", "size", "scale"), - ("SoftBodySettings", "damp", "damping"), - ("SequenceCrop", "right", "max_x"), - ("SequenceCrop", "top", "max_y"), - ("SequenceCrop", "bottom", "min_x"), - ("SequenceCrop", "left", "min_y"), - ("Sequence", "speed_fader", "speed_factor"), - ("SpeedControlSequence", "global_speed", "multiply_speed"), - ("SpeedControlSequence", "use_curve_velocity", "use_as_speed"), - ("SpeedControlSequence", "use_curve_compress_y", "scale_to_length"), - ] - - -import bpy - - -class UpdateAnimData(bpy.types.Operator): - '''Update data paths from 2.53 to edited data paths of drivers and fcurves''' - bl_idname = "anim.update_data_paths" - bl_label = "Update Animation Data" - - def execute(self, context): - import animsys_refactor - animsys_refactor.update_data_paths(data_path_update) - return {'FINISHED'} - - -if __name__ == "__main__": - bpy.ops.anim.update_data_paths() - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py deleted file mode 100644 index dc2a0a7713c..00000000000 --- a/release/scripts/op/console_python.py +++ /dev/null @@ -1,294 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# -import sys -import bpy - -language_id = 'python' - -# store our own __main__ module, not 100% needed -# but python expects this in some places -_BPY_MAIN_OWN = True - - -def add_scrollback(text, text_type): - for l in text.split('\n'): - bpy.ops.console.scrollback_append(text=l.replace('\t', ' '), - type=text_type) - - -def get_console(console_id): - ''' - helper function for console operators - currently each text datablock gets its own - console - code.InteractiveConsole() - ...which is stored in this function. - - console_id can be any hashable type - ''' - from code import InteractiveConsole - - consoles = getattr(get_console, "consoles", None) - hash_next = hash(bpy.context.window_manager) - - if consoles is None: - consoles = get_console.consoles = {} - get_console.consoles_namespace_hash = hash_next - else: - # check if clearning the namespace is needed to avoid a memory leak. - # the window manager is normally loaded with new blend files - # so this is a reasonable way to deal with namespace clearing. - # bpy.data hashing is reset by undo so cant be used. - hash_prev = getattr(get_console, "consoles_namespace_hash", 0) - - if hash_prev != hash_next: - get_console.consoles_namespace_hash = hash_next - consoles.clear() - - console_data = consoles.get(console_id) - - if console_data: - console, stdout, stderr = console_data - - # XXX, bug in python 3.1.2 ? (worked in 3.1.1) - # seems there is no way to clear StringIO objects for writing, have to make new ones each time. - import io - stdout = io.StringIO() - stderr = io.StringIO() - else: - if _BPY_MAIN_OWN: - import types - bpy_main_mod = types.ModuleType("__main__") - namespace = bpy_main_mod.__dict__ - else: - namespace = {} - - namespace["__builtins__"] = sys.modules["builtins"] - namespace["bpy"] = bpy - namespace["C"] = bpy.context - - console = InteractiveConsole(locals=namespace, filename="") - - console.push("from mathutils import *") - console.push("from math import *") - - if _BPY_MAIN_OWN: - console._bpy_main_mod = bpy_main_mod - - import io - stdout = io.StringIO() - stderr = io.StringIO() - - consoles[console_id] = console, stdout, stderr - - return console, stdout, stderr - - -# Both prompts must be the same length -PROMPT = '>>> ' -PROMPT_MULTI = '... ' - - -def execute(context): - sc = context.space_data - - try: - line_object = sc.history[-1] - except: - return {'CANCELLED'} - - console, stdout, stderr = get_console(hash(context.region)) - - # redirect output - sys.stdout = stdout - sys.stderr = stderr - - # dont allow the stdin to be used, can lock blender. - stdin_backup = sys.stdin - sys.stdin = None - - if _BPY_MAIN_OWN: - main_mod_back = sys.modules["__main__"] - sys.modules["__main__"] = console._bpy_main_mod - - # incase exception happens - line = "" # incase of encodingf error - is_multiline = False - - try: - line = line_object.body - - # run the console, "\n" executes a multiline statement - line_exec = line if line.strip() else "\n" - - is_multiline = console.push(line_exec) - except: - # unlikely, but this can happen with unicode errors for example. - import traceback - stderr.write(traceback.format_exc()) - - if _BPY_MAIN_OWN: - sys.modules["__main__"] = main_mod_back - - stdout.seek(0) - stderr.seek(0) - - output = stdout.read() - output_err = stderr.read() - - # cleanup - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ - sys.last_traceback = None - - # So we can reuse, clear all data - stdout.truncate(0) - stderr.truncate(0) - - # special exception. its possible the command loaded a new user interface - if hash(sc) != hash(context.space_data): - return - - bpy.ops.console.scrollback_append(text=sc.prompt + line, type='INPUT') - - if is_multiline: - sc.prompt = PROMPT_MULTI - else: - sc.prompt = PROMPT - - # insert a new blank line - bpy.ops.console.history_append(text="", current_character=0, - remove_duplicates=True) - - # Insert the output into the editor - # not quite correct because the order might have changed, - # but ok 99% of the time. - if output: - add_scrollback(output, 'OUTPUT') - if output_err: - add_scrollback(output_err, 'ERROR') - - # restore the stdin - sys.stdin = stdin_backup - - # execute any hooks - for func, args in execute.hooks: - func(*args) - - return {'FINISHED'} - -execute.hooks = [] - - -def autocomplete(context): - from console import intellisense - - sc = context.space_data - - console = get_console(hash(context.region))[0] - - if not console: - return {'CANCELLED'} - - # dont allow the stdin to be used, can lock blender. - # note: unlikely stdin would be used for autocomp. but its possible. - stdin_backup = sys.stdin - sys.stdin = None - - scrollback = "" - scrollback_error = "" - - if _BPY_MAIN_OWN: - main_mod_back = sys.modules["__main__"] - sys.modules["__main__"] = console._bpy_main_mod - - try: - current_line = sc.history[-1] - line = current_line.body - - # This function isnt aware of the text editor or being an operator - # just does the autocomp then copy its results back - current_line.body, current_line.current_character, scrollback = \ - intellisense.expand( - line=current_line.body, - cursor=current_line.current_character, - namespace=console.locals, - private=bpy.app.debug) - except: - # unlikely, but this can happen with unicode errors for example. - # or if the api attribute access its self causes an error. - import traceback - scrollback_error = traceback.format_exc() - - if _BPY_MAIN_OWN: - sys.modules["__main__"] = main_mod_back - - # Separate automplete output by command prompts - if scrollback != '': - bpy.ops.console.scrollback_append(text=sc.prompt + current_line.body, type='INPUT') - - # Now we need to copy back the line from blender back into the - # text editor. This will change when we dont use the text editor - # anymore - if scrollback: - add_scrollback(scrollback, 'INFO') - - if scrollback_error: - add_scrollback(scrollback_error, 'ERROR') - - # restore the stdin - sys.stdin = stdin_backup - - context.area.tag_redraw() - - return {'FINISHED'} - - -def banner(context): - sc = context.space_data - version_string = sys.version.strip().replace('\n', ' ') - - add_scrollback("PYTHON INTERACTIVE CONSOLE %s" % version_string, 'OUTPUT') - add_scrollback("", 'OUTPUT') - add_scrollback("Command History: Up/Down Arrow", 'OUTPUT') - add_scrollback("Cursor: Left/Right Home/End", 'OUTPUT') - add_scrollback("Remove: Backspace/Delete", 'OUTPUT') - add_scrollback("Execute: Enter", 'OUTPUT') - add_scrollback("Autocomplete: Ctrl+Space", 'OUTPUT') - add_scrollback("Ctrl +/- Wheel: Zoom", 'OUTPUT') - add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bgl, blf, mathutils", 'OUTPUT') - add_scrollback("Convenience Imports: from mathutils import *; from math import *", 'OUTPUT') - add_scrollback("", 'OUTPUT') - add_scrollback(" WARNING!!! Blender 2.5 API is subject to change, see API reference for more info.", 'ERROR') - add_scrollback("", 'OUTPUT') - sc.prompt = PROMPT - - return {'FINISHED'} - - -def register(): - pass - - -def unregister(): - pass - - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/fcurve_euler_filter.py b/release/scripts/op/fcurve_euler_filter.py deleted file mode 100644 index b7d456dd525..00000000000 --- a/release/scripts/op/fcurve_euler_filter.py +++ /dev/null @@ -1,90 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -from math import * -import bpy -from mathutils import * - - -def main(context): - def cleanupEulCurve(fcv): - keys = [] - - for k in fcv.keyframe_points: - keys.append([k.handle_left.copy(), k.co.copy(), k.handle_right.copy()]) - print(keys) - - for i in range(len(keys)): - cur = keys[i] - prev = keys[i - 1] if i > 0 else None - next = keys[i + 1] if i < len(keys) - 1 else None - - if prev is None: - continue - - th = pi - if abs(prev[1][1] - cur[1][1]) >= th: # more than 180 degree jump - fac = pi * 2.0 - if prev[1][1] > cur[1][1]: - while abs(cur[1][1] - prev[1][1]) >= th: # < prev[1][1]: - cur[0][1] += fac - cur[1][1] += fac - cur[2][1] += fac - elif prev[1][1] < cur[1][1]: - while abs(cur[1][1] - prev[1][1]) >= th: - cur[0][1] -= fac - cur[1][1] -= fac - cur[2][1] -= fac - - for i in range(len(keys)): - for x in range(2): - fcv.keyframe_points[i].handle_left[x] = keys[i][0][x] - fcv.keyframe_points[i].co[x] = keys[i][1][x] - fcv.keyframe_points[i].handle_right[x] = keys[i][2][x] - - flist = bpy.context.active_object.animation_data.action.fcurves - for f in flist: - if f.select and f.data_path.endswith("rotation_euler"): - cleanupEulCurve(f) - - -class DiscontFilterOp(bpy.types.Operator): - """Fixes the most common causes of gimbal lock in the fcurves of the active bone""" - bl_idname = "graph.euler_filter" - bl_label = "Filter out discontinuities in the active fcurves" - - @classmethod - def poll(cls, context): - return context.active_object != None - - def execute(self, context): - main(context) - return {'FINISHED'} - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py deleted file mode 100644 index e1d471f8254..00000000000 --- a/release/scripts/op/image.py +++ /dev/null @@ -1,205 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy -from bpy.props import StringProperty - - -class EditExternally(bpy.types.Operator): - '''Edit image in an external application''' - bl_idname = "image.external_edit" - bl_label = "Image Edit Externally" - bl_options = {'REGISTER'} - - filepath = StringProperty(name="File Path", description="Path to an image file", maxlen=1024, default="") - - def _editor_guess(self, context): - import platform - try: - system = platform.system() - except UnicodeDecodeError: - import sys - system = sys.platform - - image_editor = context.user_preferences.filepaths.image_editor - - # use image editor in the preferences when available. - if not image_editor: - if system in ('Windows', 'win32'): - image_editor = ["start"] # not tested! - elif system == 'Darwin': - image_editor = ["open"] - else: - image_editor = ["gimp"] - else: - if system == 'Darwin': - # blender file selector treats .app as a folder - # and will include a trailing backslash, so we strip it. - image_editor.rstrip('\\') - image_editor = ["open", "-a", image_editor] - else: - image_editor = [image_editor] - - return image_editor - - def execute(self, context): - import os - import subprocess - filepath = bpy.path.abspath(self.filepath) - - if not os.path.exists(filepath): - self.report('ERROR', "Image path '%s' not found." % filepath) - return {'CANCELLED'} - - cmd = self._editor_guess(context) + [filepath] - - subprocess.Popen(cmd) - - return {'FINISHED'} - - def invoke(self, context, event): - try: - filepath = context.space_data.image.filepath - except: - self.report({'ERROR'}, "Image not found on disk") - return {'CANCELLED'} - - self.filepath = filepath - self.execute(context) - - return {'FINISHED'} - - -class SaveDirty(bpy.types.Operator): - """Save all modified textures""" - bl_idname = "image.save_dirty" - bl_label = "Save Dirty" - bl_options = {'REGISTER', 'UNDO'} - - def execute(self, context): - unique_paths = set() - for image in bpy.data.images: - if image.is_dirty: - filepath = bpy.path.abspath(image.filepath) - if "\\" not in filepath and "/" not in filepath: - self.report({'WARNING'}, "Invalid path: " + filepath) - elif filepath in unique_paths: - self.report({'WARNING'}, "Path used by more then one image: " + filepath) - else: - unique_paths.add(filepath) - image.save() - return {'FINISHED'} - - -class ProjectEdit(bpy.types.Operator): - """Edit a snapshot if the viewport in an external image editor""" - bl_idname = "image.project_edit" - bl_label = "Project Edit" - bl_options = {'REGISTER'} - - _proj_hack = [""] - - def execute(self, context): - import os - import subprocess - - EXT = "png" # could be made an option but for now ok - - for image in bpy.data.images: - image.tag = True - - if 'FINISHED' not in bpy.ops.paint.image_from_view(): - return {'CANCELLED'} - - image_new = None - for image in bpy.data.images: - if not image.tag: - image_new = image - break - - if not image_new: - self.report({'ERROR'}, "Could not make new image") - return {'CANCELLED'} - - filepath = os.path.basename(bpy.data.filepath) - filepath = os.path.splitext(filepath)[0] - # filepath = bpy.path.clean_name(filepath) # fixes rubbish, needs checking - - if filepath.startswith(".") or filepath == "": - # TODO, have a way to check if the file is saved, assume startup.blend - tmpdir = context.user_preferences.filepaths.temporary_directory - filepath = os.path.join(tmpdir, "project_edit") - else: - filepath = "//" + filepath - - obj = context.object - - if obj: - filepath += "_" + bpy.path.clean_name(obj.name) - - filepath_final = filepath + "." + EXT - i = 0 - - while os.path.exists(bpy.path.abspath(filepath_final)): - filepath_final = filepath + ("%.3d.%s" % (i, EXT)) - i += 1 - - image_new.name = os.path.basename(filepath_final) - ProjectEdit._proj_hack[0] = image_new.name - - image_new.filepath_raw = filepath_final # TODO, filepath raw is crummy - image_new.file_format = 'PNG' - image_new.save() - - bpy.ops.image.external_edit(filepath=filepath_final) - - return {'FINISHED'} - - -class ProjectApply(bpy.types.Operator): - """Project edited image back onto the object""" - bl_idname = "image.project_apply" - bl_label = "Project Apply" - bl_options = {'REGISTER'} - - def execute(self, context): - image_name = ProjectEdit._proj_hack[0] # TODO, deal with this nicer - - try: - image = bpy.data.images[image_name] - except KeyError: - self.report({'ERROR'}, "Could not find image '%s'" % image_name) - return {'CANCELLED'} - - image.reload() - bpy.ops.paint.project_image(image=image_name) - - return {'FINISHED'} - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/mesh.py b/release/scripts/op/mesh.py deleted file mode 100644 index 4906fd7fc6c..00000000000 --- a/release/scripts/op/mesh.py +++ /dev/null @@ -1,183 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy - - -class MeshSelectInteriorFaces(bpy.types.Operator): - '''Select faces where all edges have more then 2 face users.''' - - bl_idname = "mesh.faces_select_interior" - bl_label = "Select Interior Faces" - bl_options = {'REGISTER', 'UNDO'} - - @classmethod - def poll(cls, context): - ob = context.active_object - return (ob and ob.type == 'MESH') - - def execute(self, context): - ob = context.active_object - context.tool_settings.mesh_select_mode = False, False, True - is_editmode = (ob.mode == 'EDIT') - if is_editmode: - bpy.ops.object.mode_set(mode='OBJECT', toggle=False) - - mesh = ob.data - - face_list = mesh.faces[:] - face_edge_keys = [face.edge_keys for face in face_list] - - edge_face_count = mesh.edge_face_count_dict - - def test_interior(index): - for key in face_edge_keys[index]: - if edge_face_count[key] < 3: - return False - return True - - for index, face in enumerate(face_list): - if(test_interior(index)): - face.select = True - else: - face.select = False - - if is_editmode: - bpy.ops.object.mode_set(mode='EDIT', toggle=False) - return {'FINISHED'} - - -class MeshMirrorUV(bpy.types.Operator): - '''Copy mirror UV coordinates on the X axis based on a mirrored mesh''' - bl_idname = "mesh.faces_miror_uv" - bl_label = "Copy Mirrored UV coords" - bl_options = {'REGISTER', 'UNDO'} - - @classmethod - def poll(cls, context): - ob = context.active_object - return (ob and ob.type == 'MESH') - - def execute(self, context): - DIR = 1 # TODO, make an option - - from mathutils import Vector - - ob = context.active_object - is_editmode = (ob.mode == 'EDIT') - if is_editmode: - bpy.ops.object.mode_set(mode='OBJECT', toggle=False) - - mesh = ob.data - - # mirror lookups - mirror_gt = {} - mirror_lt = {} - - vcos = [v.co.to_tuple(5) for v in mesh.vertices] - - for i, co in enumerate(vcos): - if co[0] > 0.0: - mirror_gt[co] = i - elif co[0] < 0.0: - mirror_lt[co] = i - else: - mirror_gt[co] = i - mirror_lt[co] = i - - #for i, v in enumerate(mesh.vertices): - vmap = {} - for mirror_a, mirror_b in (mirror_gt, mirror_lt), (mirror_lt, mirror_gt): - for co, i in mirror_a.items(): - nco = (-co[0], co[1], co[2]) - j = mirror_b.get(nco) - if j is not None: - vmap[i] = j - - active_uv_layer = None - for lay in mesh.uv_textures: - if lay.active: - active_uv_layer = lay.data - break - - fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer] - fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs] - - # as a list - faces = mesh.faces[:] - - fuvsel = [(False not in uv.select_uv) for uv in active_uv_layer] - fcents = [f.center for f in faces] - - # find mirror faces - mirror_fm = {} - for i, f in enumerate(faces): - verts = f.vertices[:] - verts.sort() - verts = tuple(verts) - mirror_fm[verts] = i - - fmap = {} - for i, f in enumerate(faces): - verts = [vmap.get(j) for j in f.vertices] - if None not in verts: - verts.sort() - j = mirror_fm.get(tuple(verts)) - if j is not None: - fmap[i] = j - - done = [False] * len(faces) - for i, j in fmap.items(): - - if not fuvsel[i] or not fuvsel[j]: - continue - elif DIR == 0 and fcents[i][0] < 0.0: - continue - elif DIR == 1 and fcents[i][0] > 0.0: - continue - - # copy UVs - uv1 = fuvs[i] - uv2 = fuvs_cpy[j] - - # get the correct rotation - v1 = faces[j].vertices[:] - v2 = [vmap[k] for k in faces[i].vertices[:]] - - for k in range(len(uv1)): - k_map = v1.index(v2[k]) - uv1[k].x = - (uv2[k_map].x - 0.5) + 0.5 - uv1[k].y = uv2[k_map].y - - if is_editmode: - bpy.ops.object.mode_set(mode='EDIT', toggle=False) - - return {'FINISHED'} - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/nla.py b/release/scripts/op/nla.py deleted file mode 100644 index 5711fdf12e5..00000000000 --- a/release/scripts/op/nla.py +++ /dev/null @@ -1,185 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy - - -def pose_info(): - from mathutils import Matrix - - info = {} - - obj = bpy.context.object - pose = obj.pose - - pose_items = pose.bones.items() - - for name, pbone in pose_items: - binfo = {} - bone = pbone.bone - - binfo["parent"] = getattr(bone.parent, "name", None) - binfo["bone"] = bone - binfo["pbone"] = pbone - binfo["matrix_local"] = bone.matrix_local.copy() - try: - binfo["matrix_local_inv"] = binfo["matrix_local"].inverted() - except: - binfo["matrix_local_inv"] = Matrix() - - binfo["matrix"] = bone.matrix.copy() - binfo["matrix_pose"] = pbone.matrix.copy() - try: - binfo["matrix_pose_inv"] = binfo["matrix_pose"].inverted() - except: - binfo["matrix_pose_inv"] = Matrix() - - print(binfo["matrix_pose"]) - info[name] = binfo - - for name, pbone in pose_items: - binfo = info[name] - binfo_parent = binfo.get("parent", None) - if binfo_parent: - binfo_parent = info[binfo_parent] - - matrix = binfo["matrix_pose"] - rest_matrix = binfo["matrix_local"] - - if binfo_parent: - matrix = binfo_parent["matrix_pose_inv"] * matrix - rest_matrix = binfo_parent["matrix_local_inv"] * rest_matrix - - matrix = rest_matrix.inverted() * matrix - - binfo["matrix_key"] = matrix.copy() - - return info - - -def bake(frame_start, frame_end, step=1, only_selected=False): - scene = bpy.context.scene - obj = bpy.context.object - pose = obj.pose - - info_ls = [] - - frame_range = range(frame_start, frame_end + 1, step) - - # could spped this up by applying steps here too... - for f in frame_range: - scene.frame_set(f) - - info = pose_info() - info_ls.append(info) - f += 1 - - action = bpy.data.actions.new("Action") - - bpy.context.object.animation_data.action = action - - pose_items = pose.bones.items() - - for name, pbone in pose_items: - if only_selected and not pbone.select: - continue - - for f in frame_range: - matrix = info_ls[int((f - frame_start) / step)][name]["matrix_key"] - - #pbone.location = matrix.to_translation() - #pbone.rotation_quaternion = matrix.to_quaternion() - pbone.matrix_basis = matrix - - pbone.keyframe_insert("location", -1, f, name) - - rotation_mode = pbone.rotation_mode - - if rotation_mode == 'QUATERNION': - pbone.keyframe_insert("rotation_quaternion", -1, f, name) - elif rotation_mode == 'AXIS_ANGLE': - pbone.keyframe_insert("rotation_axis_angle", -1, f, name) - else: # euler, XYZ, ZXY etc - pbone.keyframe_insert("rotation_euler", -1, f, name) - - pbone.keyframe_insert("scale", -1, f, name) - - return action - - -from bpy.props import * - - -class BakeAction(bpy.types.Operator): - '''Bake animation to an Action''' - bl_idname = "nla.bake" - bl_label = "Bake Action" - bl_options = {'REGISTER', 'UNDO'} - - frame_start = IntProperty(name="Start Frame", - description="Start frame for baking", - default=1, min=1, max=300000) - frame_end = IntProperty(name="End Frame", - description="End frame for baking", - default=250, min=1, max=300000) - step = IntProperty(name="Frame Step", - description="Frame Step", - default=1, min=1, max=120) - only_selected = BoolProperty(name="Only Selected", - default=True) - - def execute(self, context): - - action = bake(self.frame_start, self.frame_end, self.step, self.only_selected) - - # basic cleanup, could move elsewhere - for fcu in action.fcurves: - keyframe_points = fcu.keyframe_points - i = 1 - while i < len(fcu.keyframe_points) - 1: - val_prev = keyframe_points[i - 1].co[1] - val_next = keyframe_points[i + 1].co[1] - val = keyframe_points[i].co[1] - - if abs(val - val_prev) + abs(val - val_next) < 0.0001: - keyframe_points.remove(keyframe_points[i]) - else: - i += 1 - - return {'FINISHED'} - - def invoke(self, context, event): - wm = context.window_manager - return wm.invoke_props_dialog(self) - - -#def menu_func(self, context): -# self.layout.operator(BakeAction.bl_idname, text="Bake Armature Action") - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py deleted file mode 100644 index 81ddd4f7c35..00000000000 --- a/release/scripts/op/object.py +++ /dev/null @@ -1,574 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy -from bpy.props import * - - -class SelectPattern(bpy.types.Operator): - '''Select object matching a naming pattern''' - bl_idname = "object.select_pattern" - bl_label = "Select Pattern" - bl_options = {'REGISTER', 'UNDO'} - - pattern = StringProperty(name="Pattern", description="Name filter using '*' and '?' wildcard chars", maxlen=32, default="*") - case_sensitive = BoolProperty(name="Case Sensitive", description="Do a case sensitive compare", default=False) - extend = BoolProperty(name="Extend", description="Extend the existing selection", default=True) - - def execute(self, context): - - import fnmatch - - if self.case_sensitive: - pattern_match = fnmatch.fnmatchcase - else: - pattern_match = lambda a, b: fnmatch.fnmatchcase(a.upper(), b.upper()) - - obj = context.object - if obj and obj.mode == 'POSE': - items = obj.data.bones - elif obj and obj.type == 'ARMATURE' and obj.mode == 'EDIT': - items = obj.data.edit_bones - else: - items = context.visible_objects - - # Can be pose bones or objects - for item in items: - if pattern_match(item.name, self.pattern): - item.select = True - elif not self.extend: - item.select = False - - return {'FINISHED'} - - def invoke(self, context, event): - wm = context.window_manager - return wm.invoke_props_popup(self, event) - - def draw(self, context): - layout = self.layout - - layout.prop(self, "pattern") - row = layout.row() - row.prop(self, "case_sensitive") - row.prop(self, "extend") - - -class SelectCamera(bpy.types.Operator): - '''Select object matching a naming pattern''' - bl_idname = "object.select_camera" - bl_label = "Select Camera" - bl_options = {'REGISTER', 'UNDO'} - - @classmethod - def poll(cls, context): - return context.scene.camera is not None - - def execute(self, context): - scene = context.scene - camera = scene.camera - if camera.name not in scene.objects: - self.report({'WARNING'}, "Active camera is not in this scene") - - context.scene.objects.active = camera - camera.select = True - return {'FINISHED'} - - -class SelectHierarchy(bpy.types.Operator): - '''Select object relative to the active objects position in the hierarchy''' - bl_idname = "object.select_hierarchy" - bl_label = "Select Hierarchy" - bl_options = {'REGISTER', 'UNDO'} - - direction = EnumProperty(items=( - ('PARENT', "Parent", ""), - ('CHILD', "Child", "")), - name="Direction", - description="Direction to select in the hierarchy", - default='PARENT') - - extend = BoolProperty(name="Extend", description="Extend the existing selection", default=False) - - @classmethod - def poll(cls, context): - return context.object - - def execute(self, context): - select_new = [] - act_new = None - - selected_objects = context.selected_objects - obj_act = context.object - - if context.object not in selected_objects: - selected_objects.append(context.object) - - if self.direction == 'PARENT': - for obj in selected_objects: - parent = obj.parent - - if parent: - if obj_act == obj: - act_new = parent - - select_new.append(parent) - - else: - for obj in selected_objects: - select_new.extend(obj.children) - - if select_new: - select_new.sort(key=lambda obj_iter: obj_iter.name) - act_new = select_new[0] - - # dont edit any object settings above this - if select_new: - if not self.extend: - bpy.ops.object.select_all(action='DESELECT') - - for obj in select_new: - obj.select = True - - context.scene.objects.active = act_new - return {'FINISHED'} - - return {'CANCELLED'} - - -class SubdivisionSet(bpy.types.Operator): - '''Sets a Subdivision Surface Level (1-5)''' - - bl_idname = "object.subdivision_set" - bl_label = "Subdivision Set" - bl_options = {'REGISTER', 'UNDO'} - - level = IntProperty(name="Level", - default=1, min=-100, max=100, soft_min=-6, soft_max=6) - - relative = BoolProperty(name="Relative", description="Apply the subsurf level as an offset relative to the current level", default=False) - - @classmethod - def poll(cls, context): - obs = context.selected_editable_objects - return (obs is not None) - - def execute(self, context): - level = self.level - relative = self.relative - - if relative and level == 0: - return {'CANCELLED'} # nothing to do - - def set_object_subd(obj): - for mod in obj.modifiers: - if mod.type == 'MULTIRES': - if not relative: - if level <= mod.total_levels: - if obj.mode == 'SCULPT': - if mod.sculpt_levels != level: - mod.sculpt_levels = level - elif obj.mode == 'OBJECT': - if mod.levels != level: - mod.levels = level - return - else: - if obj.mode == 'SCULPT': - if mod.sculpt_levels + level <= mod.total_levels: - mod.sculpt_levels += level - elif obj.mode == 'OBJECT': - if mod.levels + level <= mod.total_levels: - mod.levels += level - return - - elif mod.type == 'SUBSURF': - if relative: - mod.levels += level - else: - if mod.levels != level: - mod.levels = level - - return - - # add a new modifier - try: - mod = obj.modifiers.new("Subsurf", 'SUBSURF') - mod.levels = level - except: - self.report({'WARNING'}, "Modifiers cannot be added to object: " + obj.name) - - for obj in context.selected_editable_objects: - set_object_subd(obj) - - return {'FINISHED'} - - -class ShapeTransfer(bpy.types.Operator): - '''Copy another selected objects active shape to this one by applying the relative offsets''' - - bl_idname = "object.shape_key_transfer" - bl_label = "Transfer Shape Key" - bl_options = {'REGISTER', 'UNDO'} - - mode = EnumProperty(items=( - ('OFFSET', "Offset", "Apply the relative positional offset"), - ('RELATIVE_FACE', "Relative Face", "Calculate the geometricly relative position (using faces)."), - ('RELATIVE_EDGE', "Relative Edge", "Calculate the geometricly relative position (using edges).")), - name="Transformation Mode", - description="Method to apply relative shape positions to the new shape", - default='OFFSET') - - use_clamp = BoolProperty(name="Clamp Offset", - description="Clamp the transformation to the distance each vertex moves in the original shape.", - default=False) - - def _main(self, ob_act, objects, mode='OFFSET', use_clamp=False): - - def me_nos(verts): - return [v.normal.copy() for v in verts] - - def me_cos(verts): - return [v.co.copy() for v in verts] - - def ob_add_shape(ob, name): - me = ob.data - key = ob.shape_key_add(from_mix=False) - if len(me.shape_keys.keys) == 1: - key.name = "Basis" - key = ob.shape_key_add(from_mix=False) # we need a rest - key.name = name - ob.active_shape_key_index = len(me.shape_keys.keys) - 1 - ob.show_only_shape_key = True - - from mathutils.geometry import barycentric_transform - from mathutils import Vector - - if use_clamp and mode == 'OFFSET': - use_clamp = False - - me = ob_act.data - orig_key_name = ob_act.active_shape_key.name - - orig_shape_coords = me_cos(ob_act.active_shape_key.data) - - orig_normals = me_nos(me.vertices) - # orig_coords = me_cos(me.vertices) # the actual mverts location isnt as relyable as the base shape :S - orig_coords = me_cos(me.shape_keys.keys[0].data) - - for ob_other in objects: - me_other = ob_other.data - if len(me_other.vertices) != len(me.vertices): - self.report({'WARNING'}, "Skipping '%s', vertex count differs" % ob_other.name) - continue - - target_normals = me_nos(me_other.vertices) - if me_other.shape_keys: - target_coords = me_cos(me_other.shape_keys.keys[0].data) - else: - target_coords = me_cos(me_other.vertices) - - ob_add_shape(ob_other, orig_key_name) - - # editing the final coords, only list that stores wrapped coords - target_shape_coords = [v.co for v in ob_other.active_shape_key.data] - - median_coords = [[] for i in range(len(me.vertices))] - - # Method 1, edge - if mode == 'OFFSET': - for i, vert_cos in enumerate(median_coords): - vert_cos.append(target_coords[i] + (orig_shape_coords[i] - orig_coords[i])) - - elif mode == 'RELATIVE_FACE': - for face in me.faces: - i1, i2, i3, i4 = face.vertices_raw - if i4 != 0: - pt = barycentric_transform(orig_shape_coords[i1], - orig_coords[i4], orig_coords[i1], orig_coords[i2], - target_coords[i4], target_coords[i1], target_coords[i2]) - median_coords[i1].append(pt) - - pt = barycentric_transform(orig_shape_coords[i2], - orig_coords[i1], orig_coords[i2], orig_coords[i3], - target_coords[i1], target_coords[i2], target_coords[i3]) - median_coords[i2].append(pt) - - pt = barycentric_transform(orig_shape_coords[i3], - orig_coords[i2], orig_coords[i3], orig_coords[i4], - target_coords[i2], target_coords[i3], target_coords[i4]) - median_coords[i3].append(pt) - - pt = barycentric_transform(orig_shape_coords[i4], - orig_coords[i3], orig_coords[i4], orig_coords[i1], - target_coords[i3], target_coords[i4], target_coords[i1]) - median_coords[i4].append(pt) - - else: - pt = barycentric_transform(orig_shape_coords[i1], - orig_coords[i3], orig_coords[i1], orig_coords[i2], - target_coords[i3], target_coords[i1], target_coords[i2]) - median_coords[i1].append(pt) - - pt = barycentric_transform(orig_shape_coords[i2], - orig_coords[i1], orig_coords[i2], orig_coords[i3], - target_coords[i1], target_coords[i2], target_coords[i3]) - median_coords[i2].append(pt) - - pt = barycentric_transform(orig_shape_coords[i3], - orig_coords[i2], orig_coords[i3], orig_coords[i1], - target_coords[i2], target_coords[i3], target_coords[i1]) - median_coords[i3].append(pt) - - elif mode == 'RELATIVE_EDGE': - for ed in me.edges: - i1, i2 = ed.vertices - v1, v2 = orig_coords[i1], orig_coords[i2] - edge_length = (v1 - v2).length - n1loc = v1 + orig_normals[i1] * edge_length - n2loc = v2 + orig_normals[i2] * edge_length - - # now get the target nloc's - v1_to, v2_to = target_coords[i1], target_coords[i2] - edlen_to = (v1_to - v2_to).length - n1loc_to = v1_to + target_normals[i1] * edlen_to - n2loc_to = v2_to + target_normals[i2] * edlen_to - - pt = barycentric_transform(orig_shape_coords[i1], - v2, v1, n1loc, - v2_to, v1_to, n1loc_to) - median_coords[i1].append(pt) - - pt = barycentric_transform(orig_shape_coords[i2], - v1, v2, n2loc, - v1_to, v2_to, n2loc_to) - median_coords[i2].append(pt) - - # apply the offsets to the new shape - from functools import reduce - VectorAdd = Vector.__add__ - - for i, vert_cos in enumerate(median_coords): - if vert_cos: - co = reduce(VectorAdd, vert_cos) / len(vert_cos) - - if use_clamp: - # clamp to the same movement as the original - # breaks copy between different scaled meshes. - len_from = (orig_shape_coords[i] - orig_coords[i]).length - ofs = co - target_coords[i] - ofs.length = len_from - co = target_coords[i] + ofs - - target_shape_coords[i][:] = co - - return {'FINISHED'} - - @classmethod - def poll(cls, context): - obj = context.active_object - return (obj and obj.mode != 'EDIT') - - def execute(self, context): - C = bpy.context - ob_act = C.active_object - objects = [ob for ob in C.selected_editable_objects if ob != ob_act] - - if 1: # swap from/to, means we cant copy to many at once. - if len(objects) != 1: - self.report({'ERROR'}, "Expected one other selected mesh object to copy from") - return {'CANCELLED'} - ob_act, objects = objects[0], [ob_act] - - if ob_act.type != 'MESH': - self.report({'ERROR'}, "Other object is not a mesh.") - return {'CANCELLED'} - - if ob_act.active_shape_key is None: - self.report({'ERROR'}, "Other object has no shape key") - return {'CANCELLED'} - return self._main(ob_act, objects, self.mode, self.use_clamp) - - -class JoinUVs(bpy.types.Operator): - '''Copy UV Layout to objects with matching geometry''' - bl_idname = "object.join_uvs" - bl_label = "Join as UVs" - - @classmethod - def poll(cls, context): - obj = context.active_object - return (obj and obj.type == 'MESH') - - def _main(self, context): - import array - obj = context.active_object - mesh = obj.data - - is_editmode = (obj.mode == 'EDIT') - if is_editmode: - bpy.ops.object.mode_set(mode='OBJECT', toggle=False) - - if not mesh.uv_textures: - self.report({'WARNING'}, "Object: %s, Mesh: '%s' has no UVs\n" % (obj.name, mesh.name)) - else: - len_faces = len(mesh.faces) - - uv_array = array.array('f', [0.0] * 8) * len_faces # seems to be the fastest way to create an array - mesh.uv_textures.active.data.foreach_get("uv_raw", uv_array) - - objects = context.selected_editable_objects[:] - - for obj_other in objects: - if obj_other.type == 'MESH': - obj_other.data.tag = False - - for obj_other in objects: - if obj_other != obj and obj_other.type == 'MESH': - mesh_other = obj_other.data - if mesh_other != mesh: - if mesh_other.tag == False: - mesh_other.tag = True - - if len(mesh_other.faces) != len_faces: - self.report({'WARNING'}, "Object: %s, Mesh: '%s' has %d faces, expected %d\n" % (obj_other.name, mesh_other.name, len(mesh_other.faces), len_faces)) - else: - uv_other = mesh_other.uv_textures.active - if not uv_other: - uv_other = mesh_other.uv_textures.new() # should return the texture it adds - - # finally do the copy - uv_other.data.foreach_set("uv_raw", uv_array) - - if is_editmode: - bpy.ops.object.mode_set(mode='EDIT', toggle=False) - - def execute(self, context): - self._main(context) - return {'FINISHED'} - - -class MakeDupliFace(bpy.types.Operator): - '''Make linked objects into dupli-faces''' - bl_idname = "object.make_dupli_face" - bl_label = "Make Dupli-Face" - - @classmethod - def poll(cls, context): - obj = context.active_object - return (obj and obj.type == 'MESH') - - def _main(self, context): - from mathutils import Vector - - SCALE_FAC = 0.01 - offset = 0.5 * SCALE_FAC - base_tri = Vector((-offset, -offset, 0.0)), Vector((offset, -offset, 0.0)), Vector((offset, offset, 0.0)), Vector((-offset, offset, 0.0)) - - def matrix_to_quat(matrix): - # scale = matrix.median_scale - trans = matrix.to_translation() - rot = matrix.to_3x3() # also contains scale - - return [(b * rot) + trans for b in base_tri] - scene = bpy.context.scene - linked = {} - for obj in bpy.context.selected_objects: - data = obj.data - if data: - linked.setdefault(data, []).append(obj) - - for data, objects in linked.items(): - face_verts = [axis for obj in objects for v in matrix_to_quat(obj.matrix_world) for axis in v] - faces = list(range(len(face_verts) // 3)) - - mesh = bpy.data.meshes.new(data.name + "_dupli") - - mesh.vertices.add(len(face_verts) // 3) - mesh.faces.add(len(face_verts) // 12) - - mesh.vertices.foreach_set("co", face_verts) - mesh.faces.foreach_set("vertices_raw", faces) - mesh.update() # generates edge data - - # pick an object to use - obj = objects[0] - - ob_new = bpy.data.objects.new(mesh.name, mesh) - base = scene.objects.link(ob_new) - base.layers[:] = obj.layers - - ob_inst = bpy.data.objects.new(data.name, data) - base = scene.objects.link(ob_inst) - base.layers[:] = obj.layers - - for obj in objects: - scene.objects.unlink(obj) - - ob_new.dupli_type = 'FACES' - ob_inst.parent = ob_new - ob_new.use_dupli_faces_scale = True - ob_new.dupli_faces_scale = 1.0 / SCALE_FAC - - def execute(self, context): - self._main(context) - return {'FINISHED'} - - -class IsolateTypeRender(bpy.types.Operator): - '''Hide unselected render objects of same type as active by setting the hide render flag''' - bl_idname = "object.isolate_type_render" - bl_label = "Restrict Render Unselected" - bl_options = {'REGISTER', 'UNDO'} - - def execute(self, context): - act_type = context.object.type - - for obj in context.visible_objects: - - if obj.select: - obj.hide_render = False - else: - if obj.type == act_type: - obj.hide_render = True - - return {'FINISHED'} - - -class ClearAllRestrictRender(bpy.types.Operator): - '''Reveal all render objects by setting the hide render flag''' - bl_idname = "object.hide_render_clear_all" - bl_label = "Clear All Restrict Render" - bl_options = {'REGISTER', 'UNDO'} - - def execute(self, context): - for obj in context.scene.objects: - obj.hide_render = False - return {'FINISHED'} - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/object_align.py b/release/scripts/op/object_align.py deleted file mode 100644 index d98fe584c1a..00000000000 --- a/release/scripts/op/object_align.py +++ /dev/null @@ -1,300 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy -from mathutils import Vector - - -def align_objects(align_x, align_y, align_z, align_mode, relative_to): - - cursor = bpy.context.scene.cursor_location - - Left_Up_Front_SEL = [0.0, 0.0, 0.0] - Right_Down_Back_SEL = [0.0, 0.0, 0.0] - - flag_first = True - - objs = [] - - for obj in bpy.context.selected_objects: - matrix_world = obj.matrix_world - bb_world = [Vector(v[:]) * matrix_world for v in obj.bound_box] - objs.append((obj, bb_world)) - - if not objs: - return False - - for obj, bb_world in objs: - Left_Up_Front = bb_world[1] - Right_Down_Back = bb_world[7] - - # Active Center - - if obj == bpy.context.active_object: - - center_active_x = (Left_Up_Front[0] + Right_Down_Back[0]) / 2.0 - center_active_y = (Left_Up_Front[1] + Right_Down_Back[1]) / 2.0 - center_active_z = (Left_Up_Front[2] + Right_Down_Back[2]) / 2.0 - - size_active_x = (Right_Down_Back[0] - Left_Up_Front[0]) / 2.0 - size_active_y = (Right_Down_Back[1] - Left_Up_Front[1]) / 2.0 - size_active_z = (Left_Up_Front[2] - Right_Down_Back[2]) / 2.0 - - # Selection Center - - if flag_first: - flag_first = False - - Left_Up_Front_SEL[0] = Left_Up_Front[0] - Left_Up_Front_SEL[1] = Left_Up_Front[1] - Left_Up_Front_SEL[2] = Left_Up_Front[2] - - Right_Down_Back_SEL[0] = Right_Down_Back[0] - Right_Down_Back_SEL[1] = Right_Down_Back[1] - Right_Down_Back_SEL[2] = Right_Down_Back[2] - - else: - # X axis - if Left_Up_Front[0] < Left_Up_Front_SEL[0]: - Left_Up_Front_SEL[0] = Left_Up_Front[0] - # Y axis - if Left_Up_Front[1] < Left_Up_Front_SEL[1]: - Left_Up_Front_SEL[1] = Left_Up_Front[1] - # Z axis - if Left_Up_Front[2] > Left_Up_Front_SEL[2]: - Left_Up_Front_SEL[2] = Left_Up_Front[2] - - # X axis - if Right_Down_Back[0] > Right_Down_Back_SEL[0]: - Right_Down_Back_SEL[0] = Right_Down_Back[0] - # Y axis - if Right_Down_Back[1] > Right_Down_Back_SEL[1]: - Right_Down_Back_SEL[1] = Right_Down_Back[1] - # Z axis - if Right_Down_Back[2] < Right_Down_Back_SEL[2]: - Right_Down_Back_SEL[2] = Right_Down_Back[2] - - center_sel_x = (Left_Up_Front_SEL[0] + Right_Down_Back_SEL[0]) / 2.0 - center_sel_y = (Left_Up_Front_SEL[1] + Right_Down_Back_SEL[1]) / 2.0 - center_sel_z = (Left_Up_Front_SEL[2] + Right_Down_Back_SEL[2]) / 2.0 - - # Main Loop - - for obj, bb_world in objs: - - loc_world = obj.location - bb_world = [Vector(v[:]) * obj.matrix_world for v in obj.bound_box] - - Left_Up_Front = bb_world[1] - Right_Down_Back = bb_world[7] - - center_x = (Left_Up_Front[0] + Right_Down_Back[0]) / 2.0 - center_y = (Left_Up_Front[1] + Right_Down_Back[1]) / 2.0 - center_z = (Left_Up_Front[2] + Right_Down_Back[2]) / 2.0 - - positive_x = Right_Down_Back[0] - positive_y = Right_Down_Back[1] - positive_z = Left_Up_Front[2] - - negative_x = Left_Up_Front[0] - negative_y = Left_Up_Front[1] - negative_z = Right_Down_Back[2] - - obj_loc = obj.location - - if align_x: - - # Align Mode - - if relative_to == 'OPT_4': # Active relative - if align_mode == 'OPT_1': - obj_x = obj_loc[0] - negative_x - size_active_x - - elif align_mode == 'OPT_3': - obj_x = obj_loc[0] - positive_x + size_active_x - - else: # Everything else relative - if align_mode == 'OPT_1': - obj_x = obj_loc[0] - negative_x - - elif align_mode == 'OPT_3': - obj_x = obj_loc[0] - positive_x - - if align_mode == 'OPT_2': # All relative - obj_x = obj_loc[0] - center_x - - # Relative To - - if relative_to == 'OPT_1': - loc_x = obj_x - - elif relative_to == 'OPT_2': - loc_x = obj_x + cursor[0] - - elif relative_to == 'OPT_3': - loc_x = obj_x + center_sel_x - - elif relative_to == 'OPT_4': - loc_x = obj_x + center_active_x - - obj.location[0] = loc_x - - if align_y: - # Align Mode - - if relative_to == 'OPT_4': # Active relative - if align_mode == 'OPT_1': - obj_y = obj_loc[1] - negative_y - size_active_y - - elif align_mode == 'OPT_3': - obj_y = obj_loc[1] - positive_y + size_active_y - - else: # Everything else relative - if align_mode == 'OPT_1': - obj_y = obj_loc[1] - negative_y - - elif align_mode == 'OPT_3': - obj_y = obj_loc[1] - positive_y - - if align_mode == 'OPT_2': # All relative - obj_y = obj_loc[1] - center_y - - # Relative To - - if relative_to == 'OPT_1': - loc_y = obj_y - - elif relative_to == 'OPT_2': - loc_y = obj_y + cursor[1] - - elif relative_to == 'OPT_3': - loc_y = obj_y + center_sel_y - - elif relative_to == 'OPT_4': - loc_y = obj_y + center_active_y - - obj.location[1] = loc_y - - if align_z: - # Align Mode - if relative_to == 'OPT_4': # Active relative - if align_mode == 'OPT_1': - obj_z = obj_loc[2] - negative_z - size_active_z - - elif align_mode == 'OPT_3': - obj_z = obj_loc[2] - positive_z + size_active_z - - else: # Everything else relative - if align_mode == 'OPT_1': - obj_z = obj_loc[2] - negative_z - - elif align_mode == 'OPT_3': - obj_z = obj_loc[2] - positive_z - - if align_mode == 'OPT_2': # All relative - obj_z = obj_loc[2] - center_z - - # Relative To - - if relative_to == 'OPT_1': - loc_z = obj_z - - elif relative_to == 'OPT_2': - loc_z = obj_z + cursor[2] - - elif relative_to == 'OPT_3': - loc_z = obj_z + center_sel_z - - elif relative_to == 'OPT_4': - loc_z = obj_z + center_active_z - - obj.location[2] = loc_z - - return True - - -from bpy.props import * - - -class AlignObjects(bpy.types.Operator): - '''Align Objects''' - bl_idname = "object.align" - bl_label = "Align Objects" - bl_options = {'REGISTER', 'UNDO'} - - align_mode = bpy.props.EnumProperty(items=( - ('OPT_1', "Negative Sides", ""), - ('OPT_2', "Centers", ""), - ('OPT_3', "Positive Sides", "")), - name="Align Mode:", - description="", - default='OPT_2') - - relative_to = bpy.props.EnumProperty(items=( - ('OPT_1', "Scene Origin", ""), - ('OPT_2', "3D Cursor", ""), - ('OPT_3', "Selection", ""), - ('OPT_4', "Active", "")), - name="Relative To:", - description="", - default='OPT_4') - - align_axis = EnumProperty(items=( - ('X', "X", ""), - ('Y', "Y", ""), - ('Z', "Z", ""), - ), - name="Align", - description="Align to axis", - options={'ENUM_FLAG'}) - - @classmethod - def poll(cls, context): - return context.mode == 'OBJECT' - - def execute(self, context): - align_axis = self.align_axis - ret = align_objects('X' in align_axis, 'Y' in align_axis, 'Z' in align_axis, self.align_mode, self.relative_to) - - if not ret: - self.report({'WARNING'}, "No objects with bound-box selected") - return {'CANCELLED'} - else: - return {'FINISHED'} - - -def menu_func(self, context): - if context.mode == 'OBJECT': - self.layout.operator(AlignObjects.bl_idname, - text="Align Objects") - - -def register(): - bpy.utils.register_module(__name__) - bpy.types.VIEW3D_MT_transform.append(menu_func) - - -def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.VIEW3D_MT_transform.remove(menu_func) - - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/object_randomize_transform.py b/release/scripts/op/object_randomize_transform.py deleted file mode 100644 index ee7a5f98b91..00000000000 --- a/release/scripts/op/object_randomize_transform.py +++ /dev/null @@ -1,167 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy - - -def randomize_selected(seed, delta, loc, rot, scale, scale_even): - - import random - from random import uniform - from mathutils import Vector - - random.seed(seed) - - def rand_vec(vec_range): - return Vector(uniform(-val, val) for val in vec_range) - - for obj in bpy.context.selected_objects: - - if loc: - if delta: - obj.delta_location += rand_vec(loc) - else: - obj.location += rand_vec(loc) - else: # otherwise the values change under us - uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0) - - if rot: # TODO, non euler's - vec = rand_vec(rot) - if delta: - obj.delta_rotation_euler[0] += vec[0] - obj.delta_rotation_euler[1] += vec[1] - obj.delta_rotation_euler[2] += vec[2] - else: - obj.rotation_euler[0] += vec[0] - obj.rotation_euler[1] += vec[1] - obj.rotation_euler[2] += vec[2] - else: - uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0) - - if scale: - if delta: - org_sca_x, org_sca_y, org_sca_z = obj.delta_scale - else: - org_sca_x, org_sca_y, org_sca_z = obj.scale - - if scale_even: - sca_x = sca_y = sca_z = uniform(scale[0], - scale[0]) - uniform(0.0, 0.0), uniform(0.0, 0.0) - else: - sca_x, sca_y, sca_z = rand_vec(scale) - - if scale_even: - aX = -(sca_x * org_sca_x) + org_sca_x - aY = -(sca_x * org_sca_y) + org_sca_y - aZ = -(sca_x * org_sca_z) + org_sca_z - else: - aX = sca_x + org_sca_x - aY = sca_y + org_sca_y - aZ = sca_z + org_sca_z - - if delta: - obj.delta_scale = aX, aY, aZ - else: - obj.scale = aX, aY, aZ - else: - uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0) - - -from bpy.props import * - - -class RandomizeLocRotSize(bpy.types.Operator): - '''Randomize objects loc/rot/scale''' - bl_idname = "object.randomize_transform" - bl_label = "Randomize Transform" - bl_options = {'REGISTER', 'UNDO'} - - random_seed = IntProperty(name="Random Seed", - description="Seed value for the random generator", - default=0, min=0, max=1000) - - use_delta = BoolProperty(name="Transform Delta", - description="Randomize delta transform values instead of regular transform", default=False) - - use_loc = BoolProperty(name="Randomize Location", - description="Randomize the location values", default=True) - - loc = FloatVectorProperty(name="Location", - description="Maximun distance the objects can spread over each axis", - default=(0.0, 0.0, 0.0), min=-100.0, max=100.0, subtype='TRANSLATION') - - use_rot = BoolProperty(name="Randomize Rotation", - description="Randomize the rotation values", default=True) - - rot = FloatVectorProperty(name="Rotation", - description="Maximun rotation over each axis", - default=(0.0, 0.0, 0.0), min=-180.0, max=180.0, subtype='TRANSLATION') - - use_scale = BoolProperty(name="Randomize Scale", - description="Randomize the scale values", default=True) - - scale_even = BoolProperty(name="Scale Even", - description="Use the same scale value for all axis", default=False) - - '''scale_min = FloatProperty(name="Minimun Scale Factor", - description="Lowest scale percentage possible", - default=0.15, min=-1.0, max=1.0, precision=3)''' - - scale = FloatVectorProperty(name="Scale", - description="Maximum scale randomization over each axis", - default=(0.0, 0.0, 0.0), min=-100.0, max=100.0, subtype='TRANSLATION') - - def execute(self, context): - from math import radians - - seed = self.random_seed - - delta = self.use_delta - - loc = None if not self.use_loc else self.loc - rot = None if not self.use_rot else self.rot * radians(1.0) - scale = None if not self.use_scale else self.scale - - scale_even = self.scale_even - #scale_min = self.scale_min - - randomize_selected(seed, delta, loc, rot, scale, scale_even) - - return {'FINISHED'} - - -def menu_func(self, context): - if context.mode == 'OBJECT': - self.layout.operator(RandomizeLocRotSize.bl_idname, - text="Randomize Transform") - - -def register(): - bpy.utils.register_module(__name__) - bpy.types.VIEW3D_MT_transform.append(menu_func) - - -def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.VIEW3D_MT_transform.remove(menu_func) - - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py deleted file mode 100644 index 65653aeee3e..00000000000 --- a/release/scripts/op/presets.py +++ /dev/null @@ -1,364 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy -import os - - -class AddPresetBase(): - '''Base preset class, only for subclassing - subclasses must define - - preset_values - - preset_subdir ''' - # bl_idname = "script.preset_base_add" - # bl_label = "Add a Python Preset" - bl_options = {'REGISTER'} # only because invoke_props_popup requires. - - name = bpy.props.StringProperty(name="Name", description="Name of the preset, used to make the path name", maxlen=64, default="") - remove_active = bpy.props.BoolProperty(default=False, options={'HIDDEN'}) - - @staticmethod - def as_filename(name): # could reuse for other presets - for char in " !@#$%^&*(){}:\";'[]<>,.\\/?": - name = name.replace(char, '_') - return name.lower().strip() - - def execute(self, context): - import os - - if hasattr(self, "pre_cb"): - self.pre_cb(context) - - preset_menu_class = getattr(bpy.types, self.preset_menu) - - if not self.remove_active: - - if not self.name: - return {'FINISHED'} - - filename = self.as_filename(self.name) - - target_path = bpy.utils.user_resource('SCRIPTS', os.path.join("presets", self.preset_subdir), create=True) - - if not target_path: - self.report({'WARNING'}, "Failed to create presets path") - return {'CANCELLED'} - - filepath = os.path.join(target_path, filename) + ".py" - - if hasattr(self, "add"): - self.add(context, filepath) - else: - file_preset = open(filepath, 'w') - file_preset.write("import bpy\n") - - if hasattr(self, "preset_defines"): - for rna_path in self.preset_defines: - exec(rna_path) - file_preset.write("%s\n" % rna_path) - file_preset.write("\n") - - for rna_path in self.preset_values: - value = eval(rna_path) - # convert thin wrapped sequences to simple lists to repr() - try: - value = value[:] - except: - pass - - file_preset.write("%s = %r\n" % (rna_path, value)) - - file_preset.close() - - preset_menu_class.bl_label = bpy.path.display_name(filename) - - else: - preset_active = preset_menu_class.bl_label - - # fairly sloppy but convenient. - filepath = bpy.utils.preset_find(preset_active, self.preset_subdir) - - if not filepath: - filepath = bpy.utils.preset_find(preset_active, self.preset_subdir, display_name=True) - - if not filepath: - return {'CANCELLED'} - - if hasattr(self, "remove"): - self.remove(context, filepath) - else: - try: - os.remove(filepath) - except: - import traceback - traceback.print_exc() - - # XXX, stupid! - preset_menu_class.bl_label = "Presets" - - if hasattr(self, "post_cb"): - self.post_cb(context) - - return {'FINISHED'} - - def check(self, context): - self.name = self.as_filename(self.name) - - def invoke(self, context, event): - if not self.remove_active: - wm = context.window_manager - return wm.invoke_props_dialog(self) - else: - return self.execute(context) - - -class ExecutePreset(bpy.types.Operator): - ''' Executes a preset ''' - bl_idname = "script.execute_preset" - bl_label = "Execute a Python Preset" - - filepath = bpy.props.StringProperty(name="Path", description="Path of the Python file to execute", maxlen=512, default="") - menu_idname = bpy.props.StringProperty(name="Menu ID Name", description="ID name of the menu this was called from", default="") - - def execute(self, context): - from os.path import basename - filepath = self.filepath - - # change the menu title to the most recently chosen option - preset_class = getattr(bpy.types, self.menu_idname) - preset_class.bl_label = bpy.path.display_name(basename(filepath)) - - # execute the preset using script.python_file_run - bpy.ops.script.python_file_run(filepath=filepath) - return {'FINISHED'} - - -class AddPresetRender(AddPresetBase, bpy.types.Operator): - '''Add a Render Preset''' - bl_idname = "render.preset_add" - bl_label = "Add Render Preset" - preset_menu = "RENDER_MT_presets" - - preset_defines = [ - "scene = bpy.context.scene" - ] - - preset_values = [ - "scene.render.field_order", - "scene.render.fps", - "scene.render.fps_base", - "scene.render.pixel_aspect_x", - "scene.render.pixel_aspect_y", - "scene.render.resolution_percentage", - "scene.render.resolution_x", - "scene.render.resolution_y", - "scene.render.use_fields", - "scene.render.use_fields_still", - ] - - preset_subdir = "render" - - -class AddPresetSSS(AddPresetBase, bpy.types.Operator): - '''Add a Subsurface Scattering Preset''' - bl_idname = "material.sss_preset_add" - bl_label = "Add SSS Preset" - preset_menu = "MATERIAL_MT_sss_presets" - - preset_defines = [ - "material = (bpy.context.material.active_node_material if bpy.context.material.active_node_material else bpy.context.material)" - ] - - preset_values = [ - "material.subsurface_scattering.back", - "material.subsurface_scattering.color", - "material.subsurface_scattering.color_factor", - "material.subsurface_scattering.error_threshold", - "material.subsurface_scattering.front", - "material.subsurface_scattering.ior", - "material.subsurface_scattering.radius", - "material.subsurface_scattering.scale", - "material.subsurface_scattering.texture_factor", - ] - - preset_subdir = "sss" - - -class AddPresetCloth(AddPresetBase, bpy.types.Operator): - '''Add a Cloth Preset''' - bl_idname = "cloth.preset_add" - bl_label = "Add Cloth Preset" - preset_menu = "CLOTH_MT_presets" - - preset_defines = [ - "cloth = bpy.context.cloth" - ] - - preset_values = [ - "cloth.settings.air_damping", - "cloth.settings.bending_stiffness", - "cloth.settings.mass", - "cloth.settings.quality", - "cloth.settings.spring_damping", - "cloth.settings.structural_stiffness", - ] - - preset_subdir = "cloth" - - -class AddPresetSunSky(AddPresetBase, bpy.types.Operator): - '''Add a Sky & Atmosphere Preset''' - bl_idname = "lamp.sunsky_preset_add" - bl_label = "Add Sunsky Preset" - preset_menu = "LAMP_MT_sunsky_presets" - - preset_defines = [ - "sky = bpy.context.object.data.sky" - ] - - preset_values = [ - "sky.atmosphere_extinction", - "sky.atmosphere_inscattering", - "sky.atmosphere_turbidity", - "sky.backscattered_light", - "sky.horizon_brightness", - "sky.spread", - "sky.sun_brightness", - "sky.sun_intensity", - "sky.sun_size", - "sky.use_sky_blend", - "sky.use_sky_blend_type", - "sky.use_sky_color_space", - "sky.use_sky_exposure", - ] - - preset_subdir = "sunsky" - - -class AddPresetInteraction(AddPresetBase, bpy.types.Operator): - '''Add an Application Interaction Preset''' - bl_idname = "wm.interaction_preset_add" - bl_label = "Add Interaction Preset" - preset_menu = "USERPREF_MT_interaction_presets" - - preset_defines = [ - "user_preferences = bpy.context.user_preferences" - ] - - preset_values = [ - "user_preferences.edit.use_drag_immediately", - "user_preferences.edit.use_insertkey_xyz_to_rgb", - "user_preferences.inputs.invert_mouse_wheel_zoom", - "user_preferences.inputs.select_mouse", - "user_preferences.inputs.use_emulate_numpad", - "user_preferences.inputs.use_mouse_continuous", - "user_preferences.inputs.use_mouse_emulate_3_button", - "user_preferences.inputs.view_rotate_method", - "user_preferences.inputs.view_zoom_axis", - "user_preferences.inputs.view_zoom_method", - ] - - preset_subdir = "interaction" - - -class AddPresetKeyconfig(AddPresetBase, bpy.types.Operator): - '''Add a Keyconfig Preset''' - bl_idname = "wm.keyconfig_preset_add" - bl_label = "Add Keyconfig Preset" - preset_menu = "USERPREF_MT_keyconfigs" - preset_subdir = "keyconfig" - - def add(self, context, filepath): - bpy.ops.wm.keyconfig_export(filepath=filepath) - bpy.utils.keyconfig_set(filepath) - - def pre_cb(self, context): - keyconfigs = bpy.context.window_manager.keyconfigs - if self.remove_active: - preset_menu_class = getattr(bpy.types, self.preset_menu) - preset_menu_class.bl_label = keyconfigs.active.name - - def post_cb(self, context): - keyconfigs = bpy.context.window_manager.keyconfigs - if self.remove_active: - keyconfigs.remove(keyconfigs.active) - - -class AddPresetOperator(AddPresetBase, bpy.types.Operator): - '''Add an Application Interaction Preset''' - bl_idname = "wm.operator_preset_add" - bl_label = "Operator Preset" - preset_menu = "WM_MT_operator_presets" - - operator = bpy.props.StringProperty(name="Operator", maxlen=64, options={'HIDDEN'}) - - # XXX, not ideal - preset_defines = [ - "op = bpy.context.space_data.operator", - ] - - @property - def preset_subdir(self): - return __class__.operator_path(self.operator) - - @property - def preset_values(self): - properties_blacklist = bpy.types.Operator.bl_rna.properties.keys() - - prefix, suffix = self.operator.split("_OT_", 1) - operator_rna = getattr(getattr(bpy.ops, prefix.lower()), suffix).get_rna().bl_rna - - ret = [] - for prop_id, prop in operator_rna.properties.items(): - if (not prop.is_hidden) and prop_id not in properties_blacklist: - ret.append("op.%s" % prop_id) - - return ret - - @staticmethod - def operator_path(operator): - import os - prefix, suffix = operator.split("_OT_", 1) - return os.path.join("operator", "%s.%s" % (prefix.lower(), suffix)) - - -class WM_MT_operator_presets(bpy.types.Menu): - bl_label = "Operator Presets" - - def draw(self, context): - self.operator = context.space_data.operator.bl_idname - bpy.types.Menu.draw_preset(self, context) - - @property - def preset_subdir(self): - return AddPresetOperator.operator_path(self.operator) - - preset_operator = "script.execute_preset" - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/screen_play_rendered_anim.py b/release/scripts/op/screen_play_rendered_anim.py deleted file mode 100644 index 579af9b34b3..00000000000 --- a/release/scripts/op/screen_play_rendered_anim.py +++ /dev/null @@ -1,157 +0,0 @@ -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# Script copyright (C) Campbell J Barton -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ***** END GPL LICENCE BLOCK ***** - -# - -# History -# -# Originally written by Matt Ebb - -import bpy -import os - - -def guess_player_path(preset): - import platform - try: - system = platform.system() - except UnicodeDecodeError: - import sys - system = sys.platform - - if preset == 'BLENDER24': - player_path = "blender" - - if system == 'Darwin': - test_path = "/Applications/blender 2.49.app/Contents/MacOS/blender" - elif system in ('Windows', 'win32'): - test_path = "/Program Files/Blender Foundation/Blender/blender.exe" - - if os.path.exists(test_path): - player_path = test_path - - elif preset == 'DJV': - player_path = "djv_view" - - if system == 'Darwin': - test_path = '/Applications/djv-0.8.2.app/Contents/Resources/bin/djv_view' - if os.path.exists(test_path): - player_path = test_path - - elif preset == 'FRAMECYCLER': - player_path = "framecycler" - - elif preset == 'RV': - player_path = "rv" - - elif preset == 'MPLAYER': - player_path = "mplayer" - - return player_path - - -class PlayRenderedAnim(bpy.types.Operator): - '''Plays back rendered frames/movies using an external player.''' - bl_idname = "render.play_rendered_anim" - bl_label = "Play Rendered Animation" - bl_options = {'REGISTER'} - - def execute(self, context): - import subprocess - - scene = context.scene - rd = scene.render - prefs = context.user_preferences - - preset = prefs.filepaths.animation_player_preset - player_path = prefs.filepaths.animation_player - file_path = bpy.path.abspath(rd.filepath) - is_movie = rd.is_movie_format - - # try and guess a command line if it doesn't exist - if player_path == '': - player_path = guess_player_path(preset) - - if is_movie == False and preset in ('FRAMECYCLER', 'RV', 'MPLAYER'): - # replace the number with '#' - file_a = rd.frame_path(frame=0) - - # TODO, make an api call for this - frame_tmp = 9 - file_b = rd.frame_path(frame=frame_tmp) - - while len(file_a) == len(file_b): - frame_tmp = (frame_tmp * 10) + 9 - print(frame_tmp) - file_b = rd.frame_path(frame=frame_tmp) - file_b = rd.frame_path(frame=int(frame_tmp / 10)) - - file = "".join((c if file_b[i] == c else "#") for i, c in enumerate(file_a)) - else: - # works for movies and images - file = rd.frame_path(frame=scene.frame_start) - - file = bpy.path.abspath(file) # expand '//' - - cmd = [player_path] - # extra options, fps controls etc. - if preset == 'BLENDER24': - opts = ["-a", "-f", str(rd.fps), str(rd.fps_base), file] - cmd.extend(opts) - elif preset == 'DJV': - opts = [file, "-playback_speed", str(rd.fps)] - cmd.extend(opts) - elif preset == 'FRAMECYCLER': - opts = [file, "%d-%d" % (scene.frame_start, scene.frame_end)] - cmd.extend(opts) - elif preset == 'RV': - opts = ["-fps", str(rd.fps), "-play", "[ %s ]" % file] - cmd.extend(opts) - elif preset == 'MPLAYER': - opts = [] - if is_movie: - opts.append(file) - else: - opts.append("mf://%s" % file.replace("#", "?")) - opts += ["-mf", "fps=%.4f" % (rd.fps / rd.fps_base)] - opts += ["-loop", "0", "-really-quiet", "-fs"] - cmd.extend(opts) - else: # 'CUSTOM' - cmd.append(file) - - # launch it - try: - process = subprocess.Popen(cmd) - except: - pass - #raise OSError("Couldn't find an external animation player.") - - return {'FINISHED'} - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/sequencer.py b/release/scripts/op/sequencer.py deleted file mode 100644 index de341bef269..00000000000 --- a/release/scripts/op/sequencer.py +++ /dev/null @@ -1,146 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy - -from bpy.props import * - - -class SequencerCrossfadeSounds(bpy.types.Operator): - '''Do crossfading volume animation of two selected sound strips.''' - - bl_idname = "sequencer.crossfade_sounds" - bl_label = "Crossfade sounds" - bl_options = {'REGISTER', 'UNDO'} - - @classmethod - def poll(cls, context): - if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip: - return context.scene.sequence_editor.active_strip.type == 'SOUND' - else: - return False - - def execute(self, context): - seq1 = None - seq2 = None - for s in context.scene.sequence_editor.sequences: - if s.select and s.type == 'SOUND': - if seq1 is None: - seq1 = s - elif seq2 is None: - seq2 = s - else: - seq2 = None - break - if seq2 is None: - self.report({'ERROR'}, "Select 2 sound strips.") - return {'CANCELLED'} - if seq1.frame_final_start > seq2.frame_final_start: - s = seq1 - seq1 = seq2 - seq2 = s - if seq1.frame_final_end > seq2.frame_final_start: - tempcfra = context.scene.frame_current - context.scene.frame_current = seq2.frame_final_start - seq1.keyframe_insert('volume') - context.scene.frame_current = seq1.frame_final_end - seq1.volume = 0 - seq1.keyframe_insert('volume') - seq2.keyframe_insert('volume') - context.scene.frame_current = seq2.frame_final_start - seq2.volume = 0 - seq2.keyframe_insert('volume') - context.scene.frame_current = tempcfra - return {'FINISHED'} - else: - self.report({'ERROR'}, "The selected strips don't overlap.") - return {'CANCELLED'} - - -class SequencerCutMulticam(bpy.types.Operator): - '''Cut multicam strip and select camera.''' - - bl_idname = "sequencer.cut_multicam" - bl_label = "Cut multicam" - bl_options = {'REGISTER', 'UNDO'} - - camera = IntProperty(name="Camera", - default=1, min=1, max=32, soft_min=1, soft_max=32) - - @classmethod - def poll(cls, context): - if context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip: - return context.scene.sequence_editor.active_strip.type == 'MULTICAM' - else: - return False - - def execute(self, context): - camera = self.camera - - s = context.scene.sequence_editor.active_strip - - if s.multicam_source == camera or camera >= s.channel: - return {'FINISHED'} - - if not s.select: - s.select = True - - cfra = context.scene.frame_current - bpy.ops.sequencer.cut(frame=cfra, type='SOFT', side='RIGHT') - for s in context.scene.sequence_editor.sequences_all: - if s.select and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end: - context.scene.sequence_editor.active_strip = s - - context.scene.sequence_editor.active_strip.multicam_source = camera - return {'FINISHED'} - - -class SequencerDeinterlaceSelectedMovies(bpy.types.Operator): - '''Deinterlace all selected movie sources.''' - - bl_idname = "sequencer.deinterlace_selected_movies" - bl_label = "Deinterlace Movies" - bl_options = {'REGISTER', 'UNDO'} - - @classmethod - def poll(cls, context): - if context.scene and context.scene.sequence_editor: - return True - else: - return False - - def execute(self, context): - for s in context.scene.sequence_editor.sequences_all: - if s.select and s.type == 'MOVIE': - s.use_deinterlace = True - - return {'FINISHED'} - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py deleted file mode 100644 index 83282924b5b..00000000000 --- a/release/scripts/op/uv.py +++ /dev/null @@ -1,381 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy -from bpy.props import * - - -def write_svg(fw, mesh, image_width, image_height, face_iter): - # for making an XML compatible string - from xml.sax.saxutils import escape - from os.path import basename - - fw('\n') - fw('\n') - fw('\n') - desc = "%r, %s, (Blender %s)" % (basename(bpy.data.filepath), mesh.name, bpy.app.version_string) - fw('%s\n' % escape(desc)) - - # svg colors - fill_settings = [] - fill_default = 'fill="grey"' - for mat in mesh.materials if mesh.materials else [None]: - if mat: - fill_settings.append('fill="rgb(%d, %d, %d)"' % tuple(int(c * 255) for c in mat.diffuse_color)) - else: - fill_settings.append(fill_default) - - faces = mesh.faces - for i, uvs in face_iter: - try: # rare cases material index is invalid. - fill = fill_settings[faces[i].material_index] - except IndexError: - fill = fill_default - - fw('\n') - fw('\n') - fw('\n') - - -def write_eps(fw, mesh, image_width, image_height, face_iter): - fw('%!PS-Adobe-3.0 EPSF-3.0\n') - fw("%%%%Creator: Blender %s\n" % bpy.app.version_string) - fw('%%Pages: 1\n') - fw('%%Orientation: Portrait\n') - fw("%%%%BoundingBox: 0 0 %d %d\n" % (image_width, image_height)) - fw("%%%%HiResBoundingBox: 0.0 0.0 %.4f %.4f\n" % (image_width, image_height)) - fw('%%EndComments\n') - fw('%%Page: 1 1\n') - fw('0 0 translate\n') - fw('1.0 1.0 scale\n') - fw('0 0 0 setrgbcolor\n') - fw('[] 0 setdash\n') - fw('1 setlinewidth\n') - fw('1 setlinejoin\n') - fw('1 setlinecap\n') - fw('/DRAW {') - # can remove from here to next comment to disable filling, aparently alpha is not supported - fw('gsave\n') - fw('0.7 setgray\n') - fw('fill\n') - fw('grestore\n') - fw('0 setgray\n') - # remove to here - fw('stroke\n') - fw('} def\n') - fw('newpath\n') - - firstline = True - for i, uvs in face_iter: - for j, uv in enumerate(uvs): - x, y = uv[0], uv[1] - if j == 0: - if not firstline: - fw('closepath\n') - fw('DRAW\n') - fw('newpath\n') - firstline = False - fw('%.5f %.5f moveto\n' % (x * image_width, y * image_height)) - else: - fw('%.5f %.5f lineto\n' % (x * image_width, y * image_height)) - - fw('closepath\n') - fw('DRAW\n') - fw('showpage\n') - fw('%%EOF\n') - - -def write_png(fw, mesh_source, image_width, image_height, face_iter): - filepath = fw.__self__.name - fw.__self__.close() - - material_solids = [bpy.data.materials.new("uv_temp_solid") for i in range(max(1, len(mesh_source.materials)))] - material_wire = bpy.data.materials.new("uv_temp_wire") - - scene = bpy.data.scenes.new("uv_temp") - mesh = bpy.data.meshes.new("uv_temp") - for mat_solid in material_solids: - mesh.materials.append(mat_solid) - - tot_verts = 0 - face_lens = [] - for f in mesh_source.faces: - tot_verts += len(f.vertices) - - faces_source = mesh_source.faces - - # get unique UV's incase there are many overlapping which slow down filling. - face_hash_3 = set() - face_hash_4 = set() - for i, uv in face_iter: - material_index = faces_source[i].material_index - if len(uv) == 3: - face_hash_3.add((uv[0][0], uv[0][1], uv[1][0], uv[1][1], uv[2][0], uv[2][1], material_index)) - else: - face_hash_4.add((uv[0][0], uv[0][1], uv[1][0], uv[1][1], uv[2][0], uv[2][1], uv[3][0], uv[3][1], material_index)) - - # now set the faces coords and locations - # build mesh data - mesh_new_vertices = [] - mesh_new_materials = [] - mesh_new_face_vertices = [] - - current_vert = 0 - - for face_data in face_hash_3: - mesh_new_vertices.extend([face_data[0], face_data[1], 0.0, face_data[2], face_data[3], 0.0, face_data[4], face_data[5], 0.0]) - mesh_new_face_vertices.extend([current_vert, current_vert + 1, current_vert + 2, 0]) - mesh_new_materials.append(face_data[6]) - current_vert += 3 - for face_data in face_hash_4: - mesh_new_vertices.extend([face_data[0], face_data[1], 0.0, face_data[2], face_data[3], 0.0, face_data[4], face_data[5], 0.0, face_data[6], face_data[7], 0.0]) - mesh_new_face_vertices.extend([current_vert, current_vert + 1, current_vert + 2, current_vert + 3]) - mesh_new_materials.append(face_data[8]) - current_vert += 4 - - mesh.vertices.add(len(mesh_new_vertices) // 3) - mesh.faces.add(len(mesh_new_face_vertices) // 4) - - mesh.vertices.foreach_set("co", mesh_new_vertices) - mesh.faces.foreach_set("vertices_raw", mesh_new_face_vertices) - mesh.faces.foreach_set("material_index", mesh_new_materials) - - mesh.update(calc_edges=True) - - obj_solid = bpy.data.objects.new("uv_temp_solid", mesh) - obj_wire = bpy.data.objects.new("uv_temp_wire", mesh) - base_solid = scene.objects.link(obj_solid) - base_wire = scene.objects.link(obj_wire) - base_solid.layers[0] = True - base_wire.layers[0] = True - - # place behind the wire - obj_solid.location = 0, 0, -1 - - obj_wire.material_slots[0].link = 'OBJECT' - obj_wire.material_slots[0].material = material_wire - - # setup the camera - cam = bpy.data.cameras.new("uv_temp") - cam.type = 'ORTHO' - cam.ortho_scale = 1.0 - obj_cam = bpy.data.objects.new("uv_temp_cam", cam) - obj_cam.location = 0.5, 0.5, 1.0 - scene.objects.link(obj_cam) - scene.camera = obj_cam - - # setup materials - for i, mat_solid in enumerate(material_solids): - if mesh_source.materials and mesh_source.materials[i]: - mat_solid.diffuse_color = mesh_source.materials[i].diffuse_color - - mat_solid.use_shadeless = True - mat_solid.use_transparency = True - mat_solid.alpha = 0.25 - - material_wire.type = 'WIRE' - material_wire.use_shadeless = True - material_wire.diffuse_color = 0, 0, 0 - - # scene render settings - scene.render.use_raytrace = False - scene.render.alpha_mode = 'STRAIGHT' - scene.render.color_mode = 'RGBA' - - scene.render.resolution_x = image_width - scene.render.resolution_y = image_height - scene.render.resolution_percentage = 100 - - if image_width > image_height: - scene.render.pixel_aspect_y = image_width / image_height - elif image_width < image_height: - scene.render.pixel_aspect_x = image_height / image_width - - scene.frame_start = 1 - scene.frame_end = 1 - - scene.render.file_format = 'PNG' - scene.render.filepath = filepath - - data_context = {"blend_data": bpy.context.blend_data, "scene": scene} - bpy.ops.render.render(data_context, write_still=True) - - # cleanup - bpy.data.scenes.remove(scene) - bpy.data.objects.remove(obj_cam) - bpy.data.objects.remove(obj_solid) - bpy.data.objects.remove(obj_wire) - - bpy.data.cameras.remove(cam) - bpy.data.meshes.remove(mesh) - - bpy.data.materials.remove(material_wire) - for mat_solid in material_solids: - bpy.data.materials.remove(mat_solid) - - -class ExportUVLayout(bpy.types.Operator): - """Export UV layout to file""" - - bl_idname = "uv.export_layout" - bl_label = "Export UV Layout" - bl_options = {'REGISTER', 'UNDO'} - - filepath = StringProperty(name="File Path", description="File path used for exporting the SVG file", maxlen=1024, default="", subtype='FILE_PATH') - check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) - export_all = BoolProperty(name="All UV's", description="Export all UVs in this mesh (not just the visible ones)", default=False) - mode = EnumProperty(items=( - ('SVG', "Scalable Vector Graphic (.svg)", "Export the UV layout to a vector SVG file"), - ('EPS', "Encapsulate PostScript (.eps)", "Export the UV layout to a vector EPS file"), - ('PNG', "PNG Image (.png)", "Export the UV layout a bitmap image")), - name="Format", - description="File format to export the UV layout to", - default='PNG') - size = IntVectorProperty(size=2, default=(1024, 1024), min=8, max=32768, description="Dimensions of the exported file") - - @classmethod - def poll(cls, context): - obj = context.active_object - return (obj and obj.type == 'MESH' and obj.data.uv_textures) - - def _space_image(self, context): - space_data = context.space_data - if isinstance(space_data, bpy.types.SpaceImageEditor): - return space_data - else: - return None - - def _image_size(self, context, default_width=1024, default_height=1024): - # fallback if not in image context. - image_width, image_height = default_width, default_height - - space_data = self._space_image(context) - if space_data: - image = space_data.image - if image: - width, height = tuple(context.space_data.image.size) - # incase no data is found. - if width and height: - image_width, image_height = width, height - - return image_width, image_height - - def _face_uv_iter(self, context): - obj = context.active_object - mesh = obj.data - uv_layer = mesh.uv_textures.active.data - uv_layer_len = len(uv_layer) - - if not self.export_all: - - local_image = Ellipsis - - if context.tool_settings.show_uv_local_view: - space_data = self._space_image(context) - if space_data: - local_image = space_data.image - - faces = mesh.faces - - for i in range(uv_layer_len): - uv_elem = uv_layer[i] - # context checks - if faces[i].select and (local_image is Ellipsis or local_image == uv_elem.image): - #~ uv = uv_elem.uv - #~ if False not in uv_elem.select_uv[:len(uv)]: - #~ yield (i, uv) - - # just write what we see. - yield (i, uv_layer[i].uv) - else: - # all, simple - for i in range(uv_layer_len): - yield (i, uv_layer[i].uv) - - def execute(self, context): - - obj = context.active_object - is_editmode = (obj.mode == 'EDIT') - if is_editmode: - bpy.ops.object.mode_set(mode='OBJECT', toggle=False) - - mesh = obj.data - - mode = self.mode - - filepath = self.filepath - filepath = bpy.path.ensure_ext(filepath, "." + mode.lower()) - file = open(filepath, "w") - fw = file.write - - if mode == 'SVG': - func = write_svg - elif mode == 'EPS': - func = write_eps - elif mode == 'PNG': - func = write_png - - func(fw, mesh, self.size[0], self.size[1], self._face_uv_iter(context)) - - if is_editmode: - bpy.ops.object.mode_set(mode='EDIT', toggle=False) - - return {'FINISHED'} - - def check(self, context): - filepath = bpy.path.ensure_ext(self.filepath, "." + self.mode.lower()) - if filepath != self.filepath: - self.filepath = filepath - return True - else: - return False - - def invoke(self, context, event): - import os - self.size = self._image_size(context) - self.filepath = os.path.splitext(bpy.data.filepath)[0] - wm = context.window_manager - wm.fileselect_add(self) - return {'RUNNING_MODAL'} - - -def menu_func(self, context): - self.layout.operator(ExportUVLayout.bl_idname) - - -def register(): - bpy.utils.register_module(__name__) - bpy.types.IMAGE_MT_uvs.append(menu_func) - - -def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.IMAGE_MT_uvs.remove(menu_func) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/uvcalc_follow_active.py b/release/scripts/op/uvcalc_follow_active.py deleted file mode 100644 index 12895fae1c5..00000000000 --- a/release/scripts/op/uvcalc_follow_active.py +++ /dev/null @@ -1,264 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -#for full docs see... -# http://mediawiki.blender.org/index.php/Scripts/Manual/UV_Calculate/Follow_active_quads - -import bpy - - -def extend(obj, operator, EXTEND_MODE): - me = obj.data - me_verts = me.vertices - # script will fail without UVs - if not me.uv_textures: - me.uv_textures.new() - - # Toggle Edit mode - is_editmode = (obj.mode == 'EDIT') - if is_editmode: - bpy.ops.object.mode_set(mode='OBJECT') - - #t = sys.time() - edge_average_lengths = {} - - OTHER_INDEX = 2, 3, 0, 1 - FAST_INDICIES = 0, 2, 1, 3 # order is faster - - def extend_uvs(face_source, face_target, edge_key): - ''' - Takes 2 faces, - Projects its extends its UV coords onto the face next to it. - Both faces must share an edge - ''' - - def face_edge_vs(vi): - # assume a quad - return [(vi[0], vi[1]), (vi[1], vi[2]), (vi[2], vi[3]), (vi[3], vi[0])] - - vidx_source = face_source.vertices - vidx_target = face_target.vertices - - faceUVsource = me.uv_textures.active.data[face_source.index] - uvs_source = [faceUVsource.uv1, faceUVsource.uv2, faceUVsource.uv3, faceUVsource.uv4] - - faceUVtarget = me.uv_textures.active.data[face_target.index] - uvs_target = [faceUVtarget.uv1, faceUVtarget.uv2, faceUVtarget.uv3, faceUVtarget.uv4] - - # vertex index is the key, uv is the value - - uvs_vhash_source = {vindex: uvs_source[i] for i, vindex in enumerate(vidx_source)} - - uvs_vhash_target = {vindex: uvs_target[i] for i, vindex in enumerate(vidx_target)} - - edge_idxs_source = face_edge_vs(vidx_source) - edge_idxs_target = face_edge_vs(vidx_target) - - source_matching_edge = -1 - target_matching_edge = -1 - - edge_key_swap = edge_key[1], edge_key[0] - - try: - source_matching_edge = edge_idxs_source.index(edge_key) - except: - source_matching_edge = edge_idxs_source.index(edge_key_swap) - try: - target_matching_edge = edge_idxs_target.index(edge_key) - except: - target_matching_edge = edge_idxs_target.index(edge_key_swap) - - edgepair_inner_source = edge_idxs_source[source_matching_edge] - edgepair_inner_target = edge_idxs_target[target_matching_edge] - edgepair_outer_source = edge_idxs_source[OTHER_INDEX[source_matching_edge]] - edgepair_outer_target = edge_idxs_target[OTHER_INDEX[target_matching_edge]] - - if edge_idxs_source[source_matching_edge] == edge_idxs_target[target_matching_edge]: - iA = 0 # Flipped, most common - iB = 1 - else: # The normals of these faces must be different - iA = 1 - iB = 0 - - # Set the target UV's touching source face, no tricky calc needed, - uvs_vhash_target[edgepair_inner_target[0]][:] = uvs_vhash_source[edgepair_inner_source[iA]] - uvs_vhash_target[edgepair_inner_target[1]][:] = uvs_vhash_source[edgepair_inner_source[iB]] - - # Set the 2 UV's on the target face that are not touching - # for this we need to do basic expaning on the source faces UV's - if EXTEND_MODE == 'LENGTH': - - try: # divide by zero is possible - ''' - measure the length of each face from the middle of each edge to the opposite - allong the axis we are copying, use this - ''' - i1a = edgepair_outer_target[iB] - i2a = edgepair_inner_target[iA] - if i1a > i2a: - i1a, i2a = i2a, i1a - - i1b = edgepair_outer_source[iB] - i2b = edgepair_inner_source[iA] - if i1b > i2b: - i1b, i2b = i2b, i1b - # print edge_average_lengths - factor = edge_average_lengths[i1a, i2a][0] / edge_average_lengths[i1b, i2b][0] - except: - # Div By Zero? - factor = 1.0 - - uvs_vhash_target[edgepair_outer_target[iB]][:] = uvs_vhash_source[edgepair_inner_source[0]] + factor * (uvs_vhash_source[edgepair_inner_source[0]] - uvs_vhash_source[edgepair_outer_source[1]]) - uvs_vhash_target[edgepair_outer_target[iA]][:] = uvs_vhash_source[edgepair_inner_source[1]] + factor * (uvs_vhash_source[edgepair_inner_source[1]] - uvs_vhash_source[edgepair_outer_source[0]]) - - else: - # same as above but with no factors - uvs_vhash_target[edgepair_outer_target[iB]][:] = uvs_vhash_source[edgepair_inner_source[0]] + (uvs_vhash_source[edgepair_inner_source[0]] - uvs_vhash_source[edgepair_outer_source[1]]) - uvs_vhash_target[edgepair_outer_target[iA]][:] = uvs_vhash_source[edgepair_inner_source[1]] + (uvs_vhash_source[edgepair_inner_source[1]] - uvs_vhash_source[edgepair_outer_source[0]]) - - if not me.uv_textures: - me.uv_textures.new() - - face_act = me.faces.active - if face_act == -1: - operator.report({'ERROR'}, "No active face.") - return - - face_sel = [f for f in me.faces if len(f.vertices) == 4 and f.select] - - face_act_local_index = -1 - for i, f in enumerate(face_sel): - if f.index == face_act: - face_act_local_index = i - break - - if face_act_local_index == -1: - operator.report({'ERROR'}, "Active face not selected.") - return - - # Modes - # 0 unsearched - # 1:mapped, use search from this face. - removed!! - # 2:all siblings have been searched. dont search again. - face_modes = [0] * len(face_sel) - face_modes[face_act_local_index] = 1 # extend UV's from this face. - - # Edge connectivty - edge_faces = {} - for i, f in enumerate(face_sel): - for edkey in f.edge_keys: - try: - edge_faces[edkey].append(i) - except: - edge_faces[edkey] = [i] - - if EXTEND_MODE == 'LENGTH': - edge_loops = me.edge_loops_from_faces(face_sel, [ed.key for ed in me.edges if ed.use_seam]) - me_verts = me.vertices - for loop in edge_loops: - looplen = [0.0] - for ed in loop: - edge_average_lengths[ed] = looplen - looplen[0] += (me_verts[ed[0]].co - me_verts[ed[1]].co).length - looplen[0] = looplen[0] / len(loop) - - # remove seams, so we dont map accross seams. - for ed in me.edges: - if ed.use_seam: - # remove the edge pair if we can - try: - del edge_faces[ed.key] - except: - pass - # Done finding seams - - # face connectivity - faces around each face - # only store a list of indices for each face. - face_faces = [[] for i in range(len(face_sel))] - - for edge_key, faces in edge_faces.items(): - if len(faces) == 2: # Only do edges with 2 face users for now - face_faces[faces[0]].append((faces[1], edge_key)) - face_faces[faces[1]].append((faces[0], edge_key)) - - # Now we know what face is connected to what other face, map them by connectivity - ok = True - while ok: - ok = False - for i in range(len(face_sel)): - if face_modes[i] == 1: # searchable - for f_sibling, edge_key in face_faces[i]: - if face_modes[f_sibling] == 0: - face_modes[f_sibling] = 1 # mapped and search from. - extend_uvs(face_sel[i], face_sel[f_sibling], edge_key) - face_modes[i] = 1 # we can map from this one now. - ok = True # keep searching - - face_modes[i] = 2 # dont search again - - if is_editmode: - bpy.ops.object.mode_set(mode='EDIT') - else: - me.update_tag() - - -def main(context, operator): - obj = context.active_object - - extend(obj, operator, operator.properties.mode) - - -class FollowActiveQuads(bpy.types.Operator): - '''Follow UVs from active quads along continuous face loops''' - bl_idname = "uv.follow_active_quads" - bl_label = "Follow Active Quads" - bl_options = {'REGISTER', 'UNDO'} - - mode = bpy.props.EnumProperty(items=(("EVEN", "Even", "Space all UVs evently"), ("LENGTH", "Length", "Average space UVs edge length of each loop")), - name="Edge Length Mode", - description="Method to space UV edge loops", - default="LENGTH") - - @classmethod - def poll(cls, context): - obj = context.active_object - return (obj is not None and obj.type == 'MESH') - - def execute(self, context): - main(context, self) - return {'FINISHED'} - - -# Add to a menu -menu_func = (lambda self, context: self.layout.operator(FollowActiveQuads.bl_idname)) - - -def register(): - bpy.utils.register_module(__name__) - bpy.types.VIEW3D_MT_uv_map.append(menu_func) - - -def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.VIEW3D_MT_uv_map.remove(menu_func) - - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py deleted file mode 100644 index 8cdf593f98d..00000000000 --- a/release/scripts/op/uvcalc_smart_project.py +++ /dev/null @@ -1,1142 +0,0 @@ -# -------------------------------------------------------------------------- -# Smart Projection UV Projection Unwrapper v1.2 by Campbell Barton (AKA Ideasman) -# -------------------------------------------------------------------------- -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -# - -from mathutils import Matrix, Vector, geometry -import time -import bpy -from math import cos, radians - -DEG_TO_RAD = 0.017453292519943295 # pi/180.0 -SMALL_NUM = 0.000000001 -BIG_NUM = 1e15 - -global USER_FILL_HOLES -global USER_FILL_HOLES_QUALITY -USER_FILL_HOLES = None -USER_FILL_HOLES_QUALITY = None - -dict_matrix = {} - -def pointInTri2D(v, v1, v2, v3): - global dict_matrix - - key = v1.x, v1.y, v2.x, v2.y, v3.x, v3.y - - # Commented because its slower to do teh bounds check, we should realy cache the bounds info for each face. - ''' - # BOUNDS CHECK - xmin= 1000000 - ymin= 1000000 - - xmax= -1000000 - ymax= -1000000 - - for i in (0,2,4): - x= key[i] - y= key[i+1] - - if xmaxx: xmin= x - if ymin>y: ymin= y - - x= v.x - y= v.y - - if xxmax or y < ymin or y > ymax: - return False - # Done with bounds check - ''' - try: - mtx = dict_matrix[key] - if not mtx: - return False - except: - side1 = v2 - v1 - side2 = v3 - v1 - - nor = side1.cross(side2) - - mtx = Matrix((side1, side2, nor)) - - # Zero area 2d tri, even tho we throw away zerop area faces - # the projection UV can result in a zero area UV. - if not mtx.determinant(): - dict_matrix[key] = None - return False - - mtx.invert() - - dict_matrix[key] = mtx - - uvw = (v - v1) * mtx - return 0 <= uvw[0] and 0 <= uvw[1] and uvw[0] + uvw[1] <= 1 - - -def boundsIsland(faces): - minx = maxx = faces[0].uv[0][0] # Set initial bounds. - miny = maxy = faces[0].uv[0][1] - # print len(faces), minx, maxx, miny , maxy - for f in faces: - for uv in f.uv: - x= uv.x - y= uv.y - if xmaxx: maxx= x - if y>maxy: maxy= y - - return minx, miny, maxx, maxy - -""" -def boundsEdgeLoop(edges): - minx = maxx = edges[0][0] # Set initial bounds. - miny = maxy = edges[0][1] - # print len(faces), minx, maxx, miny , maxy - for ed in edges: - for pt in ed: - print 'ass' - x= pt[0] - y= pt[1] - if xmaxx: x= maxx - if y>maxy: y= maxy - - return minx, miny, maxx, maxy -""" - -# Turns the islands into a list of unpordered edges (Non internal) -# Onlt for UV's -# only returns outline edges for intersection tests. and unique points. - -def island2Edge(island): - - # Vert index edges - edges = {} - - unique_points= {} - - for f in island: - f_uvkey= map(tuple, f.uv) - - - for vIdx, edkey in enumerate(f.edge_keys): - unique_points[f_uvkey[vIdx]] = f.uv[vIdx] - - if f.v[vIdx].index > f.v[vIdx-1].index: - i1= vIdx-1; i2= vIdx - else: - i1= vIdx; i2= vIdx-1 - - try: edges[ f_uvkey[i1], f_uvkey[i2] ] *= 0 # sets eny edge with more then 1 user to 0 are not returned. - except: edges[ f_uvkey[i1], f_uvkey[i2] ] = (f.uv[i1] - f.uv[i2]).length, - - # If 2 are the same then they will be together, but full [a,b] order is not correct. - - # Sort by length - - - length_sorted_edges = [(Vector(key[0]), Vector(key[1]), value) for key, value in edges.items() if value != 0] - - try: length_sorted_edges.sort(key = lambda A: -A[2]) # largest first - except: length_sorted_edges.sort(lambda A, B: cmp(B[2], A[2])) - - # Its okay to leave the length in there. - #for e in length_sorted_edges: - # e.pop(2) - - # return edges and unique points - return length_sorted_edges, [v.to_3d() for v in unique_points.values()] - -# ========================= NOT WORKING???? -# Find if a points inside an edge loop, un-orderd. -# pt is and x/y -# edges are a non ordered loop of edges. -# #offsets are the edge x and y offset. -""" -def pointInEdges(pt, edges): - # - x1 = pt[0] - y1 = pt[1] - - # Point to the left of this line. - x2 = -100000 - y2 = -10000 - intersectCount = 0 - for ed in edges: - xi, yi = lineIntersection2D(x1,y1, x2,y2, ed[0][0], ed[0][1], ed[1][0], ed[1][1]) - if xi != None: # Is there an intersection. - intersectCount+=1 - - return intersectCount % 2 -""" - -def pointInIsland(pt, island): - vec1, vec2, vec3 = Vector(), Vector(), Vector() - for f in island: - vec1.x, vec1.y = f.uv[0] - vec2.x, vec2.y = f.uv[1] - vec3.x, vec3.y = f.uv[2] - - if pointInTri2D(pt, vec1, vec2, vec3): - return True - - if len(f.v) == 4: - vec1.x, vec1.y = f.uv[0] - vec2.x, vec2.y = f.uv[2] - vec3.x, vec3.y = f.uv[3] - if pointInTri2D(pt, vec1, vec2, vec3): - return True - return False - - -# box is (left,bottom, right, top) -def islandIntersectUvIsland(source, target, SourceOffset): - # Is 1 point in the box, inside the vertLoops - edgeLoopsSource = source[6] # Pretend this is offset - edgeLoopsTarget = target[6] - - # Edge intersect test - for ed in edgeLoopsSource: - for seg in edgeLoopsTarget: - i = geometry.intersect_line_line_2d(\ - seg[0], seg[1], SourceOffset+ed[0], SourceOffset+ed[1]) - if i: - return 1 # LINE INTERSECTION - - # 1 test for source being totally inside target - SourceOffset.resize_3d() - for pv in source[7]: - if pointInIsland(pv+SourceOffset, target[0]): - return 2 # SOURCE INSIDE TARGET - - # 2 test for a part of the target being totaly inside the source. - for pv in target[7]: - if pointInIsland(pv-SourceOffset, source[0]): - return 3 # PART OF TARGET INSIDE SOURCE. - - return 0 # NO INTERSECTION - - - - -# Returns the X/y Bounds of a list of vectors. -def testNewVecLs2DRotIsBetter(vecs, mat=-1, bestAreaSoFar = -1): - - # UV's will never extend this far. - minx = miny = BIG_NUM - maxx = maxy = -BIG_NUM - - for i, v in enumerate(vecs): - - # Do this allong the way - if mat != -1: - v = vecs[i] = v*mat - x= v.x - y= v.y - if xmaxx: maxx= x - if y>maxy: maxy= y - - # Spesific to this algo, bail out if we get bigger then the current area - if bestAreaSoFar != -1 and (maxx-minx) * (maxy-miny) > bestAreaSoFar: - return (BIG_NUM, None), None - w = maxx-minx - h = maxy-miny - return (w*h, w,h), vecs # Area, vecs - -# Takes a list of faces that make up a UV island and rotate -# until they optimally fit inside a square. -ROTMAT_2D_POS_90D = Matrix.Rotation( radians(90.0), 2) -ROTMAT_2D_POS_45D = Matrix.Rotation( radians(45.0), 2) - -RotMatStepRotation = [] -rot_angle = 22.5 #45.0/2 -while rot_angle > 0.1: - RotMatStepRotation.append([\ - Matrix.Rotation( radians(rot_angle), 2),\ - Matrix.Rotation( radians(-rot_angle), 2)]) - - rot_angle = rot_angle/2.0 - - -def optiRotateUvIsland(faces): - global currentArea - - # Bestfit Rotation - def best2dRotation(uvVecs, MAT1, MAT2): - global currentArea - - newAreaPos, newfaceProjectionGroupListPos =\ - testNewVecLs2DRotIsBetter(uvVecs[:], MAT1, currentArea[0]) - - - # Why do I use newpos here? May as well give the best area to date for an early bailout - # some slight speed increase in this. - # If the new rotation is smaller then the existing, we can - # avoid copying a list and overwrite the old, crappy one. - - if newAreaPos[0] < currentArea[0]: - newAreaNeg, newfaceProjectionGroupListNeg =\ - testNewVecLs2DRotIsBetter(uvVecs, MAT2, newAreaPos[0]) # Reuse the old bigger list. - else: - newAreaNeg, newfaceProjectionGroupListNeg =\ - testNewVecLs2DRotIsBetter(uvVecs[:], MAT2, currentArea[0]) # Cant reuse, make a copy. - - - # Now from the 3 options we need to discover which to use - # we have cerrentArea/newAreaPos/newAreaNeg - bestArea = min(currentArea[0], newAreaPos[0], newAreaNeg[0]) - - if currentArea[0] == bestArea: - return uvVecs - elif newAreaPos[0] == bestArea: - uvVecs = newfaceProjectionGroupListPos - currentArea = newAreaPos - elif newAreaNeg[0] == bestArea: - uvVecs = newfaceProjectionGroupListNeg - currentArea = newAreaNeg - - return uvVecs - - - # Serialized UV coords to Vectors - uvVecs = [uv for f in faces for uv in f.uv] - - # Theres a small enough number of these to hard code it - # rather then a loop. - - # Will not modify anything - currentArea, dummy =\ - testNewVecLs2DRotIsBetter(uvVecs) - - - # Try a 45d rotation - newAreaPos, newfaceProjectionGroupListPos = testNewVecLs2DRotIsBetter(uvVecs[:], ROTMAT_2D_POS_45D, currentArea[0]) - - if newAreaPos[0] < currentArea[0]: - uvVecs = newfaceProjectionGroupListPos - currentArea = newAreaPos - # 45d done - - # Testcase different rotations and find the onfe that best fits in a square - for ROTMAT in RotMatStepRotation: - uvVecs = best2dRotation(uvVecs, ROTMAT[0], ROTMAT[1]) - - # Only if you want it, make faces verticle! - if currentArea[1] > currentArea[2]: - # Rotate 90d - # Work directly on the list, no need to return a value. - testNewVecLs2DRotIsBetter(uvVecs, ROTMAT_2D_POS_90D) - - - # Now write the vectors back to the face UV's - i = 0 # count the serialized uv/vectors - for f in faces: - #f.uv = [uv for uv in uvVecs[i:len(f)+i] ] - for j, k in enumerate(range(i, len(f.v)+i)): - f.uv[j][:] = uvVecs[k] - i += len(f.v) - - -# Takes an island list and tries to find concave, hollow areas to pack smaller islands into. -def mergeUvIslands(islandList): - global USER_FILL_HOLES - global USER_FILL_HOLES_QUALITY - - - # Pack islands to bottom LHS - # Sync with island - - #islandTotFaceArea = [] # A list of floats, each island area - #islandArea = [] # a list of tuples ( area, w,h) - - - decoratedIslandList = [] - - islandIdx = len(islandList) - while islandIdx: - islandIdx-=1 - minx, miny, maxx, maxy = boundsIsland(islandList[islandIdx]) - w, h = maxx-minx, maxy-miny - - totFaceArea = 0 - offset= Vector((minx, miny)) - for f in islandList[islandIdx]: - for uv in f.uv: - uv -= offset - - totFaceArea += f.area - - islandBoundsArea = w*h - efficiency = abs(islandBoundsArea - totFaceArea) - - # UV Edge list used for intersections as well as unique points. - edges, uniqueEdgePoints = island2Edge(islandList[islandIdx]) - - decoratedIslandList.append([islandList[islandIdx], totFaceArea, efficiency, islandBoundsArea, w,h, edges, uniqueEdgePoints]) - - - # Sort by island bounding box area, smallest face area first. - # no.. chance that to most simple edge loop first. - decoratedIslandListAreaSort =decoratedIslandList[:] - - decoratedIslandListAreaSort.sort(key = lambda A: A[3]) - - # sort by efficiency, Least Efficient first. - decoratedIslandListEfficSort = decoratedIslandList[:] - # decoratedIslandListEfficSort.sort(lambda A, B: cmp(B[2], A[2])) - - decoratedIslandListEfficSort.sort(key = lambda A: -A[2]) - - # ================================================== THESE CAN BE TWEAKED. - # This is a quality value for the number of tests. - # from 1 to 4, generic quality value is from 1 to 100 - USER_STEP_QUALITY = ((USER_FILL_HOLES_QUALITY - 1) / 25.0) + 1 - - # If 100 will test as long as there is enough free space. - # this is rarely enough, and testing takes a while, so lower quality speeds this up. - - # 1 means they have the same quality - USER_FREE_SPACE_TO_TEST_QUALITY = 1 + (((100 - USER_FILL_HOLES_QUALITY)/100.0) *5) - - #print 'USER_STEP_QUALITY', USER_STEP_QUALITY - #print 'USER_FREE_SPACE_TO_TEST_QUALITY', USER_FREE_SPACE_TO_TEST_QUALITY - - removedCount = 0 - - areaIslandIdx = 0 - ctrl = Window.Qual.CTRL - BREAK= False - while areaIslandIdx < len(decoratedIslandListAreaSort) and not BREAK: - sourceIsland = decoratedIslandListAreaSort[areaIslandIdx] - # Alredy packed? - if not sourceIsland[0]: - areaIslandIdx+=1 - else: - efficIslandIdx = 0 - while efficIslandIdx < len(decoratedIslandListEfficSort) and not BREAK: - - if Window.GetKeyQualifiers() & ctrl: - BREAK= True - break - - # Now we have 2 islands, is the efficience of the islands lowers theres an - # increasing likely hood that we can fit merge into the bigger UV island. - # this ensures a tight fit. - - # Just use figures we have about user/unused area to see if they might fit. - - targetIsland = decoratedIslandListEfficSort[efficIslandIdx] - - - if sourceIsland[0] == targetIsland[0] or\ - not targetIsland[0] or\ - not sourceIsland[0]: - pass - else: - - # ([island, totFaceArea, efficiency, islandArea, w,h]) - # Waisted space on target is greater then UV bounding island area. - - - # if targetIsland[3] > (sourceIsland[2]) and\ # - # print USER_FREE_SPACE_TO_TEST_QUALITY, 'ass' - if targetIsland[2] > (sourceIsland[1] * USER_FREE_SPACE_TO_TEST_QUALITY) and\ - targetIsland[4] > sourceIsland[4] and\ - targetIsland[5] > sourceIsland[5]: - - # DEBUG # print '%.10f %.10f' % (targetIsland[3], sourceIsland[1]) - - # These enough spare space lets move the box until it fits - - # How many times does the source fit into the target x/y - blockTestXUnit = targetIsland[4]/sourceIsland[4] - blockTestYUnit = targetIsland[5]/sourceIsland[5] - - boxLeft = 0 - - - # Distllllance we can move between whilst staying inside the targets bounds. - testWidth = targetIsland[4] - sourceIsland[4] - testHeight = targetIsland[5] - sourceIsland[5] - - # Increment we move each test. x/y - xIncrement = (testWidth / (blockTestXUnit * ((USER_STEP_QUALITY/50)+0.1))) - yIncrement = (testHeight / (blockTestYUnit * ((USER_STEP_QUALITY/50)+0.1))) - - # Make sure were not moving less then a 3rg of our width/height - if xIncrement testWidth: - boxBottom += yIncrement - boxLeft = 0.0 - else: - boxLeft += xIncrement - ##print testcount - - efficIslandIdx+=1 - areaIslandIdx+=1 - - # Remove empty islands - i = len(islandList) - while i: - i-=1 - if not islandList[i]: - del islandList[i] # Can increment islands removed here. - -# Takes groups of faces. assumes face groups are UV groups. -def getUvIslands(faceGroups, me): - - # Get seams so we dont cross over seams - edge_seams = {} # shoudl be a set - for ed in me.edges: - if ed.use_seam: - edge_seams[ed.key] = None # dummy var- use sets! - # Done finding seams - - - islandList = [] - -#XXX Window.DrawProgressBar(0.0, 'Splitting %d projection groups into UV islands:' % len(faceGroups)) - #print '\tSplitting %d projection groups into UV islands:' % len(faceGroups), - # Find grouped faces - - faceGroupIdx = len(faceGroups) - - while faceGroupIdx: - faceGroupIdx-=1 - faces = faceGroups[faceGroupIdx] - - if not faces: - continue - - # Build edge dict - edge_users = {} - - for i, f in enumerate(faces): - for ed_key in f.edge_keys: - if ed_key in edge_seams: # DELIMIT SEAMS! ;) - edge_users[ed_key] = [] # so as not to raise an error - else: - try: edge_users[ed_key].append(i) - except: edge_users[ed_key] = [i] - - # Modes - # 0 - face not yet touched. - # 1 - added to island list, and need to search - # 2 - touched and searched - dont touch again. - face_modes = [0] * len(faces) # initialize zero - untested. - - face_modes[0] = 1 # start the search with face 1 - - newIsland = [] - - newIsland.append(faces[0]) - - - ok = True - while ok: - - ok = True - while ok: - ok= False - for i in range(len(faces)): - if face_modes[i] == 1: # search - for ed_key in faces[i].edge_keys: - for ii in edge_users[ed_key]: - if i != ii and face_modes[ii] == 0: - face_modes[ii] = ok = 1 # mark as searched - newIsland.append(faces[ii]) - - # mark as searched, dont look again. - face_modes[i] = 2 - - islandList.append(newIsland) - - ok = False - for i in range(len(faces)): - if face_modes[i] == 0: - newIsland = [] - newIsland.append(faces[i]) - - face_modes[i] = ok = 1 - break - # if not ok will stop looping - -#XXX Window.DrawProgressBar(0.1, 'Optimizing Rotation for %i UV Islands' % len(islandList)) - - for island in islandList: - optiRotateUvIsland(island) - - return islandList - - -def packIslands(islandList): - if USER_FILL_HOLES: -#XXX Window.DrawProgressBar(0.1, 'Merging Islands (Ctrl: skip merge)...') - mergeUvIslands(islandList) # Modify in place - - - # Now we have UV islands, we need to pack them. - - # Make a synchronised list with the islands - # so we can box pak the islands. - packBoxes = [] - - # Keep a list of X/Y offset so we can save time by writing the - # uv's and packed data in one pass. - islandOffsetList = [] - - islandIdx = 0 - - while islandIdx < len(islandList): - minx, miny, maxx, maxy = boundsIsland(islandList[islandIdx]) - - w, h = maxx-minx, maxy-miny - - if USER_ISLAND_MARGIN: - minx -= USER_ISLAND_MARGIN# *w - miny -= USER_ISLAND_MARGIN# *h - maxx += USER_ISLAND_MARGIN# *w - maxy += USER_ISLAND_MARGIN# *h - - # recalc width and height - w, h = maxx-minx, maxy-miny - - if w < 0.00001 or h < 0.00001: - del islandList[islandIdx] - islandIdx -=1 - continue - - '''Save the offset to be applied later, - we could apply to the UVs now and allign them to the bottom left hand area - of the UV coords like the box packer imagines they are - but, its quicker just to remember their offset and - apply the packing and offset in 1 pass ''' - islandOffsetList.append((minx, miny)) - - # Add to boxList. use the island idx for the BOX id. - packBoxes.append([0, 0, w, h]) - islandIdx+=1 - - # Now we have a list of boxes to pack that syncs - # with the islands. - - #print '\tPacking UV Islands...' -#XXX Window.DrawProgressBar(0.7, 'Packing %i UV Islands...' % len(packBoxes) ) - - time1 = time.time() - packWidth, packHeight = geometry.box_pack_2d(packBoxes) - - # print 'Box Packing Time:', time.time() - time1 - - #if len(pa ckedLs) != len(islandList): - # raise "Error packed boxes differes from original length" - - #print '\tWriting Packed Data to faces' -#XXX Window.DrawProgressBar(0.8, 'Writing Packed Data to faces') - - # Sort by ID, so there in sync again - islandIdx = len(islandList) - # Having these here avoids devide by 0 - if islandIdx: - - if USER_STRETCH_ASPECT: - # Maximize to uv area?? Will write a normalize function. - xfactor = 1.0 / packWidth - yfactor = 1.0 / packHeight - else: - # Keep proportions. - xfactor = yfactor = 1.0 / max(packWidth, packHeight) - - while islandIdx: - islandIdx -=1 - # Write the packed values to the UV's - - xoffset = packBoxes[islandIdx][0] - islandOffsetList[islandIdx][0] - yoffset = packBoxes[islandIdx][1] - islandOffsetList[islandIdx][1] - - for f in islandList[islandIdx]: # Offsetting the UV's so they fit in there packed box - for uv in f.uv: - uv.x= (uv.x+xoffset) * xfactor - uv.y= (uv.y+yoffset) * yfactor - - - -def VectoQuat(vec): - vec = vec.normalized() - if abs(vec.x) > 0.5: - return vec.to_track_quat('Z', 'X') - else: - return vec.to_track_quat('Z', 'Y') - - -class thickface(object): - __slost__= 'v', 'uv', 'no', 'area', 'edge_keys' - def __init__(self, face, uvface, mesh_verts): - self.v = [mesh_verts[i] for i in face.vertices] - if len(self.v)==4: - self.uv = uvface.uv1, uvface.uv2, uvface.uv3, uvface.uv4 - else: - self.uv = uvface.uv1, uvface.uv2, uvface.uv3 - - self.no = face.normal - self.area = face.area - self.edge_keys = face.edge_keys - -global ob -ob = None -def main(context, island_margin, projection_limit): - global USER_FILL_HOLES - global USER_FILL_HOLES_QUALITY - global USER_STRETCH_ASPECT - global USER_ISLAND_MARGIN - -#XXX objects= bpy.data.scenes.active.objects - objects = context.selected_editable_objects - - - # we can will tag them later. - obList = [ob for ob in objects if ob.type == 'MESH'] - - # Face select object may not be selected. -#XXX ob = objects.active - ob= objects[0] - - if ob and (not ob.select) and ob.type == 'MESH': - # Add to the list - obList =[ob] - del objects - - if not obList: - raise('error, no selected mesh objects') - - # Create the variables. - USER_PROJECTION_LIMIT = projection_limit - USER_ONLY_SELECTED_FACES = (1) - USER_SHARE_SPACE = (1) # Only for hole filling. - USER_STRETCH_ASPECT = (1) # Only for hole filling. - USER_ISLAND_MARGIN = island_margin # Only for hole filling. - USER_FILL_HOLES = (0) - USER_FILL_HOLES_QUALITY = (50) # Only for hole filling. - USER_VIEW_INIT = (0) # Only for hole filling. - USER_AREA_WEIGHT = (1) # Only for hole filling. - - # Reuse variable - if len(obList) == 1: - ob = "Unwrap %i Selected Mesh" - else: - ob = "Unwrap %i Selected Meshes" - - # HACK, loop until mouse is lifted. - ''' - while Window.GetMouseButtons() != 0: - time.sleep(10) - ''' - -#XXX if not Draw.PupBlock(ob % len(obList), pup_block): -#XXX return -#XXX del ob - - # Convert from being button types - - USER_PROJECTION_LIMIT_CONVERTED = cos(USER_PROJECTION_LIMIT * DEG_TO_RAD) - USER_PROJECTION_LIMIT_HALF_CONVERTED = cos((USER_PROJECTION_LIMIT/2) * DEG_TO_RAD) - - - # Toggle Edit mode - is_editmode = (context.active_object.mode == 'EDIT') - if is_editmode: - bpy.ops.object.mode_set(mode='OBJECT') - # Assume face select mode! an annoying hack to toggle face select mode because Mesh dosent like faceSelectMode. - - if USER_SHARE_SPACE: - # Sort by data name so we get consistant results - obList.sort(key = lambda ob: ob.data.name) - collected_islandList= [] - -#XXX Window.WaitCursor(1) - - time1 = time.time() - - # Tag as False se we dont operate on teh same mesh twice. -#XXX bpy.data.meshes.tag = False - for me in bpy.data.meshes: - me.tag = False - - - for ob in obList: - me = ob.data - - if me.tag or me.library: - continue - - # Tag as used - me.tag = True - - if not me.uv_textures: # Mesh has no UV Coords, dont bother. - me.uv_textures.new() - - uv_layer = me.uv_textures.active.data - me_verts = list(me.vertices) - - if USER_ONLY_SELECTED_FACES: - meshFaces = [thickface(f, uv_layer[i], me_verts) for i, f in enumerate(me.faces) if f.select] - #else: - # meshFaces = map(thickface, me.faces) - - if not meshFaces: - continue - -#XXX Window.DrawProgressBar(0.1, 'SmartProj UV Unwrapper, mapping "%s", %i faces.' % (me.name, len(meshFaces))) - - # ======= - # Generate a projection list from face normals, this is ment to be smart :) - - # make a list of face props that are in sync with meshFaces - # Make a Face List that is sorted by area. - # meshFaces = [] - - # meshFaces.sort( lambda a, b: cmp(b.area , a.area) ) # Biggest first. - meshFaces.sort( key = lambda a: -a.area ) - - # remove all zero area faces - while meshFaces and meshFaces[-1].area <= SMALL_NUM: - # Set their UV's to 0,0 - for uv in meshFaces[-1].uv: - uv.zero() - meshFaces.pop() - - # Smallest first is slightly more efficient, but if the user cancels early then its better we work on the larger data. - - # Generate Projection Vecs - # 0d is 1.0 - # 180 IS -0.59846 - - - # Initialize projectVecs - if USER_VIEW_INIT: - # Generate Projection - projectVecs = [Vector(Window.GetViewVector()) * ob.matrix_world.inverted().to_3x3()] # We add to this allong the way - else: - projectVecs = [] - - newProjectVec = meshFaces[0].no - newProjectMeshFaces = [] # Popping stuffs it up. - - - # Predent that the most unique angke is ages away to start the loop off - mostUniqueAngle = -1.0 - - # This is popped - tempMeshFaces = meshFaces[:] - - - - # This while only gathers projection vecs, faces are assigned later on. - while 1: - # If theres none there then start with the largest face - - # add all the faces that are close. - for fIdx in range(len(tempMeshFaces)-1, -1, -1): - # Use half the angle limit so we dont overweight faces towards this - # normal and hog all the faces. - if newProjectVec.dot(tempMeshFaces[fIdx].no) > USER_PROJECTION_LIMIT_HALF_CONVERTED: - newProjectMeshFaces.append(tempMeshFaces.pop(fIdx)) - - # Add the average of all these faces normals as a projectionVec - averageVec = Vector((0.0, 0.0, 0.0)) - if USER_AREA_WEIGHT: - for fprop in newProjectMeshFaces: - averageVec += (fprop.no * fprop.area) - else: - for fprop in newProjectMeshFaces: - averageVec += fprop.no - - if averageVec.x != 0 or averageVec.y != 0 or averageVec.z != 0: # Avoid NAN - projectVecs.append(averageVec.normalized()) - - - # Get the next vec! - # Pick the face thats most different to all existing angles :) - mostUniqueAngle = 1.0 # 1.0 is 0d. no difference. - mostUniqueIndex = 0 # dummy - - for fIdx in range(len(tempMeshFaces)-1, -1, -1): - angleDifference = -1.0 # 180d difference. - - # Get the closest vec angle we are to. - for p in projectVecs: - temp_angle_diff= p.dot(tempMeshFaces[fIdx].no) - - if angleDifference < temp_angle_diff: - angleDifference= temp_angle_diff - - if angleDifference < mostUniqueAngle: - # We have a new most different angle - mostUniqueIndex = fIdx - mostUniqueAngle = angleDifference - - if mostUniqueAngle < USER_PROJECTION_LIMIT_CONVERTED: - #print 'adding', mostUniqueAngle, USER_PROJECTION_LIMIT, len(newProjectMeshFaces) - # Now weight the vector to all its faces, will give a more direct projection - # if the face its self was not representive of the normal from surrounding faces. - - newProjectVec = tempMeshFaces[mostUniqueIndex].no - newProjectMeshFaces = [tempMeshFaces.pop(mostUniqueIndex)] - - - else: - if len(projectVecs) >= 1: # Must have at least 2 projections - break - - - # If there are only zero area faces then its possible - # there are no projectionVecs - if not len(projectVecs): - Draw.PupMenu('error, no projection vecs where generated, 0 area faces can cause this.') - return - - faceProjectionGroupList =[[] for i in range(len(projectVecs)) ] - - # MAP and Arrange # We know there are 3 or 4 faces here - - for fIdx in range(len(meshFaces)-1, -1, -1): - fvec = meshFaces[fIdx].no - i = len(projectVecs) - - # Initialize first - bestAng = fvec.dot(projectVecs[0]) - bestAngIdx = 0 - - # Cycle through the remaining, first already done - while i-1: - i-=1 - - newAng = fvec.dot(projectVecs[i]) - if newAng > bestAng: # Reverse logic for dotvecs - bestAng = newAng - bestAngIdx = i - - # Store the area for later use. - faceProjectionGroupList[bestAngIdx].append(meshFaces[fIdx]) - - # Cull faceProjectionGroupList, - - - # Now faceProjectionGroupList is full of faces that face match the project Vecs list - for i in range(len(projectVecs)): - # Account for projectVecs having no faces. - if not faceProjectionGroupList[i]: - continue - - # Make a projection matrix from a unit length vector. - MatQuat = VectoQuat(projectVecs[i]) - - # Get the faces UV's from the projected vertex. - for f in faceProjectionGroupList[i]: - f_uv = f.uv - for j, v in enumerate(f.v): - # XXX - note, between mathutils in 2.4 and 2.5 the order changed. - f_uv[j][:] = (v.co * MatQuat)[:2] - - - if USER_SHARE_SPACE: - # Should we collect and pack later? - islandList = getUvIslands(faceProjectionGroupList, me) - collected_islandList.extend(islandList) - - else: - # Should we pack the islands for this 1 object? - islandList = getUvIslands(faceProjectionGroupList, me) - packIslands(islandList) - - - # update the mesh here if we need to. - - # We want to pack all in 1 go, so pack now - if USER_SHARE_SPACE: -#XXX Window.DrawProgressBar(0.9, "Box Packing for all objects...") - packIslands(collected_islandList) - - print("Smart Projection time: %.2f" % (time.time() - time1)) - # Window.DrawProgressBar(0.9, "Smart Projections done, time: %.2f sec." % (time.time() - time1)) - - if is_editmode: - bpy.ops.object.mode_set(mode='EDIT') - -#XXX Window.DrawProgressBar(1.0, "") -#XXX Window.WaitCursor(0) -#XXX Window.RedrawAll() - -""" - pup_block = [\ - 'Projection',\ -* ('Angle Limit:', USER_PROJECTION_LIMIT, 1, 89, ''),\ - ('Selected Faces Only', USER_ONLY_SELECTED_FACES, 'Use only selected faces from all selected meshes.'),\ - ('Init from view', USER_VIEW_INIT, 'The first projection will be from the view vector.'),\ - ('Area Weight', USER_AREA_WEIGHT, 'Weight projections vector by face area.'),\ - '',\ - '',\ - '',\ - 'UV Layout',\ - ('Share Tex Space', USER_SHARE_SPACE, 'Objects Share texture space, map all objects into 1 uvmap.'),\ - ('Stretch to bounds', USER_STRETCH_ASPECT, 'Stretch the final output to texture bounds.'),\ -* ('Island Margin:', USER_ISLAND_MARGIN, 0.0, 0.5, ''),\ - 'Fill in empty areas',\ - ('Fill Holes', USER_FILL_HOLES, 'Fill in empty areas reduced texture waistage (slow).'),\ - ('Fill Quality:', USER_FILL_HOLES_QUALITY, 1, 100, 'Depends on fill holes, how tightly to fill UV holes, (higher is slower)'),\ - ] -""" - -from bpy.props import * - - -class SmartProject(bpy.types.Operator): - '''This script projection unwraps the selected faces of a mesh. it operates on all selected mesh objects, and can be used unwrap selected faces, or all faces.''' - bl_idname = "uv.smart_project" - bl_label = "Smart UV Project" - bl_options = {'REGISTER', 'UNDO'} - - angle_limit = FloatProperty(name="Angle Limit", - description="lower for more projection groups, higher for less distortion.", - default=66.0, min=1.0, max=89.0) - - island_margin = FloatProperty(name="Island Margin", - description="Margin to reduce bleed from adjacent islands.", - default=0.0, min=0.0, max=1.0) - - @classmethod - def poll(cls, context): - return context.active_object != None - - def execute(self, context): - main(context, self.island_margin, self.angle_limit) - return {'FINISHED'} - - -# Add to a menu -menu_func = (lambda self, context: self.layout.operator(SmartProject.bl_idname, - text="Smart Project")) - - -def register(): - bpy.utils.register_module(__name__) - bpy.types.VIEW3D_MT_uv_map.append(menu_func) - - -def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.VIEW3D_MT_uv_map.remove(menu_func) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/vertexpaint_dirt.py b/release/scripts/op/vertexpaint_dirt.py deleted file mode 100644 index d5060e913ae..00000000000 --- a/release/scripts/op/vertexpaint_dirt.py +++ /dev/null @@ -1,190 +0,0 @@ -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# Script copyright (C) Campbell J Barton -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -# - -# History -# -# Originally written by Campbell Barton aka ideasman42 -# -# 2009-11-01: * 2.5 port by Keith "Wahooney" Boshoff -# * Replaced old method with my own, speed is similar (about 0.001 sec on Suzanne) -# but results are far more accurate -# - -import bpy -import math -import time - -from mathutils import Vector -from bpy.props import * - - -def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean, dirt_only): -## Window.WaitCursor(1) - - #BPyMesh.meshCalcNormals(me) - - vert_tone = [0.0] * len(me.vertices) - - min_tone = 180.0 - max_tone = 0.0 - - # create lookup table for each vertex's connected vertices (via edges) - con = [] - - con = [[] for i in range(len(me.vertices))] - - # add connected verts - for e in me.edges: - con[e.vertices[0]].append(e.vertices[1]) - con[e.vertices[1]].append(e.vertices[0]) - - for i, v in enumerate(me.vertices): - vec = Vector() - no = v.normal - co = v.co - - # get the direction of the vectors between the vertex and it's connected vertices - for c in con[i]: - vec += (me.vertices[c].co - co).normalized() - - # normalize the vector by dividing by the number of connected verts - tot_con = len(con[i]) - - if tot_con == 0: - continue - - vec /= tot_con - - # angle is the acos of the dot product between vert and connected verts normals - ang = math.acos(no.dot(vec)) - - # enforce min/max - ang = max(clamp_dirt, ang) - - if not dirt_only: - ang = min(clamp_clean, ang) - - vert_tone[i] = ang - - # blur tones - for i in range(blur_iterations): - # backup the original tones - orig_vert_tone = list(vert_tone) - - # use connected verts look up for blurring - for j, c in enumerate(con): - for v in c: - vert_tone[j] += blur_strength * orig_vert_tone[v] - - vert_tone[j] /= len(c) * blur_strength + 1 - - min_tone = min(vert_tone) - max_tone = max(vert_tone) - - # debug information - # print(min_tone * 2 * math.pi) - # print(max_tone * 2 * math.pi) - # print(clamp_clean) - # print(clamp_dirt) - - tone_range = max_tone - min_tone - - if not tone_range: - return - - active_col_layer = None - - if len(me.vertex_colors): - for lay in me.vertex_colors: - if lay.active: - active_col_layer = lay.data - else: - bpy.ops.mesh.vertex_color_add() - me.vertex_colors[0].active = True - active_col_layer = me.vertex_colors[0].data - - if not active_col_layer: - return('CANCELLED', ) - - for i, f in enumerate(me.faces): - if not me.use_paint_mask or f.select: - - f_col = active_col_layer[i] - - f_col = [f_col.color1, f_col.color2, f_col.color3, f_col.color4] - - for j, v in enumerate(f.vertices): - col = f_col[j] - tone = vert_tone[me.vertices[v].index] - tone = (tone - min_tone) / tone_range - - if dirt_only: - tone = min(tone, 0.5) - tone *= 2 - - col[0] = tone * col[0] - col[1] = tone * col[1] - col[2] = tone * col[2] - -## Window.WaitCursor(0) - - -class VertexPaintDirt(bpy.types.Operator): - - bl_idname = "paint.vertex_color_dirt" - bl_label = "Dirty Vertex Colors" - bl_options = {'REGISTER', 'UNDO'} - - blur_strength = FloatProperty(name="Blur Strength", description="Blur strength per iteration", default=1.0, min=0.01, max=1.0) - blur_iterations = IntProperty(name="Blur Iterations", description="Number times to blur the colors. (higher blurs more)", default=1, min=0, max=40) - clean_angle = FloatProperty(name="Highlight Angle", description="Less then 90 limits the angle used in the tonal range", default=180.0, min=0.0, max=180.0) - dirt_angle = FloatProperty(name="Dirt Angle", description="Less then 90 limits the angle used in the tonal range", default=0.0, min=0.0, max=180.0) - dirt_only = BoolProperty(name="Dirt Only", description="Dont calculate cleans for convex areas", default=False) - - def execute(self, context): - obj = context.object - - if not obj or obj.type != 'MESH': - print('Error, no active mesh object, aborting') - return('CANCELLED',) - - mesh = obj.data - - t = time.time() - - applyVertexDirt(mesh, self.blur_iterations, self.blur_strength, math.radians(self.dirt_angle), math.radians(self.clean_angle), self.dirt_only) - - print('Dirt calculated in %.6f' % (time.time() - t)) - - return {'FINISHED'} - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py deleted file mode 100644 index 89e9641ba93..00000000000 --- a/release/scripts/op/wm.py +++ /dev/null @@ -1,859 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# - -import bpy - -from bpy.props import * -from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear - - -class MESH_OT_delete_edgeloop(bpy.types.Operator): - '''Delete an edge loop by merging the faces on each side to a single face loop''' - bl_idname = "mesh.delete_edgeloop" - bl_label = "Delete Edge Loop" - - def execute(self, context): - if 'FINISHED' in bpy.ops.transform.edge_slide(value=1.0): - bpy.ops.mesh.select_more() - bpy.ops.mesh.remove_doubles() - return {'FINISHED'} - - return {'CANCELLED'} - -rna_path_prop = StringProperty(name="Context Attributes", - description="rna context string", maxlen=1024, default="") - -rna_reverse_prop = BoolProperty(name="Reverse", - description="Cycle backwards", default=False) - -rna_relative_prop = BoolProperty(name="Relative", - description="Apply relative to the current value (delta)", - default=False) - - -def context_path_validate(context, data_path): - import sys - try: - value = eval("context.%s" % data_path) if data_path else Ellipsis - except AttributeError: - if "'NoneType'" in str(sys.exc_info()[1]): - # One of the items in the rna path is None, just ignore this - value = Ellipsis - else: - # We have a real error in the rna path, dont ignore that - raise - - return value - - -def execute_context_assign(self, context): - if context_path_validate(context, self.data_path) is Ellipsis: - return {'PASS_THROUGH'} - - if getattr(self, "relative", False): - exec("context.%s+=self.value" % self.data_path) - else: - exec("context.%s=self.value" % self.data_path) - - return {'FINISHED'} - - -class BRUSH_OT_set_active_number(bpy.types.Operator): - '''Set active sculpt/paint brush from it's number''' - bl_idname = "brush.set_active_number" - bl_label = "Set Brush Number" - - mode = StringProperty(name="mode", - description="Paint mode to set brush for", maxlen=1024) - number = IntProperty(name="number", - description="Brush number") - - _attr_dict = {"sculpt": "use_paint_sculpt", - "vertex_paint": "use_paint_vertex", - "weight_paint": "use_paint_weight", - "image_paint": "use_paint_texture"} - - def execute(self, context): - attr = self._attr_dict.get(self.mode) - if attr is None: - return {'CANCELLED'} - - for i, brush in enumerate((cur for cur in bpy.data.brushes if getattr(cur, attr))): - if i == self.number: - getattr(context.tool_settings, self.mode).brush = brush - return {'FINISHED'} - - return {'CANCELLED'} - - -class WM_OT_context_set_boolean(bpy.types.Operator): - '''Set a context value.''' - bl_idname = "wm.context_set_boolean" - bl_label = "Context Set Boolean" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value = BoolProperty(name="Value", - description="Assignment value", default=True) - - execute = execute_context_assign - - -class WM_OT_context_set_int(bpy.types.Operator): # same as enum - '''Set a context value.''' - bl_idname = "wm.context_set_int" - bl_label = "Context Set" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value = IntProperty(name="Value", description="Assign value", default=0) - relative = rna_relative_prop - - execute = execute_context_assign - - -class WM_OT_context_scale_int(bpy.types.Operator): - '''Scale an int context value.''' - bl_idname = "wm.context_scale_int" - bl_label = "Context Set" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value = FloatProperty(name="Value", description="Assign value", default=1.0) - always_step = BoolProperty(name="Always Step", - description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.", - default=True) - - def execute(self, context): - if context_path_validate(context, self.data_path) is Ellipsis: - return {'PASS_THROUGH'} - - value = self.value - data_path = self.data_path - - if value == 1.0: # nothing to do - return {'CANCELLED'} - - if getattr(self, "always_step", False): - if value > 1.0: - add = "1" - func = "max" - else: - add = "-1" - func = "min" - exec("context.%s = %s(round(context.%s * value), context.%s + %s)" % (data_path, func, data_path, data_path, add)) - else: - exec("context.%s *= value" % self.data_path) - - return {'FINISHED'} - - -class WM_OT_context_set_float(bpy.types.Operator): # same as enum - '''Set a context value.''' - bl_idname = "wm.context_set_float" - bl_label = "Context Set Float" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value = FloatProperty(name="Value", - description="Assignment value", default=0.0) - relative = rna_relative_prop - - execute = execute_context_assign - - -class WM_OT_context_set_string(bpy.types.Operator): # same as enum - '''Set a context value.''' - bl_idname = "wm.context_set_string" - bl_label = "Context Set String" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value = StringProperty(name="Value", - description="Assign value", maxlen=1024, default="") - - execute = execute_context_assign - - -class WM_OT_context_set_enum(bpy.types.Operator): - '''Set a context value.''' - bl_idname = "wm.context_set_enum" - bl_label = "Context Set Enum" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value = StringProperty(name="Value", - description="Assignment value (as a string)", - maxlen=1024, default="") - - execute = execute_context_assign - - -class WM_OT_context_set_value(bpy.types.Operator): - '''Set a context value.''' - bl_idname = "wm.context_set_value" - bl_label = "Context Set Value" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value = StringProperty(name="Value", - description="Assignment value (as a string)", - maxlen=1024, default="") - - def execute(self, context): - if context_path_validate(context, self.data_path) is Ellipsis: - return {'PASS_THROUGH'} - exec("context.%s=%s" % (self.data_path, self.value)) - return {'FINISHED'} - - -class WM_OT_context_toggle(bpy.types.Operator): - '''Toggle a context value.''' - bl_idname = "wm.context_toggle" - bl_label = "Context Toggle" - bl_options = {'UNDO'} - - data_path = rna_path_prop - - def execute(self, context): - - if context_path_validate(context, self.data_path) is Ellipsis: - return {'PASS_THROUGH'} - - exec("context.%s=not (context.%s)" % - (self.data_path, self.data_path)) - - return {'FINISHED'} - - -class WM_OT_context_toggle_enum(bpy.types.Operator): - '''Toggle a context value.''' - bl_idname = "wm.context_toggle_enum" - bl_label = "Context Toggle Values" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value_1 = StringProperty(name="Value", \ - description="Toggle enum", maxlen=1024, default="") - - value_2 = StringProperty(name="Value", \ - description="Toggle enum", maxlen=1024, default="") - - def execute(self, context): - - if context_path_validate(context, self.data_path) is Ellipsis: - return {'PASS_THROUGH'} - - exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \ - (self.data_path, self.value_1,\ - self.value_2, self.data_path, - self.value_2)) - - return {'FINISHED'} - - -class WM_OT_context_cycle_int(bpy.types.Operator): - '''Set a context value. Useful for cycling active material, ''' - '''vertex keys, groups' etc.''' - bl_idname = "wm.context_cycle_int" - bl_label = "Context Int Cycle" - bl_options = {'UNDO'} - - data_path = rna_path_prop - reverse = rna_reverse_prop - - def execute(self, context): - data_path = self.data_path - value = context_path_validate(context, data_path) - if value is Ellipsis: - return {'PASS_THROUGH'} - - if self.reverse: - value -= 1 - else: - value += 1 - - exec("context.%s=value" % data_path) - - if value != eval("context.%s" % data_path): - # relies on rna clamping int's out of the range - if self.reverse: - value = (1 << 31) - 1 - else: - value = -1 << 31 - - exec("context.%s=value" % data_path) - - return {'FINISHED'} - - -class WM_OT_context_cycle_enum(bpy.types.Operator): - '''Toggle a context value.''' - bl_idname = "wm.context_cycle_enum" - bl_label = "Context Enum Cycle" - bl_options = {'UNDO'} - - data_path = rna_path_prop - reverse = rna_reverse_prop - - def execute(self, context): - - value = context_path_validate(context, self.data_path) - if value is Ellipsis: - return {'PASS_THROUGH'} - - orig_value = value - - # Have to get rna enum values - rna_struct_str, rna_prop_str = self.data_path.rsplit('.', 1) - i = rna_prop_str.find('[') - - # just incse we get "context.foo.bar[0]" - if i != -1: - rna_prop_str = rna_prop_str[0:i] - - rna_struct = eval("context.%s.rna_type" % rna_struct_str) - - rna_prop = rna_struct.properties[rna_prop_str] - - if type(rna_prop) != bpy.types.EnumProperty: - raise Exception("expected an enum property") - - enums = rna_struct.properties[rna_prop_str].items.keys() - orig_index = enums.index(orig_value) - - # Have the info we need, advance to the next item - if self.reverse: - if orig_index == 0: - advance_enum = enums[-1] - else: - advance_enum = enums[orig_index - 1] - else: - if orig_index == len(enums) - 1: - advance_enum = enums[0] - else: - advance_enum = enums[orig_index + 1] - - # set the new value - exec("context.%s=advance_enum" % self.data_path) - return {'FINISHED'} - - -class WM_OT_context_cycle_array(bpy.types.Operator): - '''Set a context array value. - Useful for cycling the active mesh edit mode.''' - bl_idname = "wm.context_cycle_array" - bl_label = "Context Array Cycle" - bl_options = {'UNDO'} - - data_path = rna_path_prop - reverse = rna_reverse_prop - - def execute(self, context): - data_path = self.data_path - value = context_path_validate(context, data_path) - if value is Ellipsis: - return {'PASS_THROUGH'} - - def cycle(array): - if self.reverse: - array.insert(0, array.pop()) - else: - array.append(array.pop(0)) - return array - - exec("context.%s=cycle(context.%s[:])" % (data_path, data_path)) - - return {'FINISHED'} - - -class WM_MT_context_menu_enum(bpy.types.Menu): - bl_label = "" - data_path = "" # BAD DESIGN, set from operator below. - - def draw(self, context): - data_path = self.data_path - value = context_path_validate(bpy.context, data_path) - if value is Ellipsis: - return {'PASS_THROUGH'} - base_path, prop_string = data_path.rsplit(".", 1) - value_base = context_path_validate(context, base_path) - - values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].items] - - for name, identifier in values: - prop = self.layout.operator("wm.context_set_enum", text=name) - prop.data_path = data_path - prop.value = identifier - - -class WM_OT_context_menu_enum(bpy.types.Operator): - bl_idname = "wm.context_menu_enum" - bl_label = "Context Enum Menu" - bl_options = {'UNDO'} - data_path = rna_path_prop - - def execute(self, context): - data_path = self.data_path - WM_MT_context_menu_enum.data_path = data_path - bpy.ops.wm.call_menu(name="WM_MT_context_menu_enum") - return {'PASS_THROUGH'} - - -class WM_OT_context_set_id(bpy.types.Operator): - '''Toggle a context value.''' - bl_idname = "wm.context_set_id" - bl_label = "Set Library ID" - bl_options = {'UNDO'} - - data_path = rna_path_prop - value = StringProperty(name="Value", - description="Assign value", maxlen=1024, default="") - - def execute(self, context): - value = self.value - data_path = self.data_path - - # match the pointer type from the target property to bpy.data.* - # so we lookup the correct list. - data_path_base, data_path_prop = data_path.rsplit(".", 1) - data_prop_rna = eval("context.%s" % data_path_base).rna_type.properties[data_path_prop] - data_prop_rna_type = data_prop_rna.fixed_type - - id_iter = None - - for prop in bpy.data.rna_type.properties: - if prop.rna_type.identifier == "CollectionProperty": - if prop.fixed_type == data_prop_rna_type: - id_iter = prop.identifier - break - - if id_iter: - value_id = getattr(bpy.data, id_iter).get(value) - exec("context.%s=value_id" % data_path) - - return {'FINISHED'} - - -doc_id = StringProperty(name="Doc ID", - description="", maxlen=1024, default="", options={'HIDDEN'}) - -doc_new = StringProperty(name="Edit Description", - description="", maxlen=1024, default="") - - -class WM_OT_context_modal_mouse(bpy.types.Operator): - '''Adjust arbitrary values with mouse input''' - bl_idname = "wm.context_modal_mouse" - bl_label = "Context Modal Mouse" - - data_path_iter = StringProperty(description="The data path relative to the context, must point to an iterable.") - data_path_item = StringProperty(description="The data path from each iterable to the value (int or float)") - input_scale = FloatProperty(default=0.01, description="Scale the mouse movement by this value before applying the delta") - invert = BoolProperty(default=False, description="Invert the mouse input") - initial_x = IntProperty(options={'HIDDEN'}) - - def _values_store(self, context): - data_path_iter = self.data_path_iter - data_path_item = self.data_path_item - - self._values = values = {} - - for item in getattr(context, data_path_iter): - try: - value_orig = eval("item." + data_path_item) - except: - continue - - # check this can be set, maybe this is library data. - try: - exec("item.%s = %s" % (data_path_item, value_orig)) - except: - continue - - values[item] = value_orig - - def _values_delta(self, delta): - delta *= self.input_scale - if self.invert: - delta = - delta - - data_path_item = self.data_path_item - for item, value_orig in self._values.items(): - if type(value_orig) == int: - exec("item.%s = int(%d)" % (data_path_item, round(value_orig + delta))) - else: - exec("item.%s = %f" % (data_path_item, value_orig + delta)) - - def _values_restore(self): - data_path_item = self.data_path_item - for item, value_orig in self._values.items(): - exec("item.%s = %s" % (data_path_item, value_orig)) - - self._values.clear() - - def _values_clear(self): - self._values.clear() - - def modal(self, context, event): - event_type = event.type - - if event_type == 'MOUSEMOVE': - delta = event.mouse_x - self.initial_x - self._values_delta(delta) - - elif 'LEFTMOUSE' == event_type: - self._values_clear() - return {'FINISHED'} - - elif event_type in ('RIGHTMOUSE', 'ESC'): - self._values_restore() - return {'FINISHED'} - - return {'RUNNING_MODAL'} - - def invoke(self, context, event): - self._values_store(context) - - if not self._values: - self.report({'WARNING'}, "Nothing to operate on: %s[ ].%s" % - (self.data_path_iter, self.data_path_item)) - - return {'CANCELLED'} - else: - self.initial_x = event.mouse_x - - context.window_manager.modal_handler_add(self) - return {'RUNNING_MODAL'} - - -class WM_OT_url_open(bpy.types.Operator): - "Open a website in the Webbrowser" - bl_idname = "wm.url_open" - bl_label = "" - - url = StringProperty(name="URL", description="URL to open") - - def execute(self, context): - import webbrowser - webbrowser.open(self.url) - return {'FINISHED'} - - -class WM_OT_path_open(bpy.types.Operator): - "Open a path in a file browser" - bl_idname = "wm.path_open" - bl_label = "" - - filepath = StringProperty(name="File Path", maxlen=1024, subtype='FILE_PATH') - - def execute(self, context): - import sys - import os - import subprocess - - filepath = bpy.path.abspath(self.filepath) - filepath = os.path.normpath(filepath) - - if not os.path.exists(filepath): - self.report({'ERROR'}, "File '%s' not found" % filepath) - return {'CANCELLED'} - - if sys.platform == 'win32': - subprocess.Popen(['start', filepath], shell=True) - elif sys.platform == 'darwin': - subprocess.Popen(['open', filepath]) - else: - try: - subprocess.Popen(['xdg-open', filepath]) - except OSError: - # xdg-open *should* be supported by recent Gnome, KDE, Xfce - pass - - return {'FINISHED'} - - -class WM_OT_doc_view(bpy.types.Operator): - '''Load online reference docs''' - bl_idname = "wm.doc_view" - bl_label = "View Documentation" - - doc_id = doc_id - _prefix = "http://www.blender.org/documentation/blender_python_api_%s" % "_".join(str(v) for v in bpy.app.version) - - def _nested_class_string(self, class_string): - ls = [] - class_obj = getattr(bpy.types, class_string, None).bl_rna - while class_obj: - ls.insert(0, class_obj) - class_obj = class_obj.nested - return '.'.join(class_obj.identifier for class_obj in ls) - - def execute(self, context): - id_split = self.doc_id.split('.') - if len(id_split) == 1: # rna, class - url = '%s/bpy.types.%s.html' % (self._prefix, id_split[0]) - elif len(id_split) == 2: # rna, class.prop - class_name, class_prop = id_split - - if hasattr(bpy.types, class_name.upper() + '_OT_' + class_prop): - url = '%s/bpy.ops.%s.html#bpy.ops.%s.%s' % \ - (self._prefix, class_name, class_name, class_prop) - else: - # It so happens that epydoc nests these, not sphinx - # class_name_full = self._nested_class_string(class_name) - url = '%s/bpy.types.%s.html#bpy.types.%s.%s' % \ - (self._prefix, class_name, class_name, class_prop) - - else: - return {'PASS_THROUGH'} - - import webbrowser - webbrowser.open(url) - - return {'FINISHED'} - - -class WM_OT_doc_edit(bpy.types.Operator): - '''Load online reference docs''' - bl_idname = "wm.doc_edit" - bl_label = "Edit Documentation" - - doc_id = doc_id - doc_new = doc_new - - _url = "http://www.mindrones.com/blender/svn/xmlrpc.php" - - def _send_xmlrpc(self, data_dict): - print("sending data:", data_dict) - - import xmlrpc.client - user = 'blenderuser' - pwd = 'blender>user' - - docblog = xmlrpc.client.ServerProxy(self._url) - docblog.metaWeblog.newPost(1, user, pwd, data_dict, 1) - - def execute(self, context): - - doc_id = self.doc_id - doc_new = self.doc_new - - class_name, class_prop = doc_id.split('.') - - if not doc_new: - self.report({'ERROR'}, "No input given for '%s'" % doc_id) - return {'CANCELLED'} - - # check if this is an operator - op_name = class_name.upper() + '_OT_' + class_prop - op_class = getattr(bpy.types, op_name, None) - - # Upload this to the web server - upload = {} - - if op_class: - rna = op_class.bl_rna - doc_orig = rna.description - if doc_orig == doc_new: - return {'RUNNING_MODAL'} - - print("op - old:'%s' -> new:'%s'" % (doc_orig, doc_new)) - upload["title"] = 'OPERATOR %s:%s' % (doc_id, doc_orig) - else: - rna = getattr(bpy.types, class_name).bl_rna - doc_orig = rna.properties[class_prop].description - if doc_orig == doc_new: - return {'RUNNING_MODAL'} - - print("rna - old:'%s' -> new:'%s'" % (doc_orig, doc_new)) - upload["title"] = 'RNA %s:%s' % (doc_id, doc_orig) - - upload["description"] = doc_new - - self._send_xmlrpc(upload) - - return {'FINISHED'} - - def draw(self, context): - layout = self.layout - layout.label(text="Descriptor ID: '%s'" % self.doc_id) - layout.prop(self, "doc_new", text="") - - def invoke(self, context, event): - wm = context.window_manager - return wm.invoke_props_dialog(self, width=600) - - -from bpy.props import * - - -rna_path = StringProperty(name="Property Edit", - description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'}) - -rna_value = StringProperty(name="Property Value", - description="Property value edit", maxlen=1024, default="") - -rna_property = StringProperty(name="Property Name", - description="Property name edit", maxlen=1024, default="") - -rna_min = FloatProperty(name="Min", default=0.0, precision=3) -rna_max = FloatProperty(name="Max", default=1.0, precision=3) - - -class WM_OT_properties_edit(bpy.types.Operator): - '''Internal use (edit a property data_path)''' - bl_idname = "wm.properties_edit" - bl_label = "Edit Property" - bl_options = {'REGISTER'} # only because invoke_props_popup requires. - - data_path = rna_path - property = rna_property - value = rna_value - min = rna_min - max = rna_max - description = StringProperty(name="Tip", default="") - - def execute(self, context): - data_path = self.data_path - value = self.value - prop = self.property - prop_old = self._last_prop[0] - - try: - value_eval = eval(value) - except: - value_eval = value - - # First remove - item = eval("context.%s" % data_path) - - rna_idprop_ui_prop_clear(item, prop_old) - exec_str = "del item['%s']" % prop_old - # print(exec_str) - exec(exec_str) - - # Reassign - exec_str = "item['%s'] = %s" % (prop, repr(value_eval)) - # print(exec_str) - exec(exec_str) - self._last_prop[:] = [prop] - - prop_type = type(item[prop]) - - prop_ui = rna_idprop_ui_prop_get(item, prop) - - if prop_type in (float, int): - - prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.min) - prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.max) - - prop_ui['description'] = self.description - - return {'FINISHED'} - - def invoke(self, context, event): - - self._last_prop = [self.property] - - item = eval("context.%s" % self.data_path) - - # setup defaults - prop_ui = rna_idprop_ui_prop_get(item, self.property, False) # dont create - if prop_ui: - self.min = prop_ui.get("min", -1000000000) - self.max = prop_ui.get("max", 1000000000) - self.description = prop_ui.get("description", "") - - wm = context.window_manager - return wm.invoke_props_dialog(self) - - -class WM_OT_properties_add(bpy.types.Operator): - '''Internal use (edit a property data_path)''' - bl_idname = "wm.properties_add" - bl_label = "Add Property" - - data_path = rna_path - - def execute(self, context): - item = eval("context.%s" % self.data_path) - - def unique_name(names): - prop = 'prop' - prop_new = prop - i = 1 - while prop_new in names: - prop_new = prop + str(i) - i += 1 - - return prop_new - - property = unique_name(item.keys()) - - item[property] = 1.0 - return {'FINISHED'} - - -class WM_OT_properties_remove(bpy.types.Operator): - '''Internal use (edit a property data_path)''' - bl_idname = "wm.properties_remove" - bl_label = "Remove Property" - - data_path = rna_path - property = rna_property - - def execute(self, context): - item = eval("context.%s" % self.data_path) - del item[self.property] - return {'FINISHED'} - - -class WM_OT_keyconfig_activate(bpy.types.Operator): - bl_idname = "wm.keyconfig_activate" - bl_label = "Activate Keyconfig" - - filepath = StringProperty(name="File Path", maxlen=1024) - - def execute(self, context): - bpy.utils.keyconfig_set(self.filepath) - return {'FINISHED'} - - -class WM_OT_sysinfo(bpy.types.Operator): - '''Generate System Info''' - bl_idname = "wm.sysinfo" - bl_label = "System Info" - - def execute(self, context): - import sys_info - sys_info.write_sysinfo(self) - return {'FINISHED'} - - -def register(): - bpy.utils.register_module(__name__) - - -def unregister(): - bpy.utils.unregister_module(__name__) - -if __name__ == "__main__": - register() diff --git a/release/scripts/presets/interaction/maya.py b/release/scripts/presets/interaction/maya.py index 8f5c4574b31..62084645081 100644 --- a/release/scripts/presets/interaction/maya.py +++ b/release/scripts/presets/interaction/maya.py @@ -1,382 +1,6 @@ -# Configuration Maya +# Configuration Blender import bpy -wm = bpy.context.window_manager -kc = wm.keyconfigs.new('Maya') - -# Map 3D View -km = kc.keymaps.new('3D View', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.items.new('view3d.manipulator', 'LEFTMOUSE', 'PRESS', any=True) -kmi.properties.release_confirm = True -kmi = km.items.new('view3d.cursor3d', 'ACTIONMOUSE', 'PRESS') -kmi = km.items.new('view3d.rotate', 'LEFTMOUSE', 'PRESS', alt=True) -kmi = km.items.new('view3d.move', 'MIDDLEMOUSE', 'PRESS', alt=True) -kmi = km.items.new('view3d.zoom', 'RIGHTMOUSE', 'PRESS', alt=True) -kmi = km.items.new('view3d.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.items.new('view3d.view_center_cursor', 'NUMPAD_PERIOD', 'PRESS', ctrl=True) -kmi = km.items.new('view3d.fly', 'F', 'PRESS', shift=True) -kmi = km.items.new('view3d.smoothview', 'TIMER1', 'ANY', any=True) -kmi = km.items.new('view3d.rotate', 'TRACKPADPAN', 'ANY', alt=True) -kmi = km.items.new('view3d.rotate', 'MOUSEROTATE', 'ANY') -kmi = km.items.new('view3d.move', 'TRACKPADPAN', 'ANY') -kmi = km.items.new('view3d.zoom', 'TRACKPADZOOM', 'ANY') -kmi = km.items.new('view3d.zoom', 'NUMPAD_PLUS', 'PRESS') -kmi.properties.delta = 1 -kmi = km.items.new('view3d.zoom', 'NUMPAD_MINUS', 'PRESS') -kmi.properties.delta = -1 -kmi = km.items.new('view3d.zoom', 'EQUAL', 'PRESS', ctrl=True) -kmi.properties.delta = 1 -kmi = km.items.new('view3d.zoom', 'MINUS', 'PRESS', ctrl=True) -kmi.properties.delta = -1 -kmi = km.items.new('view3d.zoom', 'WHEELINMOUSE', 'PRESS') -kmi.properties.delta = 1 -kmi = km.items.new('view3d.zoom', 'WHEELOUTMOUSE', 'PRESS') -kmi.properties.delta = -1 -kmi = km.items.new('view3d.view_all', 'HOME', 'PRESS') -kmi.properties.center = False -kmi = km.items.new('view3d.view_all', 'C', 'PRESS', shift=True) -kmi.properties.center = True -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_0', 'PRESS') -kmi.properties.type = 'CAMERA' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_1', 'PRESS') -kmi.properties.type = 'FRONT' -kmi = km.items.new('view3d.view_orbit', 'NUMPAD_2', 'PRESS') -kmi.properties.type = 'ORBITDOWN' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS') -kmi.properties.type = 'RIGHT' -kmi = km.items.new('view3d.view_orbit', 'NUMPAD_4', 'PRESS') -kmi.properties.type = 'ORBITLEFT' -kmi = km.items.new('view3d.view_persportho', 'NUMPAD_5', 'PRESS') -kmi = km.items.new('view3d.view_orbit', 'NUMPAD_6', 'PRESS') -kmi.properties.type = 'ORBITRIGHT' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS') -kmi.properties.type = 'TOP' -kmi = km.items.new('view3d.view_orbit', 'NUMPAD_8', 'PRESS') -kmi.properties.type = 'ORBITUP' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', ctrl=True) -kmi.properties.type = 'BACK' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', ctrl=True) -kmi.properties.type = 'LEFT' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', ctrl=True) -kmi.properties.type = 'BOTTOM' -kmi = km.items.new('view3d.view_pan', 'NUMPAD_2', 'PRESS', ctrl=True) -kmi.properties.type = 'PANDOWN' -kmi = km.items.new('view3d.view_pan', 'NUMPAD_4', 'PRESS', ctrl=True) -kmi.properties.type = 'PANLEFT' -kmi = km.items.new('view3d.view_pan', 'NUMPAD_6', 'PRESS', ctrl=True) -kmi.properties.type = 'PANRIGHT' -kmi = km.items.new('view3d.view_pan', 'NUMPAD_8', 'PRESS', ctrl=True) -kmi.properties.type = 'PANUP' -kmi = km.items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', ctrl=True) -kmi.properties.type = 'PANRIGHT' -kmi = km.items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True) -kmi.properties.type = 'PANLEFT' -kmi = km.items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', shift=True) -kmi.properties.type = 'PANUP' -kmi = km.items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', shift=True) -kmi.properties.type = 'PANDOWN' -kmi = km.items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', ctrl=True, alt=True) -kmi.properties.type = 'ORBITLEFT' -kmi = km.items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True, alt=True) -kmi.properties.type = 'ORBITRIGHT' -kmi = km.items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', shift=True, alt=True) -kmi.properties.type = 'ORBITUP' -kmi = km.items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', shift=True, alt=True) -kmi.properties.type = 'ORBITDOWN' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', shift=True) -kmi.properties.align_active = True -kmi.properties.type = 'FRONT' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', shift=True) -kmi.properties.align_active = True -kmi.properties.type = 'RIGHT' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', shift=True) -kmi.properties.align_active = True -kmi.properties.type = 'TOP' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', shift=True, ctrl=True) -kmi.properties.align_active = True -kmi.properties.type = 'BACK' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', shift=True, ctrl=True) -kmi.properties.align_active = True -kmi.properties.type = 'LEFT' -kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', shift=True, ctrl=True) -kmi.properties.align_active = True -kmi.properties.type = 'BOTTOM' -kmi = km.items.new('view3d.localview', 'NUMPAD_SLASH', 'PRESS') -kmi = km.items.new('view3d.layers', 'ACCENT_GRAVE', 'PRESS') -kmi.properties.nr = 0 -kmi = km.items.new('view3d.layers', 'ONE', 'PRESS', any=True) -kmi.properties.nr = 1 -kmi = km.items.new('view3d.layers', 'TWO', 'PRESS', any=True) -kmi.properties.nr = 2 -kmi = km.items.new('view3d.layers', 'THREE', 'PRESS', any=True) -kmi.properties.nr = 3 -kmi = km.items.new('view3d.layers', 'FOUR', 'PRESS', any=True) -kmi.properties.nr = 4 -kmi = km.items.new('view3d.layers', 'FIVE', 'PRESS', any=True) -kmi.properties.nr = 5 -kmi = km.items.new('view3d.layers', 'SIX', 'PRESS', any=True) -kmi.properties.nr = 6 -kmi = km.items.new('view3d.layers', 'SEVEN', 'PRESS', any=True) -kmi.properties.nr = 7 -kmi = km.items.new('view3d.layers', 'EIGHT', 'PRESS', any=True) -kmi.properties.nr = 8 -kmi = km.items.new('view3d.layers', 'NINE', 'PRESS', any=True) -kmi.properties.nr = 9 -kmi = km.items.new('view3d.layers', 'ZERO', 'PRESS', any=True) -kmi.properties.nr = 10 -kmi = km.items.new('wm.context_toggle_enum', 'Z', 'PRESS') -kmi.properties.data_path = 'space_data.viewport_shade' -kmi.properties.value_1 = 'SOLID' -kmi.properties.value_2 = 'WIREFRAME' -kmi = km.items.new('wm.context_toggle_enum', 'Z', 'PRESS', alt=True) -kmi.properties.data_path = 'space_data.viewport_shade' -kmi.properties.value_1 = 'TEXTURED' -kmi.properties.value_2 = 'SOLID' -kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS') -kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi.properties.extend = True -kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi.properties.center = True -kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', alt=True) -kmi.properties.enumerate = True -kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi.properties.center = True -kmi.properties.extend = True -kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi.properties.center = True -kmi.properties.enumerate = True -kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi.properties.enumerate = True -kmi.properties.extend = True -kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) -kmi.properties.center = True -kmi.properties.enumerate = True -kmi.properties.extend = True -kmi = km.items.new('view3d.select_border', 'EVT_TWEAK_S', 'ANY') -kmi.properties.extend = False -kmi = km.items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi = km.items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) -kmi.properties.deselect = True -kmi = km.items.new('view3d.select_circle', 'C', 'PRESS') -kmi = km.items.new('view3d.clip_border', 'B', 'PRESS', alt=True) -kmi = km.items.new('view3d.zoom_border', 'B', 'PRESS', shift=True) -kmi = km.items.new('view3d.render_border', 'B', 'PRESS', shift=True) -kmi = km.items.new('view3d.camera_to_view', 'NUMPAD_0', 'PRESS', ctrl=True, alt=True) -kmi = km.items.new('view3d.object_as_camera', 'NUMPAD_0', 'PRESS', ctrl=True) -kmi = km.items.new('wm.call_menu', 'S', 'PRESS', shift=True) -kmi.properties.name = 'VIEW3D_MT_snap' -kmi = km.items.new('wm.context_set_enum', 'COMMA', 'PRESS') -kmi.properties.data_path = 'space_data.pivot_point' -kmi.properties.value = 'BOUNDING_BOX_CENTER' -kmi = km.items.new('wm.context_set_enum', 'COMMA', 'PRESS', ctrl=True) -kmi.properties.data_path = 'space_data.pivot_point' -kmi.properties.value = 'MEDIAN_POINT' -kmi = km.items.new('wm.context_toggle', 'COMMA', 'PRESS', alt=True) -kmi.properties.data_path = 'space_data.use_pivot_point_align' -kmi = km.items.new('wm.context_toggle', 'Q', 'PRESS') -kmi.properties.data_path = 'space_data.show_manipulator' -kmi = km.items.new('wm.context_set_enum', 'PERIOD', 'PRESS') -kmi.properties.data_path = 'space_data.pivot_point' -kmi.properties.value = 'CURSOR' -kmi = km.items.new('wm.context_set_enum', 'PERIOD', 'PRESS', ctrl=True) -kmi.properties.data_path = 'space_data.pivot_point' -kmi.properties.value = 'INDIVIDUAL_ORIGINS' -kmi = km.items.new('wm.context_set_enum', 'PERIOD', 'PRESS', alt=True) -kmi.properties.data_path = 'space_data.pivot_point' -kmi.properties.value = 'ACTIVE_ELEMENT' -kmi = km.items.new('transform.translate', 'G', 'PRESS', shift=True) -kmi = km.items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.items.new('transform.rotate', 'R', 'PRESS', shift=True) -kmi = km.items.new('transform.resize', 'S', 'PRESS', shift=True) -kmi = km.items.new('transform.warp', 'W', 'PRESS', shift=True) -kmi = km.items.new('transform.tosphere', 'S', 'PRESS', shift=True, alt=True) -kmi = km.items.new('transform.shear', 'S', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.items.new('transform.select_orientation', 'SPACE', 'PRESS', alt=True) -kmi = km.items.new('transform.create_orientation', 'SPACE', 'PRESS', ctrl=True, alt=True) -kmi.properties.use = True -kmi = km.items.new('transform.mirror', 'M', 'PRESS', ctrl=True) -kmi = km.items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True) -kmi.properties.data_path = 'tool_settings.use_snap' -kmi = km.items.new('transform.snap_type', 'TAB', 'PRESS', shift=True, ctrl=True) -kmi = km.items.new('view3d.enable_manipulator', 'W', 'PRESS') -kmi.properties.translate = True -kmi = km.items.new('view3d.enable_manipulator', 'E', 'PRESS') -kmi.properties.rotate = True -kmi = km.items.new('view3d.enable_manipulator', 'R', 'PRESS') -kmi.properties.scale = True -kmi = km.items.new('view3d.select_border', 'EVT_TWEAK_S', 'ANY', shift=True) -kmi.properties.extend = True - -# Map Object Mode -km = kc.keymaps.new('Object Mode', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi.properties.data_path = 'tool_settings.proportional_edit_falloff' -kmi = km.items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi.properties.data_path = 'tool_settings.proportional_edit' -kmi.properties.value_1 = 'DISABLED' -kmi.properties.value_2 = 'ENABLED' -kmi = km.items.new('view3d.game_start', 'P', 'PRESS') -kmi = km.items.new('object.select_all', 'A', 'PRESS') -kmi = km.items.new('object.select_inverse', 'I', 'PRESS', ctrl=True) -kmi = km.items.new('object.select_linked', 'L', 'PRESS', shift=True) -kmi = km.items.new('object.select_grouped', 'G', 'PRESS', shift=True) -kmi = km.items.new('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True) -kmi = km.items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS') -kmi.properties.direction = 'PARENT' -kmi = km.items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS', shift=True) -kmi.properties.direction = 'PARENT' -kmi.properties.extend = True -kmi = km.items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS') -kmi.properties.direction = 'CHILD' -kmi = km.items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS', shift=True) -kmi.properties.direction = 'CHILD' -kmi.properties.extend = True -kmi = km.items.new('object.parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.items.new('object.parent_no_inverse_set', 'P', 'PRESS', shift=True, ctrl=True) -kmi = km.items.new('object.parent_clear', 'P', 'PRESS', alt=True) -kmi = km.items.new('object.track_set', 'T', 'PRESS', ctrl=True) -kmi = km.items.new('object.track_clear', 'T', 'PRESS', alt=True) -kmi = km.items.new('object.constraint_add_with_targets', 'C', 'PRESS', shift=True, ctrl=True) -kmi = km.items.new('object.constraints_clear', 'C', 'PRESS', ctrl=True, alt=True) -kmi = km.items.new('object.location_clear', 'G', 'PRESS', alt=True) -kmi = km.items.new('object.rotation_clear', 'R', 'PRESS', alt=True) -kmi = km.items.new('object.scale_clear', 'S', 'PRESS', alt=True) -kmi = km.items.new('object.origin_clear', 'O', 'PRESS', alt=True) -kmi = km.items.new('object.hide_view_clear', 'H', 'PRESS', alt=True) -kmi = km.items.new('object.hide_view_set', 'H', 'PRESS') -kmi = km.items.new('object.hide_view_set', 'H', 'PRESS', shift=True) -kmi.properties.unselected = True -kmi = km.items.new('object.move_to_layer', 'M', 'PRESS') -kmi = km.items.new('object.delete', 'X', 'PRESS') -kmi = km.items.new('object.delete', 'DEL', 'PRESS') -kmi = km.items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi.properties.name = 'INFO_MT_add' -kmi = km.items.new('object.duplicates_make_real', 'A', 'PRESS', shift=True, ctrl=True) -kmi = km.items.new('wm.call_menu', 'A', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_object_apply' -kmi = km.items.new('wm.call_menu', 'U', 'PRESS') -kmi.properties.name = 'VIEW3D_MT_make_single_user' -kmi = km.items.new('wm.call_menu', 'L', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_make_links' -kmi = km.items.new('object.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.items.new('object.duplicate_move_linked', 'D', 'PRESS', alt=True) -kmi = km.items.new('object.join', 'J', 'PRESS', ctrl=True) -kmi = km.items.new('object.convert', 'C', 'PRESS', alt=True) -kmi = km.items.new('object.proxy_make', 'P', 'PRESS', ctrl=True, alt=True) -kmi = km.items.new('object.make_local', 'L', 'PRESS') -kmi = km.items.new('anim.keyframe_insert_menu', 'I', 'PRESS') -kmi = km.items.new('anim.keyframe_delete_v3d', 'I', 'PRESS', alt=True) -kmi = km.items.new('anim.keying_set_active_set', 'I', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.items.new('group.create', 'G', 'PRESS', ctrl=True) -kmi = km.items.new('group.objects_remove', 'G', 'PRESS', ctrl=True, alt=True) -kmi = km.items.new('group.objects_add_active', 'G', 'PRESS', shift=True, ctrl=True) -kmi = km.items.new('group.objects_remove_active', 'G', 'PRESS', shift=True, alt=True) -kmi = km.items.new('wm.call_menu', 'W', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_object_specials' -kmi = km.items.new('object.subdivision_set', 'ZERO', 'PRESS', ctrl=True) -kmi.properties.level = 0 -kmi = km.items.new('object.subdivision_set', 'ONE', 'PRESS', ctrl=True) -kmi.properties.level = 1 -kmi = km.items.new('object.subdivision_set', 'TWO', 'PRESS', ctrl=True) -kmi.properties.level = 2 -kmi = km.items.new('object.subdivision_set', 'THREE', 'PRESS', ctrl=True) -kmi.properties.level = 3 -kmi = km.items.new('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True) -kmi.properties.level = 4 -kmi = km.items.new('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True) -kmi.properties.level = 5 -kmi = km.items.new('object.select_all', 'SELECTMOUSE', 'CLICK') -kmi.properties.action = 'DESELECT' - -# Map Mesh -km = kc.keymaps.new('Mesh', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.items.new('mesh.loopcut_slide', 'R', 'PRESS', ctrl=True) -kmi = km.items.new('mesh.loop_select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi = km.items.new('mesh.loop_select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi.properties.extend = True -kmi = km.items.new('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi = km.items.new('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) -kmi.properties.extend = True -kmi = km.items.new('mesh.select_shortest_path', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi = km.items.new('mesh.select_all', 'A', 'PRESS') -kmi = km.items.new('mesh.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.items.new('mesh.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.items.new('mesh.select_inverse', 'I', 'PRESS', ctrl=True) -kmi = km.items.new('mesh.select_non_manifold', 'M', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.items.new('mesh.select_linked', 'L', 'PRESS', ctrl=True) -kmi = km.items.new('mesh.select_linked_pick', 'L', 'PRESS') -kmi = km.items.new('mesh.select_linked_pick', 'L', 'PRESS', shift=True) -kmi.properties.deselect = True -kmi = km.items.new('mesh.faces_select_linked_flat', 'F', 'PRESS', shift=True, ctrl=True, alt=True) -kmi.properties.sharpness = 135.0 -kmi = km.items.new('mesh.select_similar', 'G', 'PRESS', shift=True) -kmi = km.items.new('wm.call_menu', 'TAB', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_edit_mesh_selection_mode' -kmi = km.items.new('mesh.hide', 'H', 'PRESS') -kmi = km.items.new('mesh.hide', 'H', 'PRESS', shift=True) -kmi.properties.unselected = True -kmi = km.items.new('mesh.reveal', 'H', 'PRESS', alt=True) -kmi = km.items.new('mesh.normals_make_consistent', 'N', 'PRESS', ctrl=True) -kmi = km.items.new('mesh.normals_make_consistent', 'N', 'PRESS', shift=True, ctrl=True) -kmi.properties.inside = True -kmi = km.items.new('view3d.edit_mesh_extrude_move_normal', 'E', 'PRESS', ctrl=True) -kmi = km.items.new('view3d.edit_mesh_extrude_individual_move', 'E', 'PRESS', shift=True) -kmi = km.items.new('wm.call_menu', 'E', 'PRESS', alt=True) -kmi.properties.name = 'VIEW3D_MT_edit_mesh_extrude' -kmi = km.items.new('mesh.spin', 'R', 'PRESS', alt=True) -kmi = km.items.new('mesh.fill', 'F', 'PRESS', alt=True) -kmi = km.items.new('mesh.beautify_fill', 'F', 'PRESS', shift=True, alt=True) -kmi = km.items.new('mesh.quads_convert_to_tris', 'T', 'PRESS', ctrl=True) -kmi = km.items.new('mesh.tris_convert_to_quads', 'J', 'PRESS', alt=True) -kmi = km.items.new('mesh.edge_flip', 'F', 'PRESS', shift=True, ctrl=True) -kmi = km.items.new('mesh.rip_move', 'V', 'PRESS') -kmi = km.items.new('mesh.merge', 'M', 'PRESS', alt=True) -kmi = km.items.new('transform.shrink_fatten', 'S', 'PRESS', ctrl=True, alt=True) -kmi = km.items.new('mesh.edge_face_add', 'F', 'PRESS') -kmi = km.items.new('mesh.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi.properties.name = 'INFO_MT_mesh_add' -kmi = km.items.new('mesh.separate', 'P', 'PRESS') -kmi = km.items.new('mesh.split', 'Y', 'PRESS') -kmi = km.items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', ctrl=True) -kmi = km.items.new('mesh.delete', 'X', 'PRESS') -kmi = km.items.new('mesh.delete', 'DEL', 'PRESS') -kmi = km.items.new('mesh.knife_cut', 'LEFTMOUSE', 'PRESS', key_modifier='K') -kmi = km.items.new('mesh.knife_cut', 'LEFTMOUSE', 'PRESS', shift=True, key_modifier='K') -kmi.properties.type = 'MIDPOINTS' -kmi = km.items.new('object.vertex_parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.items.new('wm.call_menu', 'W', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_edit_mesh_specials' -kmi = km.items.new('wm.call_menu', 'F', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_edit_mesh_faces' -kmi = km.items.new('wm.call_menu', 'E', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_edit_mesh_edges' -kmi = km.items.new('wm.call_menu', 'V', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_edit_mesh_vertices' -kmi = km.items.new('wm.call_menu', 'H', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_hook' -kmi = km.items.new('wm.call_menu', 'U', 'PRESS') -kmi.properties.name = 'VIEW3D_MT_uv_map' -kmi = km.items.new('wm.call_menu', 'G', 'PRESS', ctrl=True) -kmi.properties.name = 'VIEW3D_MT_vertex_group' -kmi = km.items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi.properties.data_path = 'tool_settings.proportional_edit_falloff' -kmi = km.items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi.properties.data_path = 'tool_settings.proportional_edit' -kmi.properties.value_1 = 'DISABLED' -kmi.properties.value_2 = 'ENABLED' -kmi = km.items.new('wm.context_toggle_enum', 'O', 'PRESS', alt=True) -kmi.properties.data_path = 'tool_settings.proportional_edit' -kmi.properties.value_1 = 'DISABLED' -kmi.properties.value_2 = 'CONNECTED' -kmi = km.items.new('mesh.select_all', 'SELECTMOUSE', 'CLICK') -kmi.properties.action = 'DESELECT' - -wm.keyconfigs.active = kc - bpy.context.user_preferences.edit.use_drag_immediately = True bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False bpy.context.user_preferences.inputs.select_mouse = 'LEFT' diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index ad0d8eb171d..1fb2e5b735e 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -164,8 +164,6 @@ class INFO_MT_file_export(bpy.types.Menu): bl_label = "Export" def draw(self, context): - self.layout.operator("export_mesh.wavefront", text="Wavefront (.obj)") - if hasattr(bpy.types, "WM_OT_collada_export"): self.layout.operator("wm.collada_export", text="COLLADA (.dae)") diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py deleted file mode 100644 index 423b0b85402..00000000000 --- a/release/scripts/templates/operator.py +++ /dev/null @@ -1,63 +0,0 @@ -import bpy - -def write_some_data(context, filepath, use_some_setting): - print("running write_some_data...") - pass - -from bpy.props import * - -class ExportSomeData(bpy.types.Operator): - '''This appiers in the tooltip of the operator and in the generated docs.''' - bl_idname = "export.some_data" # this is important since its how bpy.ops.export.some_data is constructed - bl_label = "Export Some Data" - - # List of operator properties, the attributes will be assigned - # to the class instance from the operator settings before calling. - - # TODO, add better example props - filepath = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "") - use_setting = BoolProperty(name="Example Boolean", description="Example Tooltip", default= True) - - type = bpy.props.EnumProperty(items=(('OPT_A', "First Option", "Description one"), ('OPT_B', "Second Option", "Description two.")), - name="Example Enum", - description="Choose between two items", - default='OPT_A') - - @classmethod - def poll(cls, context): - return context.active_object != None - - def execute(self, context): - - # # Bug, currently isnt working - #if not self.is_property_set("filepath"): - # raise Exception("filename not set") - - write_some_data(self.properties.filepath, context, self.properties.use_setting) - - return {'FINISHED'} - - def invoke(self, context, event): - wm = context.window_manager - - if True: - # File selector - wm.add_fileselect(self) # will run self.execute() - return {'RUNNING_MODAL'} - elif True: - # search the enum - wm.invoke_search_popup(self) - return {'RUNNING_MODAL'} - elif False: - # Redo popup - return wm.invoke_props_popup(self, event) # - elif False: - return self.execute(context) - - -# Only needed if you want to add into a dynamic menu -menu_func = lambda self, context: self.layout.operator("export.some_data", text="Example Exporter...") -bpy.types.INFO_MT_file_export.append(menu_func) - -if __name__ == "__main__": - bpy.ops.export.some_data('INVOKE_DEFAULT', filepath="/tmp/test.ply") diff --git a/release/scripts/uv_from_adjacent.py b/release/scripts/uv_from_adjacent.py deleted file mode 100644 index dfdad3118d9..00000000000 --- a/release/scripts/uv_from_adjacent.py +++ /dev/null @@ -1,129 +0,0 @@ -#!BPY -""" -Name: 'UVs from unselected adjacent' -Blender: 242 -Group: 'UVCalculation' -Tooltip: 'Assign UVs to selected faces from surrounding unselected faces.' -""" -__author__ = "Campbell Barton" -__url__ = ("blender", "elysiun") -__version__ = "1.0 2006/02/07" - -__bpydoc__ = """\ -This script sets the UV mapping and image of selected faces from adjacent unselected faces. - -Use this script in face select mode for texturing between textured faces. -""" - -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# Script copyright (C) Campbell J Barton -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public 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 LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - - -from Blender import * -import bpy - -def mostUsedImage(imageList): # Returns the image most used in the list. - if not imageList: - return None - elif len(imageList) < 3: - return imageList[0] - - # 3+ Images, Get the most used image for surrounding faces. - imageCount = {} - for image in imageList: - if image: - image_key= image.name - else: - image_key = None - - try: - imageCount[image_key]['imageCount'] +=1 # an extra user of this image - except: - imageCount[image_key] = {'imageCount':1, 'blenderImage':image} # start with 1 user. - - # Now a list of tuples, (imageName, {imageCount, image}) - imageCount = imageCount.items() - - try: imageCount.sort(key=lambda a: a[1]) - except: imageCount.sort(lambda a,b: cmp(a[1], b[1])) - - - return imageCount[-1][1]['blenderImage'] - - -def main(): - sce = bpy.data.scenes.active - ob = sce.objects.active - - if ob == None or ob.type != 'Mesh': - Draw.PupMenu('ERROR: No mesh object in face select mode.') - return - me = ob.getData(mesh=1) - - if not me.faceUV: - Draw.PupMenu('ERROR: No mesh object in face select mode.') - return - - selfaces = [f for f in me.faces if f.sel] - unselfaces = [f for f in me.faces if not f.sel] - - - # Gather per Vert UV and Image, store in vertUvAverage - vertUvAverage = [[[],[]] for i in xrange(len(me.verts))] - - for f in unselfaces: # Unselected faces only. - fuv = f.uv - for i,v in enumerate(f): - vertUvAverage[v.index][0].append(fuv[i]) - vertUvAverage[v.index][1].append(f.image) - - # Average per vectex UV coords - for vertUvData in vertUvAverage: - uvList = vertUvData[0] - if uvList: - # Convert from a list of vectors into 1 vector. - vertUvData[0] = reduce(lambda a,b: a+b, uvList, Mathutils.Vector(0,0)) * (1.0/len(uvList)) - else: - vertUvData[0] = None - - # Assign to selected faces - TEX_FLAG = Mesh.FaceModes['TEX'] - for f in selfaces: - uvlist = [] - imageList = [] - for i,v in enumerate(f): - uv, vImages = vertUvAverage[v.index] - uvlist.append( uv ) - imageList.extend(vImages) - - if None not in uvlist: - # all the faces images used by this faces vert. some faces will be added twice but thats ok. - # Get the most used image and assign to the face. - image = mostUsedImage(imageList) - f.uv = uvlist - - if image: - f.image = image - f.mode |= TEX_FLAG - Window.RedrawAll() - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/release/windows/installer/01.installer.bmp b/release/windows/installer/01.installer.bmp new file mode 100644 index 0000000000000000000000000000000000000000..10fb01454a4d2d41e2069d6d0025f26c7f77cc85 GIT binary patch literal 154542 zcmeFa2XtIVb}eeJ_1E{TdCT@+^F9B~*c0A!nD4Ql?XjQjkwi&U7-eac<0xwss7Okp z0u?AmF#yat2M{0#f&>VF2qZ`lIp^2_8bAZxjhquHiun7SQ&oLC00b#{=9AM`Tg7v$ zt8e$MT_@D3x{X`z>)P~3eEcWMzsLV!`2V^;{-Zzo<3IWV*HdxRf0O@p#YFH3_CT-) zf;|xIfnW~=dmz{Y!5#?qK(GgbJrL}HU=IX)AlL)J9tie8um^%Y5bS|q4+MK4*aN{H z2=+j*2ZB8i?15kp1bZOZ1Hm2$_CT-)f;|xIfnW~=dmz{Y!5#?qK(GgbJrL}HU=IX) zAlL)J9tie8um^%Y5bS|q4+MK4*aN{H2=+j*2ZB8i?15k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5vyKN+)jzOlyPOL)hK=MLQiyF*_H?&E_+7{uM+o(@)&}bYdeiH|Qbv(gctEb(W<%%Tt}v!<>Rn*hlr1+Q{o+YaaPq(XYE!xgXrIUi98r zDDGk{AL!Sm<$A0EsZl+&0zcFM8GHoPBwaSm}lOzjMJIKO*JKU~CpEucBwxcBSb{w{;? zjyYo2ySR^)`6K<__m`Z0NZi5#gG0UB^Z#7p+^I22^0X0jEu|;s(H^Dc_|QSq#-QVQ z9Nf-2y9GM7Y+$e~En8j`tQeHLVsP%tAws|5!--2rCoUZ$$pgKuG^y4e&1#>R6!bEI z_L$EWk2ZHePmzrdYkVvDb{laCzivQpQz0he9})3BCi+=Lq5Nm!1{UWHJ(5>;*F;5# zGGJjx{Qza`Qx)pl>j!kW-nE3Muw&e-;I52r>A2|c9LEL=M+fH(Q=A8S)!*ev^##YC zWtqGa_v{X(6XDNgAagrp_index= pose->active_group; - done= 1; - } + pchan->agrp_index= pose->active_group; + done= 1; + } CTX_DATA_END; /* notifiers for updates */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c66ebf60798..ae5af185442 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4455,9 +4455,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) /* RMB has two options now */ if (ui_but_menu(C, but)) { return WM_UI_HANDLER_BREAK; + } } } - } /* verify if we can edit this button */ if(ELEM(event->type, LEFTMOUSE, RETKEY)) { diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt index 1581c91ab04..207535033ff 100644 --- a/source/blender/editors/mesh/CMakeLists.txt +++ b/source/blender/editors/mesh/CMakeLists.txt @@ -40,16 +40,17 @@ set(SRC loopcut.c mesh_ops.c editbmesh_bvh.c - editbmesh_bvh.h editbmesh_add.c bmeshutils.c - mesh_intern.h bmesh_selecthistory.c bmesh_select.c mesh_data.c bmesh_tools.c knifetool.c editface.c + + editbmesh_bvh.h + mesh_intern.h ) blender_add_lib(bf_editor_mesh "${SRC}" "${INC}") diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index ca6f61e24fd..e99066c1d91 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -4474,6 +4474,7 @@ struct facesort { struct EditFace *efa; }; +#if 0 /* UNUSED */ static int vergface(const void *v1, const void *v2) { const struct facesort *x1=v1, *x2=v2; @@ -4482,15 +4483,18 @@ static int vergface(const void *v1, const void *v2) else if( x1->x < x2->x) return -1; return 0; } +#endif // XXX is this needed? /* called from buttons */ +#if 0 /* UNUSED */ static void xsortvert_flag__doSetX(void *userData, EditVert *UNUSED(eve), int x, int UNUSED(y), int index) { xvertsort *sortblock = userData; sortblock[index].x = x; } +#endif /* all verts with (flag & 'flag') are sorted */ static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag)) diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index dfb678e9dcd..1a97d2c3d07 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1809,6 +1809,7 @@ static int join_poll(bContext *C) return 0; } + static int join_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -1822,7 +1823,7 @@ static int join_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata."); return OPERATOR_CANCELLED; } - + if(ob->type == OB_MESH) return join_mesh_exec(C, op); else if(ELEM(ob->type, OB_CURVE, OB_SURF)) diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 1e3614612ba..450bd70a568 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -388,7 +388,7 @@ static void test_constraints (Object *owner, bPoseChannel *pchan) } else if (curcon->type == CONSTRAINT_TYPE_SPLINEIK) { bSplineIKConstraint *data = curcon->data; - + /* if the number of points does not match the amount required by the chain length, * free the points array and request a rebind... */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index f7682345acf..d540be8917f 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -415,7 +415,7 @@ void ED_object_enter_editmode(bContext *C, int flag) if(base==NULL) return; else if(v3d && (base->lay & v3d->lay)==0) return; - else if(!v3d && (base->lay & scene->lay)==0) return; + else if(!v3d && (base->lay & scene->lay)==0) return; } else { base= scene->basact; @@ -1847,7 +1847,7 @@ static void ofs_timeoffs(Scene *scene, View3D *v3d) ob->sf += offset; if (ob->sf < -MAXFRAMEF) ob->sf = -MAXFRAMEF; else if (ob->sf > MAXFRAMEF) ob->sf = MAXFRAMEF; - } + } CTX_DATA_END; } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index e3fb444af18..57ea7e761c0 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -954,7 +954,7 @@ static int track_set_exec(bContext *C, wmOperator *op) Object *obact= ED_object_active_context(C); int type= RNA_enum_get(op->ptr, "type"); - + if(type == 1) { bConstraint *con; bDampTrackConstraint *data; @@ -1194,7 +1194,7 @@ static int make_links_scene_exec(bContext *C, wmOperator *op) if(scene_to == CTX_data_scene(C)) { BKE_report(op->reports, RPT_ERROR, "Can't link objects into the same scene"); return OPERATOR_CANCELLED; - } + } if(scene_to->id.lib) { BKE_report(op->reports, RPT_ERROR, "Can't link objects into a linked scene"); @@ -1205,11 +1205,11 @@ static int make_links_scene_exec(bContext *C, wmOperator *op) { if(!object_in_scene(base->object, scene_to)) { Base *nbase= MEM_mallocN( sizeof(Base), "newbase"); - *nbase= *base; + *nbase= *base; BLI_addhead( &(scene_to->base), nbase); - id_us_plus((ID *)base->object); - } - } + id_us_plus((ID *)base->object); + } + } CTX_DATA_END; DAG_ids_flush_update(bmain, 0); @@ -1299,7 +1299,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) object_link_modifiers(obt, ob); obt->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; break; - } + } } } } diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 6d37ca53209..f47d1d7c1f8 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -661,12 +661,13 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if(v3d && !RNA_property_is_set(op->ptr, "around")) around= v3d->around; } + zero_v3(cent); if(obedit) { - INIT_MINMAX(min, max); - - if(obedit->type==OB_MESH) { + INIT_MINMAX(min, max); + + if(obedit->type==OB_MESH) { Mesh *me= obedit->data; BMEditMesh *em = me->edit_btmesh; BMVert *eve; @@ -694,7 +695,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { sub_v3_v3(eve->co, cent); } - + EDBM_RecalcNormals(em); tot_change++; DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 0a4e0b21902..b4921d92270 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -510,7 +510,6 @@ void ED_vgroup_vert_remove(Object *ob, bDeformGroup *dg, int vertnum) ED_vgroup_nr_vert_remove(ob, def_nr, vertnum); } - static float get_vert_def_nr(Object *ob, int def_nr, int vertnum) { MDeformVert *dvert= NULL; @@ -1173,6 +1172,7 @@ static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg) ob->actdef= 1; } + /* only in editmode */ /* removes from active defgroup, if allverts==0 only selected vertices */ static void vgroup_active_remove_verts(Object *ob, const int allverts, bDeformGroup *dg) diff --git a/source/blender/editors/screen/Makefile b/source/blender/editors/screen/Makefile deleted file mode 100644 index 85b9e069620..00000000000 --- a/source/blender/editors/screen/Makefile +++ /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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../../bmesh -CPPFLAGS += -I../../blenlib -CPPFLAGS += -I../../makesdna -CPPFLAGS += -I../../makesrna -CPPFLAGS += -I../../imbuf -CPPFLAGS += -I../../python -CPPFLAGS += -I../../render/extern/include -CPPFLAGS += -I../../blenfont -CPPFLAGS += -I../../gpu -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include - -# own include - -CPPFLAGS += -I../include - -ifeq ($(WITH_OPENEXR), true) - CPPFLAGS += -DWITH_OPENEXR -endif - -ifeq ($(OS), darwin) - ifeq ($(WITH_BF_OPENMP), true) - CPPFLAGS += -DPARALLEL=1 - endif -endif diff --git a/source/blender/editors/space_file/Makefile b/source/blender/editors/space_file/Makefile deleted file mode 100644 index 4597ffa3f6b..00000000000 --- a/source/blender/editors/space_file/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# The Original Code is Copyright (C) 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../../makesrna -CPPFLAGS += -I../../imbuf -CPPFLAGS += -I../../render/extern/include -CPPFLAGS += -I../../python -CPPFLAGS += -I../../blenfont -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include - -# own include - -CPPFLAGS += -I../include - -ifeq ($(WITH_OPENJPEG),true) - CPPFLAGS += -DWITH_OPENJPEG -endif - -ifeq ($(WITH_OPENEXR), true) - CPPFLAGS += -DWITH_OPENEXR -endif - -ifeq ($(WITH_TIFF), true) - CPPFLAGS += -DWITH_TIFF -endif - -ifeq ($(WITH_CINEON), true) - CPPFLAGS += -DWITH_CINEON -endif - -ifeq ($(WITH_HDR), true) - CPPFLAGS += -DWITH_HDR -endif diff --git a/source/blender/editors/space_image/Makefile b/source/blender/editors/space_image/Makefile deleted file mode 100644 index 51a29115813..00000000000 --- a/source/blender/editors/space_image/Makefile +++ /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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../../blenkernel -CPPFLAGS += -I../../blenlib -CPPFLAGS += -I../../makesdna -CPPFLAGS += -I../../makesrna -CPPFLAGS += -I../../imbuf -CPPFLAGS += -I../../python -CPPFLAGS += -I../../render/extern/include -CPPFLAGS += -I../../bmesh -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include - -# own include - -CPPFLAGS += -I../include - -ifeq ($(WITH_OPENEXR), true) - CPPFLAGS += -DWITH_OPENEXR -endif - -ifeq ($(WITH_TIFF), true) - CPPFLAGS += -DWITH_TIFF -endif - -ifeq ($(WITH_LCMS), true) - CPPFLAGS += -DWITH_LCMS - CPPFLAGS += -I$(BF_LCMS_INC) -endif - -ifeq ($(WITH_CINEON), true) - CPPFLAGS += -DWITH_CINEON -endif - -ifeq ($(WITH_HDR), true) - CPPFLAGS += -DWITH_HDR -endif - diff --git a/source/blender/editors/space_info/Makefile b/source/blender/editors/space_info/Makefile deleted file mode 100644 index 0a9d3e3396d..00000000000 --- a/source/blender/editors/space_info/Makefile +++ /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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../../makesrna -CPPFLAGS += -I../../imbuf -CPPFLAGS += -I../../python -CPPFLAGS += -I../../bmesh -CPPFLAGS += -I../../blenfont -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include - -# own include - -CPPFLAGS += -I../include diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 1d50c0586a0..f563d8cbe92 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -163,7 +163,7 @@ void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[][4], int *winsize void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp); void GPU_lamp_update(GPULamp *lamp, int lay, int hide, float obmat[][4]); -void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float power); +void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy); int GPU_lamp_shadow_layer(GPULamp *lamp); #ifdef __cplusplus diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp index 80faa5e301e..a456e18498b 100644 --- a/source/blender/ikplugin/intern/itasc_plugin.cpp +++ b/source/blender/ikplugin/intern/itasc_plugin.cpp @@ -1127,12 +1127,14 @@ static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan) KDL::Frame tip(iTaSC::F_identity); Vector3 *fl = bone->bone_mat; - KDL::Frame head(KDL::Rotation( - fl[0][0], fl[1][0], fl[2][0], - fl[0][1], fl[1][1], fl[2][1], - fl[0][2], fl[1][2], fl[2][2]), - KDL::Vector(bone->head[0], bone->head[1], bone->head[2])*scale); - + KDL::Rotation brot( + fl[0][0], fl[1][0], fl[2][0], + fl[0][1], fl[1][1], fl[2][1], + fl[0][2], fl[1][2], fl[2][2]); + KDL::Vector bpos(bone->head[0], bone->head[1], bone->head[2]); + bpos = bpos*scale; + KDL::Frame head(brot, bpos); + // rest pose length of the bone taking scaling into account length= bone->length*scale; parent = (a > 0) ? ikscene->channels[tree->parent[a]].tail : root; diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index 004c2676622..d9f195eab1e 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -49,7 +49,6 @@ targetdir = normpath(root_build_dir + '/makesdna') if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'): targetdir = '#' + targetdir - #root_build_dir = "#" makesdna = makesdna_tool.Program (target = targetdir, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_blenlib']) @@ -57,8 +56,6 @@ dna_dict = dna.Dictionary() dna.Depends ('dna.c', makesdna) dna.Depends ('dna.c', header_files) -ap = os.path.abspath - if env['OURPLATFORM'] != 'linuxcross': if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'): dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET") diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index d4d3d0da1d1..07ee084f976 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -983,8 +983,6 @@ int make_structDNA(char *baseDirectory, FILE *file) dna_write(file, str, 4); len= nr_names; dna_write(file, &len, 4); - printf("LEEEN %d\n", len); - /* calculate size of datablock with strings */ cp= names[nr_names-1]; diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 3c76fbf1edb..4d8e2ea8793 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -151,6 +151,7 @@ rna.Depends (generated_files, makesrna) # this seems bad, how to retrieve it from scons? build_dir = root_build_dir + os.sep +'source' + os.sep + 'blender' + os.sep + 'makesrna' + os.sep + 'intern' + os.sep + if env['OURPLATFORM'] != 'linuxcross': if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'): rna.Command (generated_files, '', "\"" + root_build_dir+os.sep+"makesrna.exe\" \"" + build_dir ) diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index d4bb3957d70..97d0f535a5b 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1588,7 +1588,6 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA fprintf(f, "\t_retdata= _data;\n"); else { const char *data_str; - if (cptr || (flag & PROP_DYNAMIC)) { ptrstr= "**"; valstr= "*"; diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 75a78091bd9..966e679f0fe 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -2031,7 +2031,7 @@ void RNA_def_constraint(BlenderRNA *brna) /* flags */ prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_OFF); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OFF); RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint"); prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 83fe53b676e..1b18f88efcc 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -49,7 +49,7 @@ #include "ED_keyframing.h" #include "ED_keyframes_edit.h" - + EnumPropertyItem fmodifier_type_items[] = { {FMODIFIER_TYPE_NULL, "NULL", 0, "Invalid", ""}, {FMODIFIER_TYPE_GENERATOR, "GENERATOR", 0, "Generator", ""}, diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 35c0022df84..5d337e70908 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1603,7 +1603,6 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "remove", "rna_Object_modifier_remove"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove an existing modifier from the object."); - /* target to remove*/ parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); diff --git a/source/blender/makesrna/rna_cleanup/rna_properties.txt b/source/blender/makesrna/rna_cleanup/rna_properties.txt index 06770803db5..030fecec20e 100644 --- a/source/blender/makesrna/rna_cleanup/rna_properties.txt +++ b/source/blender/makesrna/rna_cleanup/rna_properties.txt @@ -1,2 +1 @@ # See svn history for example formatting for this file, currently this isnt in use. - diff --git a/source/blender/makesrna/rna_cleanup/rna_update.sh b/source/blender/makesrna/rna_cleanup/rna_update.sh index fa4bdb2cad4..a4d686cc482 100755 --- a/source/blender/makesrna/rna_cleanup/rna_update.sh +++ b/source/blender/makesrna/rna_cleanup/rna_update.sh @@ -11,4 +11,3 @@ mv out_work_lost_work.txt rna_properties_lost.txt cat rna_properties.txt | grep -v "^#" > rna_properties_edits.txt ./rna_cleaner.py rna_properties.txt echo "Updated: rna_properties.txt rna_properties_edits.txt rna_properties_lost.txt " - diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_output.c b/source/blender/nodes/intern/SHD_nodes/SHD_output.c index 058594944b5..e42caabff34 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_output.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_output.c @@ -43,7 +43,7 @@ static bNodeSocketType sh_node_output_in[]= { static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out)) { - if(data && in[0] && in[1]) { + if(data) { ShadeInput *shi= ((ShaderCallData *)data)->shi; float col[4]; diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c deleted file mode 100644 index b67f1e717da..00000000000 --- a/source/blender/python/BPY_menus.c +++ /dev/null @@ -1,1118 +0,0 @@ -/* - * $Id: BPY_menus.c 12932 2007-12-17 20:21:06Z 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) 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/BL DUAL 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 -#ifndef WIN32 - #include -#else - #include "BLI_winstuff.h" -#endif -#include "BKE_global.h" -#include "BKE_utildefines.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, "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_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; -} - -/* 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 *homedir = NULL; - int parsing, version, 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 ); - if( w1 ) { - char upythondir[FILE_MAXDIR]; - - BLI_strncpy(upythondir, U.pythondir, FILE_MAXDIR); - BLI_convertstringcode(upythondir, G.sce, 0); - 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 ); - - if( parsing <= 0 ) { /* invalid line, get rid of it */ - fgets( line, 255, fp ); - } else if( parsing == 5 ) - tip = tooltip; /* has tooltip */ - - 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_MAXDIR]; - - BLI_strncpy(upythondir, U.pythondir, FILE_MAXDIR); - BLI_convertstringcode(upythondir, G.sce, 0); - 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: - * 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, using that to fill the bpymenu structs. - * is_userdir defines if the script is in the default scripts dir or the - * user defined one (U.pythondir: is_userdir == 1). - * Speed is important. - * - * 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): - * - * # \"\"\"
- * # Name: 'script name for the menu' - * # Blender: short int (minimal Blender version) - * # Group: 'group name' (defines menu) - * # Submenu: 'submenu name' related_1word_arg - * # 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: */ - 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 { - /* 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( char *name, int is_file, time_t * mtime ) -{ - struct stat st; - int result; - - result = stat( name, &st ); - - 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_MAXDIR]; - char upythondir[FILE_MAXDIR]; - 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_MAXDIR); - BLI_convertstringcode(upythondir, G.sce, 0); - } - - sdir = bpy_gethome(1); - - if (sdir) { - BLI_strncpy(dirname, sdir, FILE_MAXDIR); - 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_MAXDIR); - BLI_convertstringcode(dirname, G.sce, 0); - 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 6cdea608b10..00000000000 --- a/source/blender/python/BPY_menus.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * $Id: BPY_menus.h 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) 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/BL DUAL 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; - 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_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/Makefile b/source/blender/python/Makefile deleted file mode 100644 index 43b6f91369b..00000000000 --- a/source/blender/python/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# The Original Code is Copyright (C) Blender Foundation. -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# Bounces make to subdirectories. - -SOURCEDIR = source/blender/python -DIRS = intern generic - -include nan_subdirs.mk diff --git a/source/blender/python/epy_doc_gen.py b/source/blender/python/epy_doc_gen.py deleted file mode 100644 index f16c7504cb2..00000000000 --- a/source/blender/python/epy_doc_gen.py +++ /dev/null @@ -1,753 +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. - # - # Contributor(s): Campbell Barton - # - # #**** END GPL LICENSE BLOCK #**** - -script_help_msg = ''' -Usage, -run this script from blenders root path once you have compiled blender - ./blender.bin -P source/blender/python/epy_doc_gen.py - -This will generate python files in "./source/blender/python/doc/bpy" -Generate html docs by running... - - epydoc source/blender/python/doc/bpy/ -v \\ - -o source/blender/python/doc/html \\ - --inheritance=included \\ - --no-sourcecode \\ - --graph=classtree \\ - --graph-font-size=8 - -''' - -# if you dont have graphvis installed ommit the --graph arg. - -# GLOBALS['BASEDIR'] = './source/blender/python/doc' - -import os - -SUBMODULES = {} -INIT_SUBMODULES = {} # store initialized files - -INIT_SUBMODULES_IMPORTS = {} # dont import the same module twice - -def append_package(package_path, mod_name): - - init_path = os.path.join(os.path.dirname(package_path), "__init__.py") - - # avoid double ups - if mod_name: - imports = INIT_SUBMODULES_IMPORTS.setdefault(init_path, []) - if mod_name in imports: - return - imports.append(mod_name) - - try: - os.makedirs(os.path.dirname(init_path)) # make the dirs if they are not there - except: - pass - - # Open the new file for the first time, otherwise keep it open. - f = INIT_SUBMODULES.get(init_path) - if f == None: - f = INIT_SUBMODULES[init_path] = open(init_path, 'w') - - if mod_name: - f.write("import %s\n" % mod_name) - - return f - -def append_package_recursive(package_path, BASEPATH): - ''' - assume the last item of package_path will be a file (not a dir thats created) - ''' - - package_path = os.path.splitext(package_path)[0] # incase of .py - - try: - os.makedirs(os.path.join(BASEPATH, os.path.dirname(package_path))) # make the dirs if they are not there - except: - pass - - new_path = BASEPATH - - for mod_name in package_path.split(os.sep): - init_path = os.path.join(new_path, "__init__.py") - new_path = os.path.join(new_path, mod_name) - append_package(init_path, mod_name) - - -def open_submodule(subpath, BASEPATH): - ''' - This is a utility function that lets us quickly add submodules - ''' - - # create all the package paths leading up to this module - append_package_recursive(subpath, BASEPATH) - - module_name = os.path.basename( os.path.splitext(subpath)[0] ) - mod_path = os.path.join(BASEPATH, subpath) - - # Open the new file for the first time, otherwise keep it open. - f = SUBMODULES.get(mod_path) - if f == None: - f = SUBMODULES[mod_path] = open(mod_path, 'w') - - f = open(mod_path, 'w') - return f - -def close_all(): - for files in (INIT_SUBMODULES.values(), SUBMODULES.values()): - for f in files: - if f.name.endswith('.py'): - f_name = f.name - f.close() - - f = open(f_name, 'a') - f.write("\ndel __package__\n") # annoying, no need do show this - - - f.close() - - -def range_str(val): - if val < -10000000: return '-inf' - if val > 10000000: return 'inf' - if type(val)==float: - return '%g' % val - else: - return str(val) - -def get_array_str(length): - if length > 0: return ' array of %d items' % length - else: return '' - -def full_rna_struct_path(rna_struct): - ''' - Needed when referencing one struct from another - ''' - nested = rna_struct.nested - if nested: - return "%s.%s" % (full_rna_struct_path(nested), rna_struct.identifier) - else: - return rna_struct.identifier - -def rna_id_ignore(rna_id): - if rna_id == "rna_type": - return True - - if "_OT_" in rna_id: - return True - if "_MT_" in rna_id: - return True - if "_PT_" in rna_id: - return True - - return False - -def write_func(rna, ident, out, func_type): - # Keyword attributes - kw_args = [] # "foo = 1", "bar=0.5", "spam='ENUM'" - kw_arg_attrs = [] # "@type mode: int" - - rna_struct= rna.rna_type - - # Operators and functions work differently - if func_type=='OPERATOR': - rna_func_name = rna_struct.identifier.split("_OT_")[-1] - rna_func_desc = rna_struct.description.strip() - items = rna_struct.properties.items() - else: - rna_func_name = rna.identifier - rna_func_desc = rna.description.strip() - items = rna.parameters.items() - - - for rna_prop_identifier, rna_prop in items: - if rna_id_ignore(rna_prop_identifier): - continue - - # clear vars - val = val_error = val_str = rna_prop_type = None - - # ['rna_type', 'name', 'array_length', 'description', 'hard_max', 'hard_min', 'identifier', 'precision', 'readonly', 'soft_max', 'soft_min', 'step', 'subtype', 'type'] - #rna_prop= op_rna.rna_type.properties[attr] - rna_prop_type = rna_prop.type.lower() # enum, float, int, boolean - - - # only for rna functions, operators should not get pointers as args - if rna_prop_type=='pointer': - rna_prop_type_refine = "L{%s}" % rna_prop.fixed_type.identifier - else: - # Collections/Arrays can have a srna type - rna_prop_srna_type = rna_prop.srna - if rna_prop_srna_type: - print(rna_prop_srna_type.identifier) - rna_prop_type_refine = "L{%s}" % rna_prop_srna_type.identifier - else: - rna_prop_type_refine = rna_prop_type - - del rna_prop_srna_type - - - try: length = rna_prop.array_length - except: length = 0 - - array_str = get_array_str(length) - - if rna_prop.use_return: - kw_type_str= "@rtype: %s%s" % (rna_prop_type_refine, array_str) - kw_param_str= "@return: %s" % (rna_prop.description.strip()) - else: - kw_type_str= "@type %s: %s%s" % (rna_prop_identifier, rna_prop_type_refine, array_str) - kw_param_str= "@param %s: %s" % (rna_prop_identifier, rna_prop.description.strip()) - - kw_param_set = False - - if func_type=='OPERATOR': - try: - val = getattr(rna, rna_prop_identifier) - val_error = False - except: - val = "''" - val_error = True - - - if val_error: - val_str = val - elif rna_prop_type=='float': - if length==0: - val_str= '%g' % val - if '.' not in val_str and '-' not in val_str: # value could be 1e-05 - val_str += '.0' - else: - # array - val_str = str(tuple(val)) - - kw_param_str += (' in (%s, %s)' % (range_str(rna_prop.hard_min), range_str(rna_prop.hard_max))) - kw_param_set= True - - elif rna_prop_type=='int': - if length==0: - val_str='%d' % val - else: - val_str = str(tuple(val)) - - # print(dir(rna_prop)) - kw_param_str += (' in (%s, %s)' % (range_str(rna_prop.hard_min), range_str(rna_prop.hard_max))) - # These strings dont have a max length??? - #kw_param_str += ' (maximum length of %s)' % (rna_prop.max_length) - kw_param_set= True - - elif rna_prop_type=='boolean': - if length==0: - if val: val_str='True' - else: val_str='False' - else: - val_str = str(tuple(val)) - - elif rna_prop_type=='enum': - # no array here? - val_str="'%s'" % val - # Too cramped - kw_param_str += (' in (%s)' % ', '.join(rna_prop.items.keys())) - - kw_param_set= True - - elif rna_prop_type=='string': - # no array here? - val_str='"%s"' % val - - # todo - collection - array - # print (rna_prop.type) - - kw_args.append('%s = %s' % (rna_prop_identifier, val_str)) - - # stora - else: - # currently functions dont have a default value - if not rna_prop.use_return: - kw_args.append('%s' % (rna_prop_identifier)) - else: - kw_param_set = True - - - # Same for operators and functions - kw_arg_attrs.append(kw_type_str) - if kw_param_set: - kw_arg_attrs.append(kw_param_str) - - - - out.write(ident+'def %s(%s):\n' % (rna_func_name, ', '.join(kw_args))) - out.write(ident+'\t"""\n') - - # Descriptions could be multiline - for rna_func_desc_line in rna_func_desc.split('\n'): - out.write(ident+'\t%s\n' % rna_func_desc_line.strip()) - - for desc in kw_arg_attrs: - out.write(ident+'\t%s\n' % desc) - - # out.write(ident+'\t@rtype: None\n') # implicit - out.write(ident+'\t"""\n') - - - -def rna2epy(BASEPATH): - - # Use for faster lookups - # use rna_struct.identifier as the key for each dict - rna_struct_dict = {} # store identifier:rna lookups - rna_full_path_dict = {} # store the result of full_rna_struct_path(rna_struct) - rna_children_dict = {} # store all rna_structs nested from here - rna_references_dict = {} # store a list of rna path strings that reference this type - rna_functions_dict = {} # store all functions directly in this type (not inherited) - rna_words = set() - - # def write_func(rna_func, ident): - - - def write_struct(rna_struct, ident): - identifier = rna_struct.identifier - - rna_base = rna_struct.base - - if rna_base: - out.write(ident+ 'class %s(%s):\n' % (identifier, rna_base.identifier)) - rna_base_prop_keys = rna_base.properties.keys() # could be cached - rna_base_func_keys = [f.identifier for f in rna_base.functions] - else: - out.write(ident+ 'class %s:\n' % identifier) - rna_base_prop_keys = [] - rna_base_func_keys = [] - - out.write(ident+ '\t"""\n') - - title = 'The %s Object' % rna_struct.name - description = rna_struct.description.strip() - out.write(ident+ '\t%s\n' % title) - out.write(ident+ '\t%s\n' % ('=' * len(title))) - out.write(ident+ '\t\t%s\n' % description) - rna_words.update(description.split()) - - - # For convenience, give a list of all places were used. - rna_refs= rna_references_dict[identifier] - - if rna_refs: - out.write(ident+ '\t\t\n') - out.write(ident+ '\t\tReferences\n') - out.write(ident+ '\t\t==========\n') - - for rna_ref_string in rna_refs: - out.write(ident+ '\t\t\t- L{%s}\n' % rna_ref_string) - - out.write(ident+ '\t\t\n') - - else: - out.write(ident+ '\t\t\n') - out.write(ident+ '\t\t(no references to this struct found)\n') - out.write(ident+ '\t\t\n') - - for rna_prop_identifier, rna_prop in rna_struct.properties.items(): - - if rna_prop_identifier=='RNA': continue - if rna_id_ignore(rna_prop_identifier): continue - if rna_prop_identifier in rna_base_prop_keys: continue # does this prop exist in our parent class, if so skip - - rna_desc = rna_prop.description.strip() - - if rna_desc: rna_words.update(rna_desc.split()) - if not rna_desc: rna_desc = rna_prop.name - if not rna_desc: rna_desc = 'Note - No documentation for this property!' - - rna_prop_type = rna_prop.type.lower() - - if rna_prop_type=='collection': collection_str = 'Collection of ' - else: collection_str = '' - - # some collections have a srna for their own properties - # TODO - arrays, however this isnt used yet - rna_prop_srna_type = rna_prop.srna - if rna_prop_srna_type: - collection_str = "L{%s} %s" % (rna_prop_srna_type.identifier, collection_str) - del rna_prop_srna_type - - try: rna_prop_ptr = rna_prop.fixed_type - except: rna_prop_ptr = None - - try: length = rna_prop.array_length - except: length = 0 - - array_str = get_array_str(length) - - if rna_prop.editable: readonly_str = '' - else: readonly_str = ' (readonly)' - - if rna_prop_ptr: # Use the pointer type - out.write(ident+ '\t@ivar %s: %s\n' % (rna_prop_identifier, rna_desc)) - out.write(ident+ '\t@type %s: %sL{%s}%s%s\n' % (rna_prop_identifier, collection_str, rna_prop_ptr.identifier, array_str, readonly_str)) - else: - if rna_prop_type == 'enum': - if 0: - out.write(ident+ '\t@ivar %s: %s in (%s)\n' % (rna_prop_identifier, rna_desc, ', '.join(rna_prop.items.keys()))) - else: - out.write(ident+ '\t@ivar %s: %s in...\n' % (rna_prop_identifier, rna_desc)) - for e, e_rna_prop in rna_prop.items.items(): - #out.write(ident+ '\t\t- %s: %s\n' % (e, e_rna_prop.description)) # XXX - segfaults, FIXME - out.write(ident+ '\t\t- %s\n' % e) - - out.write(ident+ '\t@type %s: %s%s%s\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str)) - elif rna_prop_type == 'int' or rna_prop_type == 'float': - out.write(ident+ '\t@ivar %s: %s\n' % (rna_prop_identifier, rna_desc)) - out.write(ident+ '\t@type %s: %s%s%s in [%s, %s]\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str, range_str(rna_prop.hard_min), range_str(rna_prop.hard_max) )) - elif rna_prop_type == 'string': - out.write(ident+ '\t@ivar %s: %s (maximum length of %s)\n' % (rna_prop_identifier, rna_desc, rna_prop.max_length)) - out.write(ident+ '\t@type %s: %s%s%s\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str)) - else: - out.write(ident+ '\t@ivar %s: %s\n' % (rna_prop_identifier, rna_desc)) - out.write(ident+ '\t@type %s: %s%s%s\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str)) - - - out.write(ident+ '\t"""\n\n') - - - # Write functions - # for rna_func in rna_struct.functions: # Better ignore inherited (line below) - for rna_func in rna_functions_dict[identifier]: - if rna_func not in rna_base_func_keys: - write_func(rna_func, ident+'\t', out, 'FUNCTION') - - out.write('\n') - - # Now write children recursively - for child in rna_children_dict[identifier]: - write_struct(child, ident + '\t') - - - - # out = open(target_path, 'w') - out = open_submodule("types.py", BASEPATH) # bpy.types - - def base_id(rna_struct): - try: return rna_struct.base.identifier - except: return '' # invalid id - - #structs = [(base_id(rna_struct), rna_struct.identifier, rna_struct) for rna_struct in bpy.doc.structs.values()] - ''' - structs = [] - for rna_struct in bpy.doc.structs.values(): - structs.append( (base_id(rna_struct), rna_struct.identifier, rna_struct) ) - ''' - structs = [] - for rna_type_name in dir(bpy.types): - rna_type = getattr(bpy.types, rna_type_name) - - try: rna_struct = rna_type.bl_rna - except: rna_struct = None - - if rna_struct: - #if not rna_type_name.startswith('__'): - - identifier = rna_struct.identifier - - if not rna_id_ignore(identifier): - structs.append( (base_id(rna_struct), identifier, rna_struct) ) - - # Simple lookup - rna_struct_dict[identifier] = rna_struct - - # Store full rna path 'GameObjectSettings' -> 'Object.GameObjectSettings' - rna_full_path_dict[identifier] = full_rna_struct_path(rna_struct) - - # Store a list of functions, remove inherited later - rna_functions_dict[identifier]= list(rna_struct.functions) - - - # fill in these later - rna_children_dict[identifier]= [] - rna_references_dict[identifier]= [] - - - else: - print("Ignoring", rna_type_name) - - - # Sucks but we need to copy this so we can check original parent functions - rna_functions_dict__copy = {} - for key, val in rna_functions_dict.items(): - rna_functions_dict__copy[key] = val[:] - - - structs.sort() # not needed but speeds up sort below, setting items without an inheritance first - - # Arrange so classes are always defined in the correct order - deps_ok = False - while deps_ok == False: - deps_ok = True - rna_done = set() - - for i, (rna_base, identifier, rna_struct) in enumerate(structs): - - rna_done.add(identifier) - - if rna_base and rna_base not in rna_done: - deps_ok = False - data = structs.pop(i) - ok = False - while i < len(structs): - if structs[i][1]==rna_base: - structs.insert(i+1, data) # insert after the item we depend on. - ok = True - break - i+=1 - - if not ok: - print('Dependancy "%s" could not be found for "%s"' % (identifier, rna_base)) - - break - - # Done ordering structs - - - # precalc vars to avoid a lot of looping - for (rna_base, identifier, rna_struct) in structs: - - if rna_base: - rna_base_prop_keys = rna_struct_dict[rna_base].properties.keys() # could cache - rna_base_func_keys = [f.identifier for f in rna_struct_dict[rna_base].functions] - else: - rna_base_prop_keys = [] - rna_base_func_keys= [] - - # rna_struct_path = full_rna_struct_path(rna_struct) - rna_struct_path = rna_full_path_dict[identifier] - - for rna_prop_identifier, rna_prop in rna_struct.properties.items(): - - if rna_prop_identifier=='RNA': continue - if rna_id_ignore(rna_prop_identifier): continue - if rna_prop_identifier in rna_base_prop_keys: continue - - - for rna_prop_ptr in (getattr(rna_prop, "fixed_type", None), getattr(rna_prop, "srna", None)): - # Does this property point to me? - if rna_prop_ptr: - rna_references_dict[rna_prop_ptr.identifier].append( "%s.%s" % (rna_struct_path, rna_prop_identifier) ) - - for rna_func in rna_struct.functions: - for rna_prop_identifier, rna_prop in rna_func.parameters.items(): - - if rna_prop_identifier=='RNA': continue - if rna_id_ignore(rna_prop_identifier): continue - if rna_prop_identifier in rna_base_func_keys: continue - - - try: rna_prop_ptr = rna_prop.fixed_type - except: rna_prop_ptr = None - - # Does this property point to me? - if rna_prop_ptr: - rna_references_dict[rna_prop_ptr.identifier].append( "%s.%s" % (rna_struct_path, rna_func.identifier) ) - - - # Store nested children - nested = rna_struct.nested - if nested: - rna_children_dict[nested.identifier].append(rna_struct) - - - if rna_base: - rna_funcs = rna_functions_dict[identifier] - if rna_funcs: - # Remove inherited functions if we have any - rna_base_funcs = rna_functions_dict__copy[rna_base] - rna_funcs[:] = [f for f in rna_funcs if f not in rna_base_funcs] - - rna_functions_dict__copy.clear() - del rna_functions_dict__copy - - # Sort the refs, just reads nicer - for rna_refs in rna_references_dict.values(): - rna_refs.sort() - - for (rna_base, identifier, rna_struct) in structs: - if rna_struct.nested: - continue - - write_struct(rna_struct, '') - - - out.write('\n') - out.close() - - # # We could also just run.... - # os.system('epydoc source/blender/python/doc/rna.py -o ./source/blender/python/doc/html -v') - - target_path = os.path.join(BASEPATH, "dump.py") # XXX - used for other funcs - - # Write graphviz - out= open(target_path.replace('.py', '.dot'), 'w') - out.write('digraph "rna data api" {\n') - out.write('\tnode [style=filled, shape = "box"];\n') - out.write('\toverlap=false;\n') - out.write('\trankdir = LR;\n') - out.write('\tsplines=true;\n') - out.write('\tratio=auto;\n') - - - - out.write('\tsize="10,10"\n') - #out.write('\tpage="8.5,11"\n') - #out.write('\tcenter=""\n') - - def isop(rna_struct): - return '_OT_' in rna_struct.identifier - - - for (rna_base, identifier, rna_struct) in structs: - if isop(rna_struct): - continue - - base = rna_struct.base - - - out.write('\t"%s";\n' % identifier) - - for (rna_base, identifier, rna_struct) in structs: - - if isop(rna_struct): - continue - - base = rna_struct.base - - if base and not isop(base): - out.write('\t"%s" -> "%s" [label="(base)" weight=1.0];\n' % (base.identifier, identifier)) - - nested = rna_struct.nested - if nested and not isop(nested): - out.write('\t"%s" -> "%s" [label="(nested)" weight=1.0];\n' % (nested.identifier, identifier)) - - - - rna_refs= rna_references_dict[identifier] - - for rna_ref_string in rna_refs: - - if '_OT_' in rna_ref_string: - continue - - ref = rna_ref_string.split('.')[-2] - out.write('\t"%s" -> "%s" [label="%s" weight=0.01];\n' % (ref, identifier, rna_ref_string)) - - - out.write('}\n') - out.close() - - # # We could also just run.... - # os.system('dot source/blender/python/doc/rna.dot -Tsvg -o ./source/blender/python/doc/rna.svg') - - - out= open(target_path.replace('.py', '.words'), 'w') - rna_words = list(rna_words) - rna_words.sort() - for w in rna_words: - out.write('%s\n' % w) - - -def op2epy(BASEPATH): - # out = open(target_path, 'w') - - op_mods = dir(bpy.ops) - op_mods.remove('add') - op_mods.remove('remove') - - for op_mod_name in sorted(op_mods): - if op_mod_name.startswith('__'): - continue - - # open the submodule - mod_path = os.path.join("ops", op_mod_name + ".py") - out = open_submodule(mod_path, BASEPATH) - - - op_mod = getattr(bpy.ops, op_mod_name) - operators = dir(op_mod) - for op in sorted(operators): - # rna = getattr(bpy.types, op).bl_rna - rna = getattr(op_mod, op).get_rna() - write_func(rna, '', out, 'OPERATOR') - - out.write('\n') - out.close() - -def misc2epy(BASEPATH): - ''' - Hard coded modules, try to avoid adding stuff here - ''' - - f = append_package(os.path.join(BASEPATH, ""), ""); # add a slash on the end of the base path - f.write(''' -""" -@type data: L{bpy.types.Main} -@var data: blender data is accessed from here -""" -''') - - f = open_submodule("props.py", BASEPATH) - f.write(''' -MAX_INT= 2**31 -MAX_FLOAT= 1e+37 -def BoolProperty(attr, name="", description="", default=False): - """ - return a new bool property - """ -def IntProperty(attr, name="", description="", min=-MAX_INT, max=MAX_INT, soft_min=-MAX_INT, soft_max=MAX_INT, default=0): - """ - return a new int property - """ -def FloatProperty(attr, name="", description="", min=-MAX_FLOAT, max=MAX_FLOAT, soft_min=-MAX_FLOAT, soft_max=MAX_FLOAT, default=0.0): - """ - return a new float property - """ -def StringProperty(attr, name="", description="", maxlen=0, default=""): - """ - return a new string property - """ -def EnumProperty(attr, items, name="", description="", default=""): - """ - return a new enum property - """ -''') - - -if __name__ == '__main__': - if 'bpy' not in dir(): - print("\nError, this script must run from inside blender2.5") - print(script_help_msg) - else: - misc2epy('source/blender/python/doc/bpy') # first to write in info in some of the modules. - rna2epy('source/blender/python/doc/bpy') - op2epy('source/blender/python/doc/bpy') - - - close_all() - - import sys - sys.exit() diff --git a/source/blender/python/intern/Makefile b/source/blender/python/intern/Makefile deleted file mode 100644 index 6c0b7b4d14e..00000000000 --- a/source/blender/python/intern/Makefile +++ /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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# - -LIBNAME = python -DIR = $(OCGDIR)/blender/$(LIBNAME) - -include nan_compile.mk - -CFLAGS += $(LEVEL_1_C_WARNINGS) - -# OpenGL and Python -CPPFLAGS += $(OGL_CPPFLAGS) -CPPFLAGS += -I$(NAN_GLEW)/include -CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) - -# PreProcessor stuff - -CPPFLAGS += -I$(NAN_GHOST)/include -CPPFLAGS += $(NAN_SDLCFLAGS) - -# 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../../windowmanager -CPPFLAGS += -I../../render/extern/include -CPPFLAGS += -I$(NAN_AUDASPACE)/include - -# path to the guarded memory allocator -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include -CPPFLAGS += -I$(NAN_MEMUTIL)/include - -# path to our own headerfiles -CPPFLAGS += -I.. diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index e9969277550..ba19f155842 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -31,7 +31,6 @@ /* --- bpy build options --- */ #ifdef WITH_PYTHON_SAFETY -#include /* play it safe and keep optional for now, need to test further now this affects looping on 10000's of verts for eg. */ #define USE_WEAKREFS diff --git a/source/blender/python/intern/bpy_ui.c b/source/blender/python/intern/bpy_ui.c deleted file mode 100644 index ab50ebd8bd5..00000000000 --- a/source/blender/python/intern/bpy_ui.c +++ /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. - * - * Contributor(s): Campbell Barton - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include "bpy_ui.h" -#include "bpy_util.h" -#include "bpy_rna.h" /* for rna buttons */ -#include "bpy_operator.h" /* for setting button operator properties */ - -#include "WM_types.h" /* for WM_OP_INVOKE_DEFAULT & friends */ - -#include "BLI_dynstr.h" - -#include "MEM_guardedalloc.h" -#include "BKE_global.h" /* evil G.* */ -#include "BKE_context.h" - -#include "DNA_screen_types.h" -#include "DNA_space_types.h" /* only for SpaceLink */ -#include "UI_interface.h" -#include "WM_api.h" - -/* Dummy Module, may want to include non RNA UI functions here, else it can be removed */ - -static struct PyMethodDef ui_methods[] = { - {NULL, NULL, 0, NULL} -}; - -static struct PyModuleDef ui_module = { - PyModuleDef_HEAD_INIT, - "_bpy.ui", - "", - -1,/* multiple "initialization" just copies the module dict. */ - ui_methods, - NULL, NULL, NULL, NULL -}; - -PyObject *BPY_ui_module( void ) -{ - PyObject *submodule; - submodule= PyModule_Create(&ui_module); - - /* INCREF since its its assumed that all these functions return the - * module with a new ref like PyDict_New, since they are passed to - * PyModule_AddObject which steals a ref */ - Py_INCREF(submodule); - - return submodule; -} diff --git a/source/blender/python/intern/bpy_ui.h b/source/blender/python/intern/bpy_ui.h deleted file mode 100644 index 95afa1f08c8..00000000000 --- a/source/blender/python/intern/bpy_ui.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * $Id: bpy_ui.h 21094 2009-06-23 00:09:26Z gsrb3d $ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public 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 ***** - */ -#ifndef BPY_UI_H__ -#define BPY_UI_H__ - -#include - -PyObject *BPY_ui_module( void ); - -#endif diff --git a/source/blender/python/simple_enum_gen.py b/source/blender/python/simple_enum_gen.py index a536f04ecde..bc7a2df9fb6 100644 --- a/source/blender/python/simple_enum_gen.py +++ b/source/blender/python/simple_enum_gen.py @@ -19,24 +19,24 @@ # #**** END GPL LICENSE BLOCK #**** defs = """ - SPACE_EMPTY, - SPACE_VIEW3D, - SPACE_IPO, - SPACE_OUTLINER, - SPACE_BUTS, - SPACE_FILE, + SPACE_EMPTY, + SPACE_VIEW3D, + SPACE_IPO, + SPACE_OUTLINER, + SPACE_BUTS, + SPACE_FILE, SPACE_IMAGE, - SPACE_INFO, - SPACE_SEQ, - SPACE_TEXT, - SPACE_IMASEL, - SPACE_SOUND, - SPACE_ACTION, - SPACE_NLA, - SPACE_SCRIPT, - SPACE_TIME, - SPACE_NODE, - SPACEICONMAX + SPACE_INFO, + SPACE_SEQ, + SPACE_TEXT, + SPACE_IMASEL, + SPACE_SOUND, + SPACE_ACTION, + SPACE_NLA, + SPACE_SCRIPT, + SPACE_TIME, + SPACE_NODE, + SPACEICONMAX """ print '\tmod = PyModule_New("dummy");' @@ -44,21 +44,21 @@ print '\tPyModule_AddObject( submodule, "key", mod );' for d in defs.split('\n'): - d = d.replace(',', ' ') - w = d.split() + d = d.replace(',', ' ') + w = d.split() - if not w: - continue + if not w: + continue - try: w.remove("#define") - except: pass + try: w.remove("#define") + except: pass - # print w + # print w - val = w[0] - py_val = w[0] + val = w[0] + py_val = w[0] - print '\tPyModule_AddObject( mod, "%s", PyLong_FromSize_t(%s) );' % (val, py_val) + print '\tPyModule_AddObject( mod, "%s", PyLong_FromSize_t(%s) );' % (val, py_val) diff --git a/source/blender/readblenfile/intern/BLO_readblenfile.c b/source/blender/readblenfile/intern/BLO_readblenfile.c index 1559ba7bfdc..351de4bd215 100644 --- a/source/blender/readblenfile/intern/BLO_readblenfile.c +++ b/source/blender/readblenfile/intern/BLO_readblenfile.c @@ -169,3 +169,4 @@ cleanup: return bfd; } + diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h index 0ff9fd97cce..4df10bd9f84 100644 --- a/source/blender/render/intern/raytrace/reorganize.h +++ b/source/blender/render/intern/raytrace/reorganize.h @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -180,7 +179,7 @@ void pushup(Node *parent) { float c_area = bb_area(child->bb, child->bb+3) ; int nchilds = count_childs(child); - float original_cost = (c_area / p_area)*nchilds + 1; + float original_cost = ((p_area != 0.0f)? (c_area / p_area)*nchilds: 1.0f) + 1; float flatten_cost = nchilds; if(flatten_cost < original_cost && nchilds >= 2) { @@ -311,7 +310,6 @@ float bvh_refit(Node *node) * with the purpose to reduce the expected cost (eg.: number of BB tests). */ #include -#include #define MAX_CUT_SIZE 4 /* svbvh assumes max 4 children! */ #define MAX_OPTIMIZE_CHILDS MAX_CUT_SIZE @@ -419,7 +417,7 @@ struct VBVH_optimalPackSIMD for(Node *child = node->child; child && RE_rayobject_isAligned(child); child = child->sibling) { this->child[nchilds] = child; - this->child_hit_prob[nchilds] = bb_area(child->bb, child->bb+3) / parent_area; + this->child_hit_prob[nchilds] = (parent_area != 0.0f)? bb_area(child->bb, child->bb+3) / parent_area: 1.0f; nchilds++; } @@ -489,7 +487,7 @@ struct VBVH_optimalPackSIMD float parent_area = bb_area(node->bb, node->bb+3); for(Node *child = node->child; child && RE_rayobject_isAligned(child); child = child->sibling) { - cost += ( bb_area(child->bb, child->bb+3) / parent_area ) * child->get_cost(1); + cost += ((parent_area != 0.0f)? ( bb_area(child->bb, child->bb+3) / parent_area ): 1.0f) * child->get_cost(1); } cost += testcost(nchilds); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 72ec9bd6613..436f0ecd997 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2540,7 +2540,7 @@ static void do_render_seq(Render * re) if(ibuf->rect_float) { if (!rr->rectf) rr->rectf= MEM_mallocN(4*sizeof(float)*rr->rectx*rr->recty, "render_seq rectf"); - + /* color management: when off ensure rectf is non-lin, since thats what the internal * render engine delivers */ if(re->r.color_mgt_flag & R_COLOR_MANAGEMENT) { diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index b48f1d21872..d3d3e4d261c 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -214,7 +214,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, Object *ob) for(i=0; i < pd->totpoints; i++, mvert++) { float co[3]; - + VECCOPY(co, mvert->co); switch(pd->ob_cache_space) { @@ -264,7 +264,7 @@ static void cache_pointdensity(Render *re, Tex *tex) Object *ob = pd->object; if (ob && ob->type == OB_MESH) pointdensity_cache_object(re, pd, ob); - } + } } static void free_pointdensity(Render *UNUSED(re), Tex *tex) diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 55249847aa4..5a5de938e43 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -384,6 +384,25 @@ void renderspothalo(ShadeInput *shi, float *col, float alpha) /* ---------------- shaders ----------------------- */ +static double Normalize_d(double *n) +{ + double d; + + d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2]; + + if(d>0.00000000000000001) { + d= sqrt(d); + + n[0]/=d; + n[1]/=d; + n[2]/=d; + } else { + n[0]=n[1]=n[2]= 0.0; + d= 0.0; + } + return d; +} + /* mix of 'real' fresnel and allowing control. grad defines blending gradient */ float fresnel_fac(float *view, float *vn, float grad, float fac) { @@ -422,10 +441,10 @@ static float area_lamp_energy(float (*area)[3], float *co, float *vn) VECSUB(vec[2], co, area[2]); VECSUB(vec[3], co, area[3]); - normalize_dv3(vec[0]); - normalize_dv3(vec[1]); - normalize_dv3(vec[2]); - normalize_dv3(vec[3]); + Normalize_d(vec[0]); + Normalize_d(vec[1]); + Normalize_d(vec[2]); + Normalize_d(vec[3]); /* cross product */ CROSS(cross[0], vec[0], vec[1]); @@ -433,10 +452,10 @@ static float area_lamp_energy(float (*area)[3], float *co, float *vn) CROSS(cross[2], vec[2], vec[3]); CROSS(cross[3], vec[3], vec[0]); - normalize_dv3(cross[0]); - normalize_dv3(cross[1]); - normalize_dv3(cross[2]); - normalize_dv3(cross[3]); + Normalize_d(cross[0]); + Normalize_d(cross[1]); + Normalize_d(cross[2]); + Normalize_d(cross[3]); /* angles */ rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2]; diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index c6803216d78..e01ed4a7f1b 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -28,7 +28,8 @@ set(INC . ../nodes ../gpu - ../blenfont ../bmesh + ../blenfont + ../bmesh ../blenlib ../makesdna ../makesrna diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 6cad7022609..c4d7e6e6454 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1764,7 +1764,7 @@ void wm_event_do_handlers(bContext *C) while( (event= win->queue.first) ) { int action = WM_HANDLER_CONTINUE; - + if((G.f & G_DEBUG) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) printf("pass on evt %d val %d\n", event->type, event->val); @@ -1904,7 +1904,6 @@ void wm_event_do_handlers(bContext *C) win->lasttime = PIL_check_seconds_timer(); } - /* only add mousemove when queue was read entirely */ if(win->addmousemove && win->eventstate) { wmEvent tevent= *(win->eventstate); @@ -2348,8 +2347,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U switch (type) { /* mouse move */ case GHOST_kEventCursorMove: { - if(win->active) { - + if(win->active) { GHOST_TEventCursorData *cd= customdata; wmEvent *lastevent= win->queue.last; @@ -2410,7 +2408,6 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U event.type= MOUSEPAN; break; } - #if defined(__APPLE__) && defined(GHOST_COCOA) //Cocoa already uses coordinates with y=0 at bottom, and returns inwindow coordinates on mouse moved event event.x= evt->x = pd->x; @@ -2436,7 +2433,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U case GHOST_kEventButtonUp: { GHOST_TEventButtonData *bd= customdata; event.val= (type==GHOST_kEventButtonDown) ? KM_PRESS:KM_RELEASE; /* Note!, this starts as 0/1 but later is converted to KM_PRESS/KM_RELEASE by tweak */ - + if (bd->button == GHOST_kButtonMaskLeft) event.type= LEFTMOUSE; else if (bd->button == GHOST_kButtonMaskRight) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 697fd4954f7..14bb8e9021d 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2255,15 +2255,15 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, wmEvent *event) int sx, sy; if(event->type== MOUSEMOVE) { - wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy); + wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy); - rect->xmin= event->x - sx; - rect->ymin= event->y - sy; + rect->xmin= event->x - sx; + rect->ymin= event->y - sy; - wm_gesture_tag_redraw(C); + wm_gesture_tag_redraw(C); - if(gesture->mode) - gesture_circle_apply(C, op); + if(gesture->mode) + gesture_circle_apply(C, op); } else if (event->type==EVT_MODAL_MAP) { switch (event->val) { diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 630c3921a95..4caaf62617c 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -912,9 +912,7 @@ static int wm_window_timer(const bContext *C) void wm_window_process_events(const bContext *C) { - int hasevent= 0; - - hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */ + int hasevent= GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */ if(hasevent) GHOST_DispatchEvents(g_system); diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 9b2abeac128..81e1b51834d 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -236,12 +236,14 @@ if(UNIX AND NOT APPLE) else() set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION}) endif() + # important to make a clean install each time # else old scripts get loaded. install( CODE "file(REMOVE_RECURSE ${TARGETDIR_VER})" ) + # message after building. add_custom_command( TARGET blender POST_BUILD MAIN_DEPENDENCY blender @@ -414,9 +416,6 @@ elseif(WIN32) install( FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll DESTINATION ${TARGETDIR}/ - COMMAND if not exist \"${TARGETDIR}\\${BLENDER_VERSION}\\config\\locale\" mkdir \"${TARGETDIR}\\${BLENDER_VERSION}\\config\\locale\" - COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\${BLENDER_VERSION}\\config\\\" - COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\${BLENDER_VERSION}\\config\\locale\\\" ) install( @@ -813,6 +812,7 @@ endif() bf_intern_audaspace bf_intern_mikktspace ) + if(WITH_MOD_CLOTH_ELTOPO) list(APPEND BLENDER_SORTED_LIBS extern_eltopo) endif() diff --git a/source/creator/creator.c b/source/creator/creator.c index 0b76699996e..2a7c0dc6d4a 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1168,7 +1168,6 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAddCase(ba, 3, "-noaudio", 1, NULL, 0, "\n\tForce sound system to None", no_audio, NULL); BLI_argsAddCase(ba, 3, "-setaudio", 1, NULL, 0, "\n\tForce sound system to a specific device\n\tNULL SDL OPENAL JACK", set_audio, NULL); - /* fourth pass: processing arguments */ BLI_argsAdd(ba, 4, "-g", NULL, game_doc, set_ge_parameters, syshandle); BLI_argsAdd(ba, 4, "-f", "--render-frame", "\n\tRender frame and save it.\n\t+ start frame relative, - end frame relative.", render_frame, C); @@ -1204,6 +1203,7 @@ int main(int argc, const char **argv) SYS_SystemHandle syshandle; bContext *C= CTX_create(); bArgs *ba; + #ifdef WITH_PYTHON_MODULE #undef main #endif @@ -1370,7 +1370,7 @@ int main(int argc, const char **argv) } WM_main(C); - + /*XXX if (scr_init==0) { main_init_screen(); diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 5fd77aa51d6..08642262724 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -32,7 +32,6 @@ if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] defs.append('WITH_PYTHON') - if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index 2db42f8285f..4164271ba9b 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -12,7 +12,6 @@ if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] defs.append('WITH_PYTHON') - if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC')