merge with 2.5 at r18679
authorJoseph Eagar <joeedh@gmail.com>
Mon, 26 Jan 2009 13:19:52 +0000 (13:19 +0000)
committerJoseph Eagar <joeedh@gmail.com>
Mon, 26 Jan 2009 13:19:52 +0000 (13:19 +0000)
340 files changed:
CMakeLists.txt
SConstruct
config/darwin-config.py
config/irix6-config.py
config/linux2-config.py
config/sunos5-config.py
config/win32-mingw-config.py
config/win32-vc-config.py
extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.cpp
extern/libopenjpeg/SConscript
extern/libopenjpeg/openjpeg.h
intern/elbeem/extern/LBM_fluidsim.h
projectfiles_vc9/blender/blender.sln
projectfiles_vc9/blender/blender.vcproj
projectfiles_vc9/blender/editors/ED_editors.vcproj
projectfiles_vc9/blender/windowmanager/windowmanager.vcproj
release/scripts/ac3d_import.py
release/scripts/animation_bake_constraints.py
release/scripts/bpymodules/BPyMesh.py
release/scripts/bpymodules/dxfLibrary.py
release/scripts/export_fbx.py
release/scripts/help_bpy_api.py
release/scripts/help_browser.py
release/scripts/help_getting_started.py
release/scripts/help_manual.py
release/scripts/help_release_notes.py
release/scripts/help_tutorials.py
release/scripts/help_web_blender.py
release/scripts/help_web_devcomm.py
release/scripts/help_web_eshop.py
release/scripts/help_web_usercomm.py
release/scripts/import_web3d.py
release/scripts/mesh_edges2curves.py
release/scripts/scripttemplate_background_job.py [new file with mode: 0644]
release/scripts/uvcalc_follow_active_coords.py
release/scripts/uvcalc_quad_clickproj.py
release/scripts/vertexpaint_from_material.py
source/Makefile
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_fcurve.h
source/blender/blenkernel/BKE_font.h
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_ipo.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/BKE_sculpt.h
source/blender/blenkernel/BKE_sequence.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/BME_conversions.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/fluidsim.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/screen.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequence.c
source/blender/blenlib/BLI_arithb.h
source/blender/blenlib/intern/arithb.c
source/blender/blenlib/intern/graph.c
source/blender/blenloader/SConscript
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/iff.h
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/editors/SConscript
source/blender/editors/animation/anim_channels.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/editarmature.c
source/blender/editors/curve/curve_intern.h [new file with mode: 0644]
source/blender/editors/curve/curve_ops.c [new file with mode: 0644]
source/blender/editors/curve/editfont.c [new file with mode: 0644]
source/blender/editors/curve/lorem.c [new file with mode: 0644]
source/blender/editors/datafiles/preview.blend.c [new file with mode: 0644]
source/blender/editors/gpencil/gpencil.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_curve.h
source/blender/editors/include/ED_editparticle.h [new file with mode: 0644]
source/blender/editors/include/ED_fluidsim.h [new file with mode: 0644]
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_previewrender.h
source/blender/editors/include/ED_screen.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_ops.c
source/blender/editors/physics/ed_fluidsim.c [new file with mode: 0644]
source/blender/editors/physics/editparticle.c [new file with mode: 0644]
source/blender/editors/physics/physics_intern.h [new file with mode: 0644]
source/blender/editors/preview/previewrender.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt/sculpt.c
source/blender/editors/sculpt/sculpt_intern.h
source/blender/editors/sculpt/stroke.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_header.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_file/Makefile
source/blender/editors/space_file/SConscript
source/blender/editors/space_file/file_intern.h
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_file/writeimage.c [new file with mode: 0644]
source/blender/editors/space_image/image_header.c
source/blender/editors/space_image/image_render.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_ipo/ipo_draw.c
source/blender/editors/space_ipo/ipo_header.c
source/blender/editors/space_ipo/ipo_intern.h
source/blender/editors/space_ipo/space_ipo.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_node/node_state.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner_header.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_header.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_sound/space_sound.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_time/time_header.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/vpaint.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/undo.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/gpu/GPU_draw.h
source/blender/gpu/intern/gpu_material.c
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/intern/IMB_jp2.h [new file with mode: 0644]
source/blender/imbuf/intern/jp2.c [new file with mode: 0644]
source/blender/imbuf/intern/openexr/CMakeLists.txt
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/util.c
source/blender/imbuf/intern/writeimage.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_actuator_types.h
source/blender/makesdna/DNA_brush_types.h
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/nodes/CMakeLists.txt
source/blender/nodes/SConscript
source/blender/nodes/intern/CMP_nodes/CMP_filter.c
source/blender/nodes/intern/Makefile
source/blender/python/intern/bpy_compat.h
source/blender/python/intern/bpy_rna.c
source/blender/radiosity/intern/source/radfactors.c
source/blender/radiosity/intern/source/radrender.c
source/blender/readblenfile/intern/BLO_readblenfile.c
source/blender/render/CMakeLists.txt
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/sss.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/zbuf.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_draw.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_gesture.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_jobs.c [new file with mode: 0644]
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_subwindow.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm.h
source/blender/windowmanager/wm_draw.h [new file with mode: 0644]
source/blender/windowmanager/wm_event_system.h
source/blender/windowmanager/wm_event_types.h
source/blender/yafray/intern/export_File.cpp
source/blender/yafray/intern/export_Plugin.cpp
source/creator/creator.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ActionActuator.h
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/BL_ShapeActionActuator.h
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/KX_ConvertSensors.cpp
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/Value.cpp
source/gameengine/Expressions/Value.h
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_ActuatorSensor.h
source/gameengine/GameLogic/SCA_DelaySensor.h
source/gameengine/GameLogic/SCA_IInputDevice.h
source/gameengine/GameLogic/SCA_ILogicBrick.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.h
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_ISensor.h
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.h
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.h
source/gameengine/GameLogic/SCA_MouseSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.h
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertyActuator.h
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_PropertySensor.h
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GameLogic/SCA_PythonController.h
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GameLogic/SCA_RandomActuator.h
source/gameengine/GameLogic/SCA_RandomSensor.cpp
source/gameengine/GameLogic/SCA_RandomSensor.h
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/GamePlayer/ghost/Makefile
source/gameengine/GamePlayer/ghost/SConscript
source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
source/gameengine/Ketsji/KX_BulletPhysicsController.h
source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_IPhysicsController.cpp
source/gameengine/Ketsji/KX_IPhysicsController.h
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_OdePhysicsController.cpp
source/gameengine/Ketsji/KX_OdePhysicsController.h
source/gameengine/Ketsji/KX_PolyProxy.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
source/gameengine/Ketsji/KX_SumoPhysicsController.cpp
source/gameengine/Ketsji/KX_SumoPhysicsController.h
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.h
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
source/gameengine/Physics/common/PHY_DynamicTypes.h
source/gameengine/PyDoc/BL_ActionActuator.py
source/gameengine/PyDoc/BL_ShapeActionActuator.py
source/gameengine/PyDoc/KX_ActuatorSensor.py
source/gameengine/PyDoc/SCA_DelaySensor.py
source/gameengine/PyDoc/SCA_ILogicBrick.py
source/gameengine/PyDoc/SCA_ISensor.py
source/gameengine/PyDoc/SCA_JoystickSensor.py
source/gameengine/PyDoc/SCA_KeyboardSensor.py
source/gameengine/PyDoc/SCA_MouseSensor.py
source/gameengine/PyDoc/SCA_PropertyActuator.py
source/gameengine/PyDoc/SCA_PropertySensor.py
source/gameengine/PyDoc/SCA_PythonController.py
source/gameengine/PyDoc/SCA_RandomActuator.py
source/nan_definitions.mk

index 0df36f04173a86ace7bfa75710100e765215789f..50cd07820f998d04d4613f7ae2fd8a7db60b38c8 100644 (file)
@@ -175,7 +175,7 @@ IF(UNIX)
 
   SET(FFMPEG /usr)
   SET(FFMPEG_INC ${FFMPEG}/include)
-  SET(FFMPEG_LIB avformat avcodec avutil)
+  SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
 
   SET(JPEG_LIB jpeg)
index 03373ab63cfcc26ccef4c7190b137200969691e0..eeb39e9e6125924b97575b466809b953e924c0ed 100644 (file)
@@ -113,6 +113,7 @@ if toolset:
                env.Tool('mstoolkit', ['tools'])
        else:
                env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
+               # xxx commented out, as was supressing warnings under mingw..
                #if env:
                #       btools.SetupSpawn(env)
 else:
@@ -323,10 +324,15 @@ if not quickie and do_clean:
                                print "remove file %s"%(B.root_build_dir+entry)
                                os.remove(B.root_build_dir+entry)
                for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
-                               'extern/xvidcore/build/generic/platform.inc']:
+                               'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
                        if os.path.exists(confile):
                                print "clean file %s"%confile
-                               os.remove(confile)
+                               if os.path.isdir(confile):
+                                       for root, dirs, files in os.walk(confile):
+                                               for name in files:
+                                                       os.remove(os.path.join(root, name))
+                               else:
+                                       os.remove(confile)
                print B.bc.OKGREEN+'...done'+B.bc.ENDC
        else:
                print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
index 8719c5e7da041d267558838301e3f00a0a083bbb..4f002aecef70af6959dac8cbce57b0e0a67dc710 100644 (file)
@@ -40,7 +40,11 @@ else:
 # enable ffmpeg  support
 WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
 BF_FFMPEG = "#extern/ffmpeg"
-BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+# trick : The version of ffmpeg in extern/ffmpeg uses explicit libav.. directory in #include statements
+#         To keep Blender compatible with older versions, I add ${BF_FFMPEG} to the inc dir so that ffmpeg
+#         finds the files directly in extern/ffmpeg/libav... while blender finds them in
+#         extern/ffmpeg/include. 
+BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}'
 if USE_SDK==True:
        BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
 #BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
index eb6c46b38de4f5da07ca84267d3bc1d5c2ca3169..cb66dbafcce5a59d9d3365d4b81ae47bdadfcb3e 100644 (file)
@@ -142,7 +142,7 @@ WITH_BF_BINRELOC = 'false'
 WITH_BF_FFMPEG = 'true'  # -DWITH_FFMPEG
 # Uncomment the following two lines to use system's ffmpeg
 BF_FFMPEG = LCGDIR+'/ffmpeg'
-BF_FFMPEG_LIB = 'avformat avcodec swscale avutil faad faac vorbis x264 ogg mp3lame z'
+BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice faad faac vorbis x264 ogg mp3lame z'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 
@@ -155,7 +155,7 @@ BF_OGG_LIB = 'ogg vorbis theoraenc theoradec'
 WITH_BF_OPENJPEG = 'false' 
 BF_OPENJPEG = '#extern/libopenjpeg'
 BF_OPENJPEG_LIB = ''
-BF_OPENJPEG_INC = '${BF_OPENJPEG}/include'
+BF_OPENJPEG_INC = '${BF_OPENJPEG}'
 BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
 
 WITH_BF_REDCODE = 'false'  
index 522ddbafb3f303a76164b9e4054379d5f9914b68..b2ca4c1822b91da9cf28ec46d034ab0fae658c76 100644 (file)
@@ -136,8 +136,13 @@ BF_FFMPEG = '#extern/ffmpeg'
 BF_FFMPEG_LIB = ''
 # Uncomment the following two lines to use system's ffmpeg
 # BF_FFMPEG = '/usr'
-# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil'
-BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
+# trick : The version of ffmpeg in extern/ffmpeg uses explicit libav.. directory in #include statements
+#         To keep Blender compatible with older version, I add ${BF_FFMPEG} to the inc dir so that ffmpeg
+#         finds the files directly in extern/ffmpeg/libav... while blender finds them in
+#         extern/ffmpeg/include. When using system ffmpeg, you don't need that, assuming the system library
+#         still use the flat directory model, otherwise will not compile anyway
+BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 
 # enable ogg, vorbis and theora in ffmpeg
@@ -149,13 +154,14 @@ BF_OGG_LIB = 'ogg vorbis theoraenc theoradec'
 WITH_BF_OPENJPEG = True 
 BF_OPENJPEG = '#extern/libopenjpeg'
 BF_OPENJPEG_LIB = ''
-BF_OPENJPEG_INC = '${BF_OPENJPEG}/include'
+BF_OPENJPEG_INC = '${BF_OPENJPEG}'
 BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
 
 WITH_BF_REDCODE = False  
 BF_REDCODE = '#extern/libredcode'
 BF_REDCODE_LIB = ''
-BF_REDCODE_INC = '${BF_REDCODE}/include'
+# BF_REDCODE_INC = '${BF_REDCODE}/include'
+BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
 BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
 
 # Mesa Libs should go here if your using them as well....
index a44a9df7c75e7dea8d70dc877535d110dd4657f6..dda7d0ff2f391305168e015767abba01d88c587c 100644 (file)
@@ -131,7 +131,7 @@ WITH_BF_FFMPEG = False  # -DWITH_FFMPEG
 BF_FFMPEG = '/usr/local'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
-BF_FFMPEG_LIB = 'avformat avcodec avutil'
+BF_FFMPEG_LIB = 'avformat avcodec avutil avdevice'
 
 # Mesa Libs should go here if your using them as well....
 WITH_BF_STATICOPENGL = False
index d69e4bfc7bc92e4c8b1b10abf81913b823605778..0ad93c3d38cb3d4a9d573076146406197a2a8123 100644 (file)
@@ -3,10 +3,12 @@ LIBDIR = "${LCGDIR}"
 
 BF_PYTHON = LIBDIR + '/python'
 BF_PYTHON_VERSION = '2.5'
+WITH_BF_STATICPYTHON = False
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = 'python'
 BF_PYTHON_LIB = 'python25'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/lib25_vs2005'
+BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/lib25_vs2005/libpython25.a'
 
 WITH_BF_OPENAL = True
 WITH_BF_STATICOPENAL = False
@@ -18,7 +20,7 @@ BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_FFMPEG = False
-BF_FFMPEG_LIB = 'avformat swscale avcodec avutil xvidcore x264'
+BF_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264'
 BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
 BF_FFMPEG_INC =  LIBDIR + '/gcc/ffmpeg/include'
 
index 2fbc1b8e586213386af4add8067ed8ef7826a627..22877bb93dc035b561746aab857d31cd60f24a8b 100644 (file)
@@ -150,6 +150,10 @@ BF_QUICKTIME_LIB = 'qtmlClient'
 BF_QUICKTIME_LIBPATH = '${BF_QUICKTIME}/Libraries'
 
 WITH_BF_OPENJPEG = True 
+BF_OPENJPEG = '#extern/libopenjpeg'
+BF_OPENJPEG_LIB = ''
+BF_OPENJPEG_INC = '${BF_OPENJPEG}'
+BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
 
 WITH_BF_REDCODE = False  
 BF_REDCODE_INC = '#extern'
index f08b810eadbc37ab728db159a43d04d1d9109275..997361a5069da7a50c6209ad9deb473ccd2130ff 100644 (file)
@@ -49,8 +49,6 @@ void  btCompoundShape::addChildShape(const btTransform& localTransform,btCollisio
        child.m_childShapeType = shape->getShapeType();
        child.m_childMargin = shape->getMargin();
 
-       m_children.push_back(child);
-
        //extend the local aabbMin/aabbMax
        btVector3 localAabbMin,localAabbMax;
        shape->getAabb(localTransform,localAabbMin,localAabbMax);
@@ -69,10 +67,11 @@ void        btCompoundShape::addChildShape(const btTransform& localTransform,btCollisio
        if (m_dynamicAabbTree)
        {
                const btDbvtVolume      bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
-               int index = m_children.size()-1;
+               int index = m_children.size();
                child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
        }
 
+       m_children.push_back(child);
 }
 
 void btCompoundShape::removeChildShapeByIndex(int childShapeIndex)
index decdd8b5a3d8e7802f8be3b9188a55c651c8ac03..14b7102cbcdb987185e0bbb1e08a8903eed25ede 100644 (file)
@@ -6,9 +6,12 @@ Import('env')
 
 sources = env.Glob('*.c')
 incs = '.'
+flags = []
+defs = []
 
 if env['OURPLATFORM'] == 'win32-vc':
        flags = []
+       defs.append('OPJ_STATIC')
 else:
        flags = ['-Wall', '-O3', '-ffast-math', '-std=c99']
 
@@ -19,6 +22,6 @@ if not env['OURPLATFORM'] == 'win32-vc':
 
 oj_env.BlenderLib ( libname='extern_openjpeg', 
                     sources=sources, includes=Split(incs),
-                    defines=[],
+                    defines=defs,
                     libtype=['extern'],
                     priority=[10], compileflags = flags)
index ffcaacaf6e57fd490b6de72f398a298797c7f458..ae7764eab2f5028a4f57d35aa73e7672c34d9e33 100644 (file)
 ==========================================================
 */
 
-#if defined(OPJ_STATIC) || !(defined(WIN32) || defined(__WIN32__))
 #define OPJ_API
 #define OPJ_CALLCONV
-#else
-#define OPJ_CALLCONV __stdcall
-/*
-The following ifdef block is the standard way of creating macros which make exporting 
-from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
-symbol defined on the command line. this symbol should not be defined on any project
-that uses this DLL. This way any other project whose source files include this file see 
-OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
-defined with this macro as being exported.
-*/
-#ifdef OPJ_EXPORTS
-#define OPJ_API __declspec(dllexport)
-#else
-#define OPJ_API __declspec(dllimport)
-#endif /* OPJ_EXPORTS */
-#endif /* !OPJ_STATIC || !WIN32 */
 
 #ifndef __cplusplus
 #if defined(HAVE_STDBOOL_H)
index dd8c63d0d39a45e0dd5045fddfa4cdd0794434a0..ec30d65af20c776e4015728b2a7092a4598a7a16 100644 (file)
 #ifndef LBM_FLUIDSIM_H
 #define LBM_FLUIDSIM_H
 
-struct Mesh;
-struct DerivedMesh;
-struct Object;
-struct fluidsimDerivedMesh;
-
-extern double fluidsimViscosityPreset[6];
-extern char* fluidsimViscosityPresetString[6];
-
-/* allocates and initializes fluidsim data */
-struct FluidsimSettings* fluidsimSettingsNew(struct Object *srcob);
-
-/* frees internal data itself */
-void fluidsimSettingsFree(struct FluidsimSettings* sb);
-
-/* duplicate internal data */
-struct FluidsimSettings* fluidsimSettingsCopy(struct FluidsimSettings* sb);
-
-/* export blender geometry to fluid solver */
-void fluidsimBake(struct Object* ob);
-
-/* read & write bobj / bobj.gz files (e.g. for fluid sim surface meshes) */
-void writeBobjgz(char *filename, struct Object *ob, int useGlobalCoords, int append, float time);
-struct Mesh* readBobjgz(char *filename, struct Mesh *orgmesh, float* bbstart, float *bbsize);
-
-/* create derived mesh for fluid sim objects */
-// WARNING - currently implemented in DerivedMesh.c!
-void loadFluidsimMesh(struct Object *srcob, int useRenderParams);
+/* note; elbeem.h was exported all over, should only expose LBM_fluidsim.h */
+#include "elbeem.h"
 
 /* run simulation with given config file */
-// WARNING - implemented in intern/elbeem/blendercall.cpp
+// implemented in intern/elbeem/blendercall.cpp
 int performElbeemSimulation(char *cfgfilename);
 
 
index b758855f1c0cb3771c006488f37d694f13a48569..a807fa93afa3b3f143096950db7e2ef448b520e2 100644 (file)
@@ -1,5 +1,5 @@
 Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
+# Visual C++ Express 2008\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj", "{F78B7FC9-DE32-465E-9F26-BB0B6B7A2EAF}"\r
        ProjectSection(ProjectDependencies) = postProject\r
                {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F} = {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}\r
@@ -332,6 +332,34 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WM_windowmanager", "windowm
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ED_editors", "editors\ED_editors.vcproj", "{FB88301F-F725-401B-ACD7-D2ABBF333B71}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F} = {E5F2F004-C704-4DCC-A08F-6EB1E38EAB9F}\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25} = {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}\r
+               {F9850C15-FF0A-429E-9D47-89FB433C9BD8} = {F9850C15-FF0A-429E-9D47-89FB433C9BD8}\r
+               {884D8731-654C-4C7F-9A75-8F37A305BE1E} = {884D8731-654C-4C7F-9A75-8F37A305BE1E}\r
+               {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}\r
+               {FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}\r
+               {31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718}\r
+               {EADC3C5A-6C51-4F03-8038-1553E7D7F740} = {EADC3C5A-6C51-4F03-8038-1553E7D7F740}\r
+               {DB6BE55D-B6D9-494D-856A-8764FF7BA91D} = {DB6BE55D-B6D9-494D-856A-8764FF7BA91D}\r
+               {3D310C60-6771-48E4-BCCA-D2718CDED898} = {3D310C60-6771-48E4-BCCA-D2718CDED898}\r
+               {E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}\r
+               {138DD16C-CC78-4F6C-A898-C8DA68D89067} = {138DD16C-CC78-4F6C-A898-C8DA68D89067}\r
+               {415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}\r
+               {106AE171-0083-41D6-A949-20DB0E8DC251} = {106AE171-0083-41D6-A949-20DB0E8DC251}\r
+               {4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}\r
+               {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}\r
+               {9C71A793-C177-4CAB-8EC5-923D500B39F8} = {9C71A793-C177-4CAB-8EC5-923D500B39F8}\r
+               {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23} = {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}\r
+               {BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}\r
+               {9991A3C3-83FE-4AFE-9E18-9D01CB57E879} = {9991A3C3-83FE-4AFE-9E18-9D01CB57E879}\r
+               {0112CAD5-3584-412A-A2E5-1315A00437B4} = {0112CAD5-3584-412A-A2E5-1315A00437B4}\r
+               {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49} = {2AE0D2D9-6A7A-44DE-9EFF-99C9E3257B49}\r
+               {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = {5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}\r
+               {9A307EE5-CD77-47BC-BD87-62508C7E19D8} = {9A307EE5-CD77-47BC-BD87-62508C7E19D8}\r
+               {B83C6BED-11EC-46C8-AFFA-121EEDE94373} = {B83C6BED-11EC-46C8-AFFA-121EEDE94373}\r
+               {524264F4-DF21-4B79-847F-E7CA643ECD0B} = {524264F4-DF21-4B79-847F-E7CA643ECD0B}\r
+       EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RNA_makesrna", "makesrna\RNA_makesrna.vcproj", "{8C2BCCF8-4D9E-46D3-BABF-C1545A332CE6}"\r
        ProjectSection(ProjectDependencies) = postProject\r
@@ -348,6 +376,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNA_dna", "makesdna\DNA_dna
                {E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}\r
        EndProjectSection\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BL_bmesh", "..\BL_bmesh\BL_bmesh.vcproj", "{6A51010A-9393-4D77-84B4-5BBCDA6E7C25}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}\r
+               {31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718}\r
+               {E013786A-9575-4F34-81B2-33290357EE87} = {E013786A-9575-4F34-81B2-33290357EE87}\r
+               {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                3D Plugin Debug|Win32 = 3D Plugin Debug|Win32\r
@@ -1412,6 +1448,22 @@ Global
                {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Debug|Win32.Build.0 = Blender Debug|Win32\r
                {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Release|Win32.ActiveCfg = Blender Release|Win32\r
                {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Release|Win32.Build.0 = Blender Release|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.3D Plugin Debug|Win32.ActiveCfg = Debug|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.3D Plugin Debug|Win32.Build.0 = Debug|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.3D Plugin Release|Win32.ActiveCfg = Release|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.3D Plugin Release|Win32.Build.0 = Release|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.Blender Debug|Win32.ActiveCfg = Debug|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.Blender Debug|Win32.Build.0 = Debug|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.Blender Release|Win32.ActiveCfg = Release|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.Blender Release|Win32.Build.0 = Release|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.BlenderPlayer Debug|Win32.ActiveCfg = Debug|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.BlenderPlayer Debug|Win32.Build.0 = Debug|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.BlenderPlayer Release|Win32.ActiveCfg = Release|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.BlenderPlayer Release|Win32.Build.0 = Release|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.Debug|Win32.Build.0 = Debug|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.Release|Win32.ActiveCfg = Release|Win32\r
+               {6A51010A-9393-4D77-84B4-5BBCDA6E7C25}.Release|Win32.Build.0 = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
index 2c49c02b6d7ac5cf1bf7f72323ef8f80bb64fdb5..9206623cd0a6a097245e9539dcbd05dfab8be5a0 100644 (file)
@@ -73,7 +73,7 @@
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalOptions="/MACHINE:I386"\r
-                               AdditionalDependencies="SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib openal_static.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python25.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib"\r
+                               AdditionalDependencies="SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib openal_static.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python25.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-51.lib avformat-52.lib avutil-49.lib swscale-0.lib avdevice-52.lib"\r
                                ShowProgress="0"\r
                                OutputFile="..\..\bin\blender.exe"\r
                                LinkIncremental="1"\r
index a31268272da9d78b4db69c2ae2d103113888ea40..a1fa717607ab9e49dd13cbeb095d0f4531f69e97 100644 (file)
                                RelativePath="..\..\..\source\blender\editors\datafiles\blenderbuttons.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\editors\datafiles\preview.blend.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\editors\datafiles\prvicons.c"\r
                                >\r
index 5ad228218b6bf69336111b1e70946646cf2293c2..7e503fb25b8a9f3b86ce47d9fddf14dfa8f4253b 100644 (file)
                                RelativePath="..\..\..\source\blender\windowmanager\intern\wm_cursors.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\windowmanager\intern\wm_draw.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\windowmanager\intern\wm_event_system.c"\r
                                >\r
                                RelativePath="..\..\..\source\blender\windowmanager\intern\wm_init_exit.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\..\source\blender\windowmanager\intern\wm_jobs.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\windowmanager\intern\wm_keymap.c"\r
                                >\r
index 6a2b290e010a5f851664d5b15c5c838440927948..2f5512e715079581cfb81cdbdb6d656c94cf80dd 100644 (file)
@@ -10,7 +10,7 @@ Tip: 'Import an AC3D (.ac) file.'
 __author__ = "Willian P. Germano"
 __url__ = ("blender", "blenderartists.org", "AC3D's homepage, http://www.ac3d.org",
        "PLib 3d gaming lib, http://plib.sf.net")
-__version__ = "2.43.1 2007-02-21"
+__version__ = "2.48.1 2009-01-11"
 
 __bpydoc__ = """\
 This script imports AC3D models into Blender.
@@ -31,6 +31,7 @@ Known issues:<br>
 Config Options:<br>
     - display transp (toggle): if "on", objects that have materials with alpha < 1.0 are shown with translucency (transparency) in the 3D View.<br>
     - subdiv (toggle): if "on", ac3d objects meant to be subdivided receive a SUBSURF modifier in Blender.<br>
+    - emis as mircol: store the emissive rgb color from AC3D as mirror color in Blender -- this is a hack to preserve the values and be able to export them using the equivalent option in the exporter.<br>
     - textures dir (string): if non blank, when imported texture paths are
 wrong in the .ac file, Blender will also look for them at this dir.
 
@@ -50,11 +51,12 @@ users can configure (see config options above).
 # --------------------------------------------------------------------------
 # Thanks: Melchior Franz for extensive bug testing and reporting, making this
 # version cope much better with old or bad .ac files, among other improvements;
-# Stewart Andreason for reporting a serious crash.
+# Stewart Andreason for reporting a serious crash; Francesco Brisa for the
+# emis as mircol functionality (w/ patch).
 # --------------------------------------------------------------------------
 # ***** BEGIN GPL LICENSE BLOCK *****
 #
-# Copyright (C) 2004-2007: Willian P. Germano, wgermano _at_ ig.com.br
+# Copyright (C) 2004-2009: Willian P. Germano, wgermano _at_ ig.com.br
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -89,15 +91,19 @@ DISPLAY_TRANSP = True
 
 SUBDIV = True
 
+EMIS_AS_MIRCOL = False
+
+
 tooltips = {
        'DISPLAY_TRANSP': 'Turn transparency on in the 3d View for objects using materials with alpha < 1.0.',
        'SUBDIV': 'Apply a SUBSURF modifier to objects meant to appear subdivided.',
-       'TEXTURES_DIR': 'Additional folder to look for missing textures.'
+       'TEXTURES_DIR': 'Additional folder to look for missing textures.',
+       'EMIS_AS_MIRCOL': 'Store emis color as mirror color in Blender.'        
 }
 
 def update_registry():
-       global TEXTURES_DIR, DISPLAY_TRANSP
-       rd = dict([('tooltips', tooltips), ('TEXTURES_DIR', TEXTURES_DIR), ('DISPLAY_TRANSP', DISPLAY_TRANSP), ('SUBDIV', SUBDIV)])
+       global TEXTURES_DIR, DISPLAY_TRANSP, EMIS_AS_MIRCOL
+       rd = dict([('tooltips', tooltips), ('TEXTURES_DIR', TEXTURES_DIR), ('DISPLAY_TRANSP', DISPLAY_TRANSP), ('SUBDIV', SUBDIV), ('EMIS_AS_MIRCOL', EMIS_AS_MIRCOL)])
        Registry.SetKey('ac3d_import', rd, True)
 
 rd = Registry.GetKey('ac3d_import', True)
@@ -109,6 +115,7 @@ if rd:
                TEXTURES_DIR = rd['TEXTURES_DIR']
                DISPLAY_TRANSP = rd['DISPLAY_TRANSP']
                SUBDIV = rd['SUBDIV']
+               EMIS_AS_MIRCOL = rd['EMIS_AS_MIRCOL']
        except:
                update_registry()
 else: update_registry()
@@ -299,7 +306,7 @@ class AC3DImport:
                lines = self.lines
                line = lines[i].split()
                mat_name = ''
-               mat_col = mat_amb = mat_emit = mat_spec_col = [0,0,0]
+               mat_col = mat_amb = mat_emit = mat_spec_col = mat_mir_col = [0,0,0]
                mat_alpha = 1
                mat_spec = 1.0
 
@@ -310,11 +317,15 @@ class AC3DImport:
                        mat_amb = (v[0]+v[1]+v[2]) / 3.0
                        v = map(float,[line[11],line[12],line[13]])
                        mat_emit = (v[0]+v[1]+v[2]) / 3.0
+                       if EMIS_AS_MIRCOL:
+                               mat_emit = 0
+                               mat_mir_col = map(float,[line[11],line[12],line[13]])
+
                        mat_spec_col = map(float,[line[15],line[16],line[17]])
                        mat_spec = float(line[19]) / 64.0
                        mat_alpha = float(line[-1])
                        mat_alpha = 1 - mat_alpha
-                       self.mlist.append([mat_name, mat_col, mat_amb, mat_emit, mat_spec_col, mat_spec, mat_alpha])
+                       self.mlist.append([mat_name, mat_col, mat_amb, mat_emit, mat_spec_col, mat_spec, mat_mir_col, mat_alpha])
                        i += 1
                        line = lines[i].split()
 
@@ -590,7 +601,8 @@ class AC3DImport:
                        m.emit = mat[3]
                        m.specCol = (mat[4][0], mat[4][1], mat[4][2])
                        m.spec = mat[5]
-                       m.alpha = mat[6]
+                       m.mirCol = (mat[6][0], mat[6][1], mat[6][2])
+                       m.alpha = mat[7]
                        if m.alpha < 1.0:
                                m.mode |= MAT_MODE_ZTRANSP
                                has_transp_mats = True
index 58e9e2b1d02b62c8947134627233da14959ab2f8..1685582846028fa718b39dbf6f57ff2e9af069f0 100644 (file)
@@ -155,7 +155,7 @@ usrObjectNamePrefix= ""
 # if that armature had bones (spine, neck, arm) and the bone prefix was "a."
 #  the bones and IPO curves will be (a.spine, a.neck, a.arm)
 
-R2D = 18/3.1415  # radian to grad
+R2D = 18/3.141592653589793  # radian to grad
 BLENDER_VERSION = Blender.Get('version')
 
 # Gets the current scene, there can be many scenes in 1 blend file. 
index 415c2a12c6972374f7a5542859645054405549f4..6bbfaa463d0e835ef82815e1febf2bda22abbd54 100644 (file)
@@ -479,7 +479,7 @@ def pickMeshRayFaceWeight(me, orig, rdir):
        
        w0 = (l1+l2)
        w1 = (l0+l2)
-       w2 = (l1+l2)
+       w2 = (l1+l0)
        
        totw= w0 + w1 + w2
        w0=w0/totw
index 5c63e7f5bf5683563a92dd6d30af35530ca9869a..96caa50cc416af9d777c644f8c1f7bb7a0dc0349 100644 (file)
@@ -1,10 +1,10 @@
 #dxfLibrary.py : provides functions for generating DXF files
 # --------------------------------------------------------------------------
-__version__ = "v1.27beta - 2008.10.05"
-__author__  = "Stani Michiels(Stani), Remigiusz Fiedler(migius)"
+__version__ = "v1.28beta - 2008.12.13"
+__author__ = "Stani Michiels(Stani), Remigiusz Fiedler(migius)"
 __license__ = "GPL"
-__url__         = "http://wiki.blender.org/index.php/Scripts/Manual/Export/autodesk_dxf"
-__bpydoc__ ="""The script exports geometry data to DXF format r12 version.
+__url__ = "http://wiki.blender.org/index.php/Scripts/Manual/Export/autodesk_dxf"
+__bpydoc__ ="""The library to export geometry data to DXF format r12 version.
 
 Copyright %s
 Version %s
@@ -12,15 +12,17 @@ License %s
 Homepage %s
 
 See the homepage for documentation.
-url:
+Dedicated thread on BlenderArtists: http://blenderartists.org/forum/showthread.php?t=136439
 
 IDEAs:
 -
-               
+
 TODO:
--
+- add support for SPLINEs
 
 History
+v1.28 - 2008.12.13 by Steeve/BlenderArtists
+- bugfix for EXTMIN/EXTMAX to suit Cycas-CAD
 v1.27 - 2008.10.07 by migius
 - beautifying output code: keys whitespace prefix
 - refactoring DXF-strings format: NewLine moved to the end of
@@ -154,56 +156,56 @@ BYBLOCK=0
 BYLAYER=256
 
 #---block-type flags (bit coded values, may be combined):
-ANONYMOUS                         =1  # This is an anonymous block generated by hatching, associative dimensioning, other internal operations, or an application
+ANONYMOUS =1  # This is an anonymous block generated by hatching, associative dimensioning, other internal operations, or an application
 NON_CONSTANT_ATTRIBUTES =2  # This block has non-constant attribute definitions (this bit is not set if the block has any attribute definitions that are constant, or has no attribute definitions at all)
-XREF                                   =4  # This block is an external reference (xref)
-XREF_OVERLAY                   =8  # This block is an xref overlay
-EXTERNAL                               =16 # This block is externally dependent
-RESOLVED                               =32 # This is a resolved external reference, or dependent of an external reference (ignored on input)
-REFERENCED                       =64 # This definition is a referenced external reference (ignored on input)
+XREF =4  # This block is an external reference (xref)
+XREF_OVERLAY =8  # This block is an xref overlay
+EXTERNAL =16 # This block is externally dependent
+RESOLVED =32 # This is a resolved external reference, or dependent of an external reference (ignored on input)
+REFERENCED =64 # This definition is a referenced external reference (ignored on input)
 
 #---mtext flags
 #attachment point
-TOP_LEFT               = 1
-TOP_CENTER       = 2
-TOP_RIGHT         = 3
-MIDDLE_LEFT     = 4
-MIDDLE_CENTER   = 5
+TOP_LEFT = 1
+TOP_CENTER = 2
+TOP_RIGHT = 3
+MIDDLE_LEFT = 4
+MIDDLE_CENTER = 5
 MIDDLE_RIGHT   = 6
-BOTTOM_LEFT     = 7
-BOTTOM_CENTER   = 8
-BOTTOM_RIGHT   = 9
+BOTTOM_LEFT = 7
+BOTTOM_CENTER = 8
+BOTTOM_RIGHT = 9
 #drawing direction
-LEFT_RIGHT       = 1
-TOP_BOTTOM       = 3
-BY_STYLE               = 5 #the flow direction is inherited from the associated text style
+LEFT_RIGHT = 1
+TOP_BOTTOM = 3
+BY_STYLE = 5 #the flow direction is inherited from the associated text style
 #line spacing style (optional):
-AT_LEAST               = 1 #taller characters will override
-EXACT             = 2 #taller characters will not override
+AT_LEAST = 1 #taller characters will override
+EXACT = 2 #taller characters will not override
 
 #---polyline flags
-CLOSED                                   =1      # This is a closed polyline (or a polygon mesh closed in the M direction)
-CURVE_FIT                                 =2     # Curve-fit vertices have been added
-SPLINE_FIT                               =4      # Spline-fit vertices have been added
-POLYLINE_3D                             =8       # This is a 3D polyline
-POLYGON_MESH                           =16      # This is a 3D polygon mesh
-CLOSED_N                                       =32      # The polygon mesh is closed in the N direction
-POLYFACE_MESH                     =64   # The polyline is a polyface mesh
-CONTINOUS_LINETYPE_PATTERN  =128       # The linetype pattern is generated continuously around the vertices of this polyline
+CLOSED =1        # This is a closed polyline (or a polygon mesh closed in the M direction)
+CURVE_FIT =2     # Curve-fit vertices have been added
+SPLINE_FIT =4    # Spline-fit vertices have been added
+POLYLINE_3D =8   # This is a 3D polyline
+POLYGON_MESH =16        # This is a 3D polygon mesh
+CLOSED_N =32    # The polygon mesh is closed in the N direction
+POLYFACE_MESH =64       # The polyline is a polyface mesh
+CONTINOUS_LINETYPE_PATTERN =128        # The linetype pattern is generated continuously around the vertices of this polyline
 
 #---text flags
 #horizontal
-LEFT           = 0
-CENTER   = 1
-RIGHT     = 2
-ALIGNED         = 3 #if vertical alignment = 0
-MIDDLE   = 4 #if vertical alignment = 0
-FIT             = 5 #if vertical alignment = 0
+LEFT = 0
+CENTER = 1
+RIGHT = 2
+ALIGNED = 3 #if vertical alignment = 0
+MIDDLE = 4 #if vertical alignment = 0
+FIT = 5 #if vertical alignment = 0
 #vertical
-BASELINE       = 0
-BOTTOM   = 1
-MIDDLE   = 2
-TOP             = 3
+BASELINE = 0
+BOTTOM = 1
+MIDDLE = 2
+TOP = 3
 
 ####3) Classes
 #---entitities -----------------------------------------------
@@ -239,7 +241,7 @@ class Face(_Entity):
        """3dface"""
        def __init__(self,points,**common):
                _Entity.__init__(self,**common)
-               if len(points)<4: #fix for r12 format
+               while len(points)<4: #fix for r12 format
                        points.append(points[-1])
                self.points=points
                
@@ -336,10 +338,14 @@ class PolyLine(_Entity):
 
 #-----------------------------------------------
 class Point(_Entity):
-       """Colored solid fill."""
+       """Point."""
        def __init__(self,points=None,**common):
                _Entity.__init__(self,**common)
                self.points=points
+       def __str__(self): #TODO:
+               return '  0\nPOINT\n%s%s\n' %(self._common(),
+                        _points(self.points)
+                       )
 
 #-----------------------------------------------
 class Solid(_Entity):
@@ -468,7 +474,7 @@ class Block(_Collection):
                self.name=name
                self.flag=0
                self.base=base
-       def __str__(self):
+       def __str__(self): #TODO:
                e=''.join([str(x)for x in self.entities])
                return '  0\nBLOCK\n  8\n%s\n  2\n%s\n 70\n%s\n%s\n  3\n%s\n%s  0\nENDBLK\n'%\
                           (self.layer,self.name.upper(),self.flag,_point(self.base),self.name.upper(),e)
@@ -552,11 +558,12 @@ def ViewByWindow(name,leftBottom=(0,0),rightTop=(1,1),**options):
 #-----------------------------------------------
 class Drawing(_Collection):
        """Dxf drawing. Use append or any other list methods to add objects."""
-       def __init__(self,insbase=(0.0,0.0,0.0),extmin=(0.0,0.0),extmax=(0.0,0.0),
+       def __init__(self,insbase=(0.0,0.0,0.0),extmin=(0.0,0.0,0.0),extmax=(0.0,0.0,0.0),
                                 layers=[Layer()],linetypes=[LineType()],styles=[Style()],blocks=[],
                                 views=[],entities=None,fileName='test.dxf'):
                # TODO: replace list with None,arial
-               if not entities:entities=[]
+               if not entities:
+                       entities=[]
                _Collection.__init__(self,entities)
                self.insbase=insbase
                self.extmin=extmin
@@ -680,9 +687,9 @@ def test():
        #Drawing
        d=Drawing()
        #tables
-       d.blocks.append(b)                                        #table blocks
-       d.styles.append(Style())                                #table styles
-       d.views.append(View('Normal'))            #table view
+       d.blocks.append(b)  #table blocks
+       d.styles.append(Style())  #table styles
+       d.views.append(View('Normal'))  #table view
        d.views.append(ViewByWindow('Window',leftBottom=(1,0),rightTop=(2,1)))  #idem
 
        #entities
index ce17f78c5e2ee8ce7aaa1a3c6e8111cc3b3d95ec..6f96411896430d5495d3070c6cff1820da285cb8 100644 (file)
@@ -1446,13 +1446,13 @@ def write(filename, batch_objects = None, \
                                for f in me.faces:
                                        for col in f.col:
                                                if i==-1:
-                                                       file.write('%i,%i,%i' % (col[0], col[1], col[2]))
+                                                       file.write('%i,%i,%i,255' % (col[0], col[1], col[2]))
                                                        i=0
                                                else:
                                                        if i==7:
                                                                file.write('\n\t\t\t\t')
                                                                i=0
-                                                       file.write(',%i,%i,%i' % (col[0], col[1], col[2]))
+                                                       file.write(',%i,%i,%i,255' % (col[0], col[1], col[2]))
                                                i+=1
                                                ii+=1 # One more Color
                                
index 484663b32b314db9234efc54fd8ce81383cbd355..9c3a24af2882c6aa5dd6167fa35c046cd2f16b46 100644 (file)
@@ -1,17 +1,17 @@
 #!BPY
 """
 Name: 'Blender/Python Scripting API'
-Blender: 244
+Blender: 248
 Group: 'Help'
 Tooltip: 'The Blender Python API reference manual'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartist")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
 This script opens the user's default web browser at http://www.blender.org's
-"Blenders Python API" page.
+"Blender Python API Reference" page.
 """
 
 # --------------------------------------------------------------------------
@@ -38,4 +38,4 @@ This script opens the user's default web browser at http://www.blender.org's
 
 import Blender, webbrowser
 version = str(int(Blender.Get('version')))
-webbrowser.open('http://www.blender.org/documentation/'+ version +'PythonDoc/index.html')
+webbrowser.open('http://www.blender.org/documentation/'+ version +'PythonDoc/')
index b27e266f368aa5c9ccd0d7e5614360fc83d2f179..c207a12068fb6e25f4dcc999db9785320151c712 100644 (file)
@@ -8,7 +8,7 @@ Tooltip: 'Show help information about a chosen installed script.'
 """
 
 __author__ = "Willian P. Germano"
-__version__ = "0.1 11/02/04"
+__version__ = "0.3 01/21/09"
 __email__ = ('scripts', 'Author, wgermano:ig*com*br')
 __url__ = ('blender', 'blenderartists.org')
 
@@ -47,8 +47,6 @@ Hotkeys:<br>
 # $Id$
 #
 # --------------------------------------------------------------------------
-# sysinfo.py version 0.1 Jun 09, 2004
-# --------------------------------------------------------------------------
 # ***** BEGIN GPL LICENSE BLOCK *****
 #
 # Copyright (C) 2004: Willian P. Germano, wgermano _at_ ig.com.br
@@ -69,6 +67,9 @@ Hotkeys:<br>
 #
 # ***** END GPL LICENCE BLOCK *****
 # --------------------------------------------------------------------------
+# Thanks: Brendon Murphy (suggestion) and Kevin Morgan (implementation)
+# for the "run" button; Jean-Michel Soler for pointing a parsing error
+# with multilines using triple single quotes.
 
 import Blender
 from Blender import sys as bsys, Draw, Window, Registry
@@ -355,7 +356,12 @@ def parse_pyobj(var, lines, i):
                        l = "ERROR"
 
        elif l[0] == "'":
-               if l[-1] == '\\':
+               if l[1:3] == "''": # '''
+                       if l.find("'''", 3) < 0: # multiline
+                               l2, i = parse_pyobj_close("'''", lines, i)
+                               if l[-1] == '\\': l = l[:-1]
+                               l = "%s%s" % (l, l2)
+               elif l[-1] == '\\':
                        l2, i = parse_pyobj_close("'", lines, i)
                        l = "%s%s" % (l, l2)
                elif l[-1] == "'" and l[-2] !=  '\\': # single line: '...'
@@ -543,6 +549,7 @@ BEVT_GMENU = range(100, len_gmenus + 100)
 BEVT_VIEWSOURCE = 1
 BEVT_EXIT = 2
 BEVT_BACK = 3
+BEVT_EXEC = 4  # Executes Script
 
 # gui callbacks:
 
@@ -551,7 +558,7 @@ def gui(): # drawing the screen
        global SCREEN, START_SCREEN, SCRIPT_SCREEN
        global SCRIPT_INFO, AllGroups, GROUP_MENUS
        global BEVT_EMAIL, BEVT_LINK
-       global BEVT_VIEWSOURCE, BEVT_EXIT, BEVT_BACK, BEVT_GMENU, BUT_GMENU
+       global BEVT_VIEWSOURCE, BEVT_EXIT, BEVT_BACK, BEVT_GMENU, BUT_GMENU, BEVT_EXEC
        global PADDING, WIN_W, WIN_H, SCROLL_DOWN, COLUMNS, FMODE
 
        theme = Theme.Get()[0]
@@ -674,8 +681,11 @@ def gui(): # drawing the screen
                                'View this script\'s source code in the Text Editor (hotkey: S)')
                        Draw.PushButton('exit', BEVT_EXIT, x + 45, 17, 45, bh,
                                'Exit from Scripts Help Browser (hotkey: Q)')
-                       if not FMODE: Draw.PushButton('back', BEVT_BACK, x + 2*45, 17, 45, bh,
+                       if not FMODE: 
+                               Draw.PushButton('back', BEVT_BACK, x + 2*45, 17, 45, bh,
                                'Back to scripts selection screen (hotkey: ESC)')
+                               Draw.PushButton('run script', BEVT_EXEC, x + 3*45, 17, 60, bh, 'Run this script')
+
                        BGL.glColor3ub(COL_TXTHI[0],COL_TXTHI[1], COL_TXTHI[2])
                        BGL.glRasterPos2i(x, 5)
                        Draw.Text('use the arrow keys or the mouse wheel to scroll text', 'small')
@@ -766,6 +776,14 @@ def button_event(evt): # gui button events
                        SCRIPT_INFO = None
                        SCROLL_DOWN = 0
                        Draw.Redraw()
+       elif evt == BEVT_EXEC: # Execute script
+               exec_line = ''
+               if SCRIPT_INFO.script.userdir:
+                       exec_line = bsys.join(Blender.Get('uscriptsdir'), SCRIPT_INFO.script.fname)
+               else:
+                       exec_line = bsys.join(Blender.Get('scriptsdir'), SCRIPT_INFO.script.fname)
+
+               Blender.Run(exec_line)
 
 keepon = True
 FMODE = False # called by Blender.ShowHelp(name) API function ?
index 81b002da4e49fc5b6b045067fca8dd10adae2c08..a4f6da5cc55c8cd23f204945976d445f2fd5d67b 100644 (file)
@@ -1,16 +1,16 @@
 #!BPY
 """
 Name: 'Getting Started'
-Blender: 234
+Blender: 248
 Group: 'Help'
 Tooltip: 'Help for new users'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
-This script opens the user's default web browser at www.blender3d.org's
+This script opens the user's default web browser at www.blender.org's
 "Getting Started" page.
 """
 
@@ -39,5 +39,4 @@ This script opens the user's default web browser at www.blender3d.org's
 # --------------------------------------------------------------------------
 
 import Blender, webbrowser
-version = str(Blender.Get('version'))
-webbrowser.open('http://www.blender3d.org/Help/?pg=GettingStarted&ver=' + version)
+webbrowser.open('http://www.blender.org/education-help/tutorials/getting-started/')
index cf293bf7c2cac10b73bf2be6144cbf765f33977a..b830975e593906ce00d772aad530005ff00059ce 100644 (file)
@@ -1,17 +1,17 @@
 #!BPY
 """
 Name: 'Manual'
-Blender: 234
+Blender: 248
 Group: 'Help'
-Tooltip: 'The Blender reference manual'
+Tooltip: 'The Blender Wiki manual'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
-This script opens the user's default web browser at www.blender3d.org's
-"Blender Manual" page.
+This script opens the user's default web browser at www.blender.org's
+"Manual" page.
 """
 
 # --------------------------------------------------------------------------
@@ -37,5 +37,4 @@ This script opens the user's default web browser at www.blender3d.org's
 # --------------------------------------------------------------------------
 
 import Blender, webbrowser
-version = str(Blender.Get('version'))
-webbrowser.open('http://www.blender3d.org/Help/?pg=Manual&ver=' + version)
+webbrowser.open('http://wiki.blender.org/index.php/Manual')
index af7a70424895de59afab25b9e4076df432a02809..919ec72da3cad16e337e3a18ff9c57dcc5a1e9ed 100644 (file)
@@ -1,17 +1,17 @@
 #!BPY
 """
-Name: 'Release Notes'
-Blender: 234
+Name: 'Release Logs'
+Blender: 248
 Group: 'Help'
 Tooltip: 'Information about the changes in this version of Blender'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
-This script opens the user's default web browser at www.blender3d.org's
-"Release Notes" page.
+This script opens the user's default web browser at www.blender.org's
+"Release Logs" page.
 """
 
 # --------------------------------------------------------------------------
@@ -37,5 +37,5 @@ This script opens the user's default web browser at www.blender3d.org's
 # --------------------------------------------------------------------------
 
 import Blender, webbrowser
-version = str(Blender.Get('version'))
-webbrowser.open('http://www.blender3d.org/Help/?pg=ReleaseNotes&ver=' + version)
+
+webbrowser.open('http://www.blender.org/development/release-logs/')
index 04d6c79945562c21f505314d502eab111a765448..1fe466560f0bb0032eadf499500cd16e4c67e9fd 100644 (file)
@@ -2,17 +2,17 @@
 
 """
 Name: 'Tutorials'
-Blender: 234
+Blender: 248
 Group: 'Help'
 Tooltip: 'Tutorials for learning to use Blender'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
-This script opens the user's default web browser at www.blender3d.org's
-"Blender Tutorials" page.
+This script opens the user's default web browser at www.blender.org's
+"Tutorials" page.
 """
 
 # --------------------------------------------------------------------------
@@ -38,5 +38,4 @@ This script opens the user's default web browser at www.blender3d.org's
 # --------------------------------------------------------------------------
 
 import Blender, webbrowser
-version = str(Blender.Get('version'))
-webbrowser.open('http://www.blender3d.org/Help/?pg=Tutorials&ver=' + version)
+webbrowser.open('http://www.blender.org/education-help/tutorials/')
index 0f9e32dea0eda27cbd3de3e4498b8ceadc679195..db0a78d90f758ff07f1ae6c2986ab2cb248c0118 100644 (file)
@@ -2,17 +2,17 @@
 
 """
 Name: 'Blender Website'
-Blender: 234
+Blender: 248
 Group: 'HelpWebsites'
 Tooltip: 'The official Blender website'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
 This script opens the user's default web browser at Blender's main site,
-www.blender3d.org.
+www.blender.org.
 """
 
 
@@ -39,4 +39,4 @@ www.blender3d.org.
 # --------------------------------------------------------------------------
 
 import Blender, webbrowser
-webbrowser.open('http://www.blender3d.org/')
+webbrowser.open('http://www.blender.org/')
index 344622cc11375bfb50bd45ebe2a74e1fbcca38e9..e04a54501f7bf68ef1db5a3f316172e7b778574e 100644 (file)
@@ -2,17 +2,17 @@
 
 """
 Name: 'Developer Community'
-Blender: 234
+Blender: 248
 Group: 'HelpWebsites'
 Tooltip: 'Get involved with Blender development'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
-This script opens the user's default web browser at www.blender.org, the
-Blender development portal.
+This script opens the user's default web browser at www.blender.org's
+"Get Involved" page.
 """
 
 # --------------------------------------------------------------------------
@@ -38,4 +38,4 @@ Blender development portal.
 # --------------------------------------------------------------------------
 
 import webbrowser
-webbrowser.open('http://www.blender.org')
+webbrowser.open('http://www.blender.org/community/get-involved/')
index 451fd7351508f7daf7f4c39401ad1c9d919a4f6b..c33849ac41912631482416e5a6224ffea61ec4a1 100644 (file)
@@ -2,16 +2,16 @@
 
 """
 Name: 'Blender E-Shop'
-Blender: 234
+Blender: 248
 Group: 'HelpWebsites'
 Tooltip: 'Buy official Blender resources and merchandise online'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
-This script opens the user's default web browser at www.blender3d.org's
+This script opens the user's default web browser at www.blender.org's
 "E-Shop" section.
 """
 
index fbe19956eb770a2dda22f37aa2f946f9b395cf9f..a77a2bb9fefcadbd15dbda1f98ba3ed550e78285 100644 (file)
@@ -2,16 +2,16 @@
 
 """
 Name: 'User Community'
-Blender: 234
+Blender: 248
 Group: 'HelpWebsites'
 Tooltip: 'Get involved with other Blender users'
 """
 
 __author__ = "Matt Ebb"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.0"
+__version__ = "1.0.1"
 __bpydoc__ = """\
-This script opens the user's default web browser at www.blender3d.org's
+This script opens the user's default web browser at www.blender.org's
 "User Community" page.
 """
 
@@ -38,4 +38,4 @@ This script opens the user's default web browser at www.blender3d.org's
 # --------------------------------------------------------------------------
 
 import webbrowser
-webbrowser.open('http://www.blender3d.org/Community')
+webbrowser.open('http://www.blender.org/community/user-community/')
index 06cde898ef2944cf16da78ba649dea69b2e93cf8..28bc1a40ef080c67a9fd9ae38f698d9b87c864d2 100755 (executable)
@@ -36,6 +36,8 @@ __bpydoc__ = """\
 This script is an importer for the X3D and VRML97 file formats.
 """
 
+DEBUG = False
+
 # This should work without a blender at all
 try:
        from Blender.sys import exists
@@ -50,11 +52,11 @@ def dirName(path):
 
 def imageConvertCompat(path):
        
-       try:    import os
-       except:
-               return path
+       try:             import os
+       except:          return path
+       if os.sep=='\\': return path # assime win32 has quicktime, dont convert
        
-       if path.endswith('.gif'):
+       if path.lower().endswith('.gif'):
                path_to = path[:-3] + 'png'
                
                '''
@@ -145,13 +147,12 @@ def vrmlFormat(data):
                                        data = data[:start] + data[end:]
                                        ok = True # keep looking
                                        
-                                       last_i = end - len(item) + 1
+                                       last_i = (end - len(item)) + 1
                                        # print last_i, item, '|' + data[last_i] + '|'
                
        # done with messy extracting strings part
        
        
-       
        # Bad, dont take strings into account
        '''
        data = data.replace('#', '\n#')
@@ -173,13 +174,14 @@ def vrmlFormat(data):
                while ok:
                        ok = False
                        i = data.find(search + '"', last_i)
-                       
+                       # print i
                        if i != -1:
                                start = i + len(search) # first char after end of search
                                item = string_ls.pop(0)
+                               # print item
                                data = data[:start] + item + data[start:]
                                
-                               last_i = start + len(item)
+                               last_i = start + len(item) + 1
                                
                                ok = True
        
@@ -201,6 +203,7 @@ def vrmlFormat(data):
 NODE_NORMAL = 1 # {}
 NODE_ARRAY = 2 # []
 NODE_REFERENCE = 3 # USE foobar
+# NODE_PROTO = 4 #
 
 lines = []
 
@@ -211,6 +214,10 @@ def getNodePreText(i, words):
                
                if i>=len(lines):
                        break
+                       '''
+               elif lines[i].startswith('PROTO'):
+                       return NODE_PROTO, i+1
+                       '''
                elif lines[i]=='{':
                        # words.append(lines[i]) # no need
                        # print "OK"
@@ -244,6 +251,23 @@ def is_nodeline(i, words):
        if not lines[i][0].isalpha():
                return 0, 0
        
+       #if lines[i].startswith('field'):
+       #       return 0, 0
+       
+       # Is this a prototype??
+       if lines[i].startswith('PROTO'):
+               words[:] = lines[i].split()
+               return NODE_NORMAL, i+1 # TODO - assumes the next line is a '[\n', skip that
+       if lines[i].startswith('EXTERNPROTO'):
+               words[:] = lines[i].split()
+               return NODE_ARRAY, i+1 # TODO - assumes the next line is a '[\n', skip that
+       
+       '''
+       proto_type, new_i = is_protoline(i, words, proto_field_defs)
+       if new_i != -1:
+               return proto_type, new_i
+       '''
+       
        # Simple "var [" type
        if lines[i+1] == '[':
                if lines[i].count('"') % 2 == 0:
@@ -253,6 +277,7 @@ def is_nodeline(i, words):
        node_type, new_i = getNodePreText(i, words)
        
        if not node_type:
+               if DEBUG: print "not node_type", lines[i]
                return 0, 0
        
        # Ok, we have a { after some values
@@ -311,10 +336,10 @@ def is_numline(i):
                return True
        except:
                return False
-       
+
 
 class vrmlNode(object):
-       __slots__ = 'id', 'fields', 'node_type', 'parent', 'children', 'parent', 'array_data', 'reference', 'lineno', 'filename', 'blendObject', 'DEF_NAMESPACE', 'ROUTE_IPO_NAMESPACE', 'FIELD_NAMESPACE', 'x3dNode'
+       __slots__ = 'id', 'fields', 'proto_node', 'proto_field_defs', 'proto_fields', 'node_type', 'parent', 'children', 'parent', 'array_data', 'reference', 'lineno', 'filename', 'blendObject', 'DEF_NAMESPACE', 'ROUTE_IPO_NAMESPACE', 'PROTO_NAMESPACE', 'x3dNode'
        def __init__(self, parent, node_type, lineno):
                self.id = None
                self.node_type = node_type
@@ -329,11 +354,17 @@ class vrmlNode(object):
                # This is only set from the root nodes.
                # Having a filename also denotes a root node
                self.filename = None
+               self.proto_node = None # proto field definition eg: "field SFColor seatColor .6 .6 .1"
                
                # Store in the root node because each inline file needs its own root node and its own namespace
                self.DEF_NAMESPACE = None 
                self.ROUTE_IPO_NAMESPACE = None 
+               '''
                self.FIELD_NAMESPACE = None
+               '''
+               
+               
+               self.PROTO_NAMESPACE = None
                
                self.reference = None
                
@@ -343,16 +374,26 @@ class vrmlNode(object):
                        return 
                
                self.fields = [] # fields have no order, in some cases rool level values are not unique so dont use a dict
+               
+               self.proto_field_defs = [] # proto field definition eg: "field SFColor seatColor .6 .6 .1"
+               self.proto_fields = [] # proto field usage "diffuseColor IS seatColor"
                self.children = []
                self.array_data = [] # use for arrays of data - should only be for NODE_ARRAY types
                
        
        # Only available from the root node
+       '''
        def getFieldDict(self):
                if self.FIELD_NAMESPACE != None:
                        return self.FIELD_NAMESPACE
                else:
                        return self.parent.getFieldDict()
+       '''
+       def getProtoDict(self):
+               if self.PROTO_NAMESPACE != None:
+                       return self.PROTO_NAMESPACE
+               else:
+                       return self.parent.getProtoDict()
        
        def getDefDict(self):
                if self.DEF_NAMESPACE != None:
@@ -368,9 +409,10 @@ class vrmlNode(object):
        
        def setRoot(self, filename):
                self.filename = filename
-               self.FIELD_NAMESPACE =          {}
+               # self.FIELD_NAMESPACE =                {}
                self.DEF_NAMESPACE =            {}
                self.ROUTE_IPO_NAMESPACE =      {}
+               self.PROTO_NAMESPACE =          {}
        
        def isRoot(self):
                if self.filename == None:
@@ -399,20 +441,36 @@ class vrmlNode(object):
                except:
                        return None
        
+       def findSpecRecursive(self, spec):
+               self_real = self.getRealNode()
+               if spec == self_real.getSpec():
+                       return self
+               
+               for child in self_real.children:
+                       if child.findSpecRecursive(spec):
+                               return child
+               
+               return None
+       
        def getPrefix(self):
                if self.id:
                        return self.id[0]
                return None
        
-       def getDefName(self):
+       def getSpecialTypeName(self, typename):
                self_real = self.getRealNode()
+               try:            return self_real.id[ list(self_real.id).index(typename)+1 ]
+               except: return None
+       
+       
+       def getDefName(self):
+               return self.getSpecialTypeName('DEF')
+       
+       def getProtoName(self):
+               return self.getSpecialTypeName('PROTO')
                
-               if 'DEF' in self_real.id:
-                       # print self_real.id
-                       return self_real.id[ list(self_real.id).index('DEF')+1 ]
-               else:
-                       return None
-               
+       def getExternprotoName(self):
+               return self.getSpecialTypeName('EXTERNPROTO')
        
        def getChildrenBySpec(self, node_spec): # spec could be Transform, Shape, Appearance
                self_real = self.getRealNode()
@@ -449,7 +507,26 @@ class vrmlNode(object):
                ancestry.append(self)
                for child in self.getRealNode().children:
                        if child not in ancestry:
-                               child.getSerialized(results, ancestry)
+                               # We dont want to load proto's, they are only references
+                               # We could enforce this elsewhere
+                               
+                               # Only add this in a very special case
+                               # where the parent of this object is not the real parent
+                               # - In this case we have added the proto as a child to a node instancing it.
+                               # This is a bit arbitary, but its how Proto's are done with this importer.
+                               if child.getProtoName() == None and child.getExternprotoName() == None:
+                                       child.getSerialized(results, ancestry)
+                               else:
+                                       
+                                       if DEBUG: print 'getSerialized() is proto:', child.getProtoName(), child.getExternprotoName(), self.getSpec()
+                                       
+                                       self_spec = self.getSpec()
+                                       
+                                       if child.getProtoName() == self_spec or child.getExternprotoName() == self_spec:
+                                               if DEBUG: "FoundProto!"
+                                               child.getSerialized(results, ancestry)
+                                       
+                                       
                
                return results
                
@@ -462,7 +539,7 @@ class vrmlNode(object):
                        child.searchNodeTypeID(node_spec, results)
                return results
        
-       def getFieldName(self, field):
+       def getFieldName(self, field, ancestry, AS_CHILD=False):
                self_real = self.getRealNode() # incase we're an instance
                
                for f in self_real.fields:
@@ -470,14 +547,81 @@ class vrmlNode(object):
                        if f and f[0] == field:
                                # print '\tfound field', f
                                
-                               return f[1:]
+                               if len(f)>=3 and f[1] == 'IS': # eg: 'diffuseColor IS legColor'
+                                       field_id = f[2]
+                                       
+                                       # print "\n\n\n\n\n\nFOND IS!!!"
+                                       f_proto_lookup = None
+                                       f_proto_child_lookup = None
+                                       i = len(ancestry)
+                                       while i:
+                                               i -= 1
+                                               node = ancestry[i]
+                                               node = node.getRealNode()
+                                               
+                                               # proto settings are stored in "self.proto_node"
+                                               if node.proto_node: 
+                                                       # Get the default value from the proto, this can be overwridden by the proto instace
+                                                       # 'field SFColor legColor .8 .4 .7'
+                                                       if AS_CHILD:
+                                                               for child in node.proto_node.children:
+                                                                       #if child.id  and  len(child.id) >= 3  and child.id[2]==field_id:
+                                                                       if child.id and ('point' in child.id or 'points' in child.id):
+                                                                               f_proto_child_lookup = child
+                                                       
+                                                       else:
+                                                               for f_def in node.proto_node.proto_field_defs:
+                                                                       if len(f_def) >= 4:
+                                                                               if f_def[0]=='field' and f_def[2]==field_id:
+                                                                                       f_proto_lookup = f_def[3:]
+                                               
+                                               # Node instance, Will be 1 up from the proto-node in the ancestry list. but NOT its parent.
+                                               # This is the setting as defined by the instance, including this setting is optional,
+                                               # and will override the default PROTO value 
+                                               # eg: 'legColor 1 0 0'
+                                               if AS_CHILD:
+                                                       for child in node.children:
+                                                               if child.id and child.id[0]==field_id:
+                                                                       f_proto_child_lookup = child
+                                               else:
+                                                       for f_def in node.fields:
+                                                               if len(f_def) >= 2:
+                                                                       if f_def[0]==field_id:
+                                                                               if DEBUG: print "getFieldName(), found proto", f_def
+                                                                               f_proto_lookup = f_def[1:]
+                                               
+                                       
+                                       if AS_CHILD:
+                                               if f_proto_child_lookup:
+                                                       if DEBUG:
+                                                               print "getFieldName() - AS_CHILD=True, child found"
+                                                               print f_proto_child_lookup
+                                               return f_proto_child_lookup
+                                       else:
+                                               return f_proto_lookup
+                               else:
+                                       if AS_CHILD:
+                                               return None
+                                       else:
+                                               # Not using a proto
+                                               return f[1:]
+                                               
                # print '\tfield not found', field
+               
+               
+               # See if this is a proto name
+               if AS_CHILD:
+                       child_array = None
+                       for child in self_real.children:
+                               if child.id and len(child.id) == 1 and child.id[0] == field:
+                                       return child
+               
                return None
        
-       def getFieldAsInt(self, field, default):
+       def getFieldAsInt(self, field, default, ancestry):
                self_real = self.getRealNode() # incase we're an instance
                
-               f = self_real.getFieldName(field)
+               f = self_real.getFieldName(field, ancestry)
                if f==None:     return default
                if ',' in f: f = f[:f.index(',')] # strip after the comma
                
@@ -491,10 +635,10 @@ class vrmlNode(object):
                        print '\tvalue "%s" could not be used as an int for field "%s"' % (f[0], field)
                        return default
        
-       def getFieldAsFloat(self, field, default):
+       def getFieldAsFloat(self, field, default, ancestry):
                self_real = self.getRealNode() # incase we're an instance
                
-               f = self_real.getFieldName(field)
+               f = self_real.getFieldName(field, ancestry)
                if f==None:     return default
                if ',' in f: f = f[:f.index(',')] # strip after the comma
                
@@ -508,10 +652,10 @@ class vrmlNode(object):
                        print '\tvalue "%s" could not be used as a float for field "%s"' % (f[0], field)
                        return default
        
-       def getFieldAsFloatTuple(self, field, default):
+       def getFieldAsFloatTuple(self, field, default, ancestry):
                self_real = self.getRealNode() # incase we're an instance
                
-               f = self_real.getFieldName(field)
+               f = self_real.getFieldName(field, ancestry)
                if f==None:     return default
                # if ',' in f: f = f[:f.index(',')] # strip after the comma
                
@@ -532,10 +676,10 @@ class vrmlNode(object):
                        print '\tvalue "%s" could not be used as a float tuple for field "%s"' % (f, field)
                        return default
        
-       def getFieldAsBool(self, field, default):
+       def getFieldAsBool(self, field, default, ancestry):
                self_real = self.getRealNode() # incase we're an instance
                
-               f = self_real.getFieldName(field)
+               f = self_real.getFieldName(field, ancestry)
                if f==None:     return default
                if ',' in f: f = f[:f.index(',')] # strip after the comma
                
@@ -551,10 +695,10 @@ class vrmlNode(object):
                        print '\t"%s" could not be used as a bool for field "%s"' % (f[1], field)
                        return default
        
-       def getFieldAsString(self, field, default=None):
+       def getFieldAsString(self, field, default, ancestry):
                self_real = self.getRealNode() # incase we're an instance
                
-               f = self_real.getFieldName(field)
+               f = self_real.getFieldName(field, ancestry)
                if f==None:     return default
                if len(f) < 1:
                        print '\t"%s" wrong length for string conversion for field "%s"' % (f, field)
@@ -576,24 +720,22 @@ class vrmlNode(object):
                        print '\tvalue "%s" could not be used as a string for field "%s"' % (f[0], field)
                        return default
        
-       def getFieldAsArray(self, field, group):
+       def getFieldAsArray(self, field, group, ancestry):
                '''
                For this parser arrays are children
                '''
                self_real = self.getRealNode() # incase we're an instance
                
-               child_array = None
-               for child in self_real.children:
-                       # print "ID IS", child.id
-                       if child.id and len(child.id) == 1 and child.id[0] == field:
-                               child_array = child
-                               break
+               child_array = self_real.getFieldName(field, ancestry, True)
                
+               #if type(child_array)==list: # happens occasionaly
+               #       array_data = child_array 
+                       
                if child_array==None:
                        
                        # For x3d, should work ok with vrml too
                        # for x3d arrays are fields, vrml they are nodes, annoying but not tooo bad.
-                       data_split = self.getFieldName(field)
+                       data_split = self.getFieldName(field, ancestry)
                        if not data_split:
                                return []
                        array_data = ' '.join(data_split)
@@ -660,7 +802,7 @@ class vrmlNode(object):
                
                return new_array
        
-       def getFieldAsStringArray(self, field):
+       def getFieldAsStringArray(self, field, ancestry):
                '''
                Get a list of strings
                '''
@@ -698,7 +840,6 @@ class vrmlNode(object):
        def __repr__(self):
                level = self.getLevel()
                ind = '  ' * level
-               
                if self.node_type==NODE_REFERENCE:
                        brackets = ''
                elif self.node_type==NODE_NORMAL:
@@ -717,14 +858,25 @@ class vrmlNode(object):
                        text += ind + "(reference node)\n"
                        return text
                
-               text += ind + 'FIELDS:\n'
+               if self.proto_node:
+                       text += ind + 'PROTO NODE...\n'
+                       text += str(self.proto_node)
+                       text += ind + 'PROTO NODE_DONE\n'
+               
+               text += ind + 'FIELDS:' + str(len(self.fields)) + '\n'
                
                for i,item in enumerate(self.fields):
                        text += ind + 'FIELD:\n'
                        text += ind + str(item) +'\n'
+
+               text += ind + 'PROTO_FIELD_DEFS:' + str(len(self.proto_field_defs)) + '\n'
                
-               #text += ind + 'ARRAY: ' + str(len(self.array_data)) + ' ' + str(self.array_data) + '\n'
-               text += ind + 'ARRAY: ' + str(len(self.array_data)) + '[...] \n'
+               for i,item in enumerate(self.proto_field_defs):
+                       text += ind + 'PROTO_FIELD:\n'
+                       text += ind + str(item) +'\n'
+
+               text += ind + 'ARRAY: ' + str(len(self.array_data)) + ' ' + str(self.array_data) + '\n'
+               #text += ind + 'ARRAY: ' + str(len(self.array_data)) + '[...] \n'
                
                text += ind + 'CHILDREN: ' + str(len(self.children)) + '\n'
                for i, child in enumerate(self.children):
@@ -735,21 +887,57 @@ class vrmlNode(object):
                
                return text
        
-       def parse(self, i):
-               new_i = self.__parse(i)
+       def parse(self, i, IS_PROTO_DATA=False):
+               new_i = self.__parse(i, IS_PROTO_DATA)
                
                # print self.id, self.getFilename()
                
-               # If we were an inline then try load the file
+               # Check if this node was an inline or externproto
+               
+               url_ls = []
+               
                if self.node_type == NODE_NORMAL and self.getSpec() == 'Inline':
+                       ancestry = [] # Warning! - PROTO's using this wont work at all.
+                       url = self.getFieldAsString('url', None, ancestry)
+                       if url:
+                               url_ls = [(url, None)]
+                       del ancestry
+               
+               elif self.getExternprotoName():
+                       # externproto
+                       url_ls = []
+                       for f in self.fields:
+                               
+                               if type(f)==str:
+                                       f = [f]
+                               
+                               for ff in f:
+                                       for f_split in ff.split('"'):
+                                               # print f_split
+                                               # "someextern.vrml#SomeID"
+                                               if '#' in f_split:
+                                                       
+                                                       f_split, f_split_id = f_split.split('#') # there should only be 1 # anyway
+                                                       
+                                                       url_ls.append( (f_split, f_split_id) )
+                                               else:
+                                                       url_ls.append( (f_split, None) )
+               
+               
+               # Was either an Inline or an EXTERNPROTO
+               if url_ls:
                        
-                       url = self.getFieldAsString('url', None)
+                       # print url_ls
                        
-                       if url != None:
+                       for url, extern_key in url_ls:
+                               print url
                                urls = []
                                urls.append( url )
                                urls.append( BPySys.caseInsensitivePath(urls[-1]) )
                                
+                               urls.append( dirName(self.getFilename()) + url )
+                               urls.append( BPySys.caseInsensitivePath(urls[-1]) )
+                               
                                urls.append( dirName(self.getFilename()) + baseName(url) )
                                urls.append( BPySys.caseInsensitivePath(urls[-1]) )
                                
@@ -786,7 +974,7 @@ class vrmlNode(object):
                                                        lines.insert(0, 'root_node____')
                                                        lines.append('}')
                                                        '''
-                                                       ff = open('/test.txt', 'w')
+                                                       ff = open('/tmp/test.txt', 'w')
                                                        ff.writelines([l+'\n' for l in lines])
                                                        '''
                                                        
@@ -794,15 +982,36 @@ class vrmlNode(object):
                                                        child.setRoot(url) # initialized dicts
                                                        child.parse(0)
                                                        
+                                                       # if self.getExternprotoName():
+                                                       if self.getExternprotoName():
+                                                               if not extern_key: # if none is spesified - use the name
+                                                                       extern_key = self.getSpec()
+                                                               
+                                                               if extern_key:
+                                                                       
+                                                                       self.children.remove(child)
+                                                                       child.parent = None
+                                                                       
+                                                                       extern_child = child.findSpecRecursive(extern_key)
+                                                                       
+                                                                       if extern_child:
+                                                                               self.children.append(extern_child)
+                                                                               extern_child.parent = self
+                                                                               
+                                                                               if DEBUG: print "\tEXTERNPROTO ID found!:", extern_key
+                                                                       else:
+                                                                               print "\tEXTERNPROTO ID not found!:", extern_key
+                                                                       
                                                        # Watch it! - restore lines
                                                        lines[:] = lines_old
-                                       
                
                return new_i
        
-       def __parse(self, i):
-               # print 'parsing at', i,
-               # print i, self.id, self.lineno
+       def __parse(self, i, IS_PROTO_DATA=False):
+               '''
+               print 'parsing at', i,
+               print i, self.id, self.lineno
+               '''
                l = lines[i]
                
                if l=='[':
@@ -811,9 +1020,11 @@ class vrmlNode(object):
                        i+=1
                else:
                        words = []
+                       
                        node_type, new_i = is_nodeline(i, words)
                        if not node_type: # fail for parsing new node.
-                               raise "error"
+                               print "Failed to parse new node"
+                               raise ValueError
                        
                        if self.node_type==NODE_REFERENCE:
                                # Only assign the reference and quit
@@ -827,40 +1038,72 @@ class vrmlNode(object):
                        
                        # fill in DEF/USE
                        key = self.getDefName()
-                       
                        if key != None:
                                self.getDefDict()[ key ] = self
                        
+                       key = self.getProtoName()
+                       if not key:     key = self.getExternprotoName()
+                       
+                       proto_dict = self.getProtoDict()
+                       if key != None:
+                               proto_dict[ key ] = self
+                               
+                               # Parse the proto nodes fields
+                               self.proto_node = vrmlNode(self, NODE_ARRAY, new_i)
+                               new_i = self.proto_node.parse(new_i)
+                               
+                               self.children.remove(self.proto_node)
+                               
+                               # print self.proto_node
+                               
+                               new_i += 1 # skip past the {
+                               
+                       
+                       else: # If we're a proto instance, add the proto node as our child.
+                               spec = self.getSpec()
+                               try:
+                                       self.children.append( proto_dict[spec] )
+                                       #pass
+                               except:
+                                       pass
+                               
+                               del spec
+                       
+                       del proto_dict, key
+                       
                        i = new_i
                
                # print self.id
                ok = True
                while ok:
+                       if i>=len(lines):
+                               return len(lines)-1
+                       
                        l = lines[i]
-                       # print '\t', i, l
+                       # print '\tDEBUG:', i, self.node_type, l
                        if l=='':
                                i+=1
                                continue 
                        
                        if l=='}':
-                               if self.node_type != NODE_NORMAL:
-                                       print 'wrong node ending, expected an } ' + str(i)
-                                       raise ""
+                               if self.node_type != NODE_NORMAL: # also ends proto nodes, we may want a type for these too.
+                                       print 'wrong node ending, expected an } ' + str(i) + ' ' + str(self.node_type)
+                                       if DEBUG:
+                                               raise ValueError
                                ### print "returning", i
                                return i+1
                        if l==']':
                                if self.node_type != NODE_ARRAY:
-                                       print 'wrong node ending, expected a ] ' + str(i)
-                                       raise ""
+                                       print 'wrong node ending, expected a ] ' + str(i) + ' ' + str(self.node_type)
+                                       if DEBUG:
+                                               raise ValueError
                                ### print "returning", i
                                return i+1
                                
                        node_type, new_i = is_nodeline(i, [])
                        if node_type: # check text\n{
-                               ### print '\t\tgroup', i
                                child = vrmlNode(self, node_type, i)
                                i = child.parse(i)
-                               # print child.id, 'YYY'
                                
                        elif l=='[': # some files have these anonymous lists
                                child = vrmlNode(self, NODE_ARRAY, i)
@@ -943,6 +1186,7 @@ class vrmlNode(object):
                                                                        # this IS a key but the previous value was not a key, ot it was a defined field.
                                                                        if (not iskey(field_context[-1])) or ((len(field_context)==3 and field_context[1]=='IS')):
                                                                                field_list.append(field_context)
+                                                                               
                                                                                field_context = [value[j]]
                                                                        else:
                                                                                # The last item was not a value, multiple keys are needed in some cases.
@@ -965,18 +1209,9 @@ class vrmlNode(object):
                                                
                                                if value[0]=='field':
                                                        # field SFFloat creaseAngle 4
-                                                       self.getFieldDict()[value[2]] = value[3:] # skip the first 3 values
+                                                       self.proto_field_defs.append(value)
                                                else:
-                                                       # Get referenced field
-                                                       if len(value) >= 3 and value[1]=='IS':
-                                                               try:
-                                                                       value = [ value[0] ] + self.getFieldDict()[ value[2] ]
-                                                               except:
-                                                                       print '\tWarning, field could not be found:', value, 'TODO add support for exposedField'
-                                                                       print '\t', self.getFieldDict()
-                                                                       self.fields.append(value)
-                                                       else:
-                                                               self.fields.append(value)
+                                                       self.fields.append(value)
                                i+=1
 
 def gzipOpen(path):
@@ -1015,8 +1250,9 @@ def vrml_parse(path):
        # Use for testing our parsed output, so we can check on line numbers.
        
        '''
-       ff = open('/test.txt', 'w')
+       ff = open('/tmp/test.txt', 'w')
        ff.writelines([l+'\n' for l in lines])
+       ff.close()
        '''
        
        # Now evaluate it
@@ -1036,9 +1272,8 @@ def vrml_parse(path):
        root.parse(0)
        
        # This prints a load of text
-       '''
-       print root
-       '''
+       if DEBUG:
+               print root
        
        return root, ''
 
@@ -1055,7 +1290,7 @@ class x3dNode(vrmlNode):
                vrmlNode.__init__(self, parent, node_type, -1)
                self.x3dNode = x3dNode
                
-       def parse(self):
+       def parse(self, IS_PROTO_DATA=False):
                # print self.x3dNode.tagName
                
                define = self.x3dNode.getAttributeNode('DEF')
@@ -1195,12 +1430,12 @@ def translateScale(sca):
        mat[2][2] = sca[2]
        return mat
 
-def translateTransform(node):
-       cent =          node.getFieldAsFloatTuple('center', None) # (0.0, 0.0, 0.0)
-       rot =           node.getFieldAsFloatTuple('rotation', None) # (0.0, 0.0, 1.0, 0.0)
-       sca =           node.getFieldAsFloatTuple('scale', None) # (1.0, 1.0, 1.0)
-       scaori =        node.getFieldAsFloatTuple('scaleOrientation', None) # (0.0, 0.0, 1.0, 0.0)
-       tx =            node.getFieldAsFloatTuple('translation', None) # (0.0, 0.0, 0.0)
+def translateTransform(node, ancestry):
+       cent =          node.getFieldAsFloatTuple('center', None, ancestry) # (0.0, 0.0, 0.0)
+       rot =           node.getFieldAsFloatTuple('rotation', None, ancestry) # (0.0, 0.0, 1.0, 0.0)
+       sca =           node.getFieldAsFloatTuple('scale', None, ancestry) # (1.0, 1.0, 1.0)
+       scaori =        node.getFieldAsFloatTuple('scaleOrientation', None, ancestry) # (0.0, 0.0, 1.0, 0.0)
+       tx =            node.getFieldAsFloatTuple('translation', None, ancestry) # (0.0, 0.0, 0.0)
        
        if cent:
                cent_mat = TranslationMatrix(Vector(cent)).resize4x4()
@@ -1232,11 +1467,11 @@ def translateTransform(node):
        
        return new_mat
 
-def translateTexTransform(node):
-       cent =          node.getFieldAsFloatTuple('center', None) # (0.0, 0.0)
-       rot =           node.getFieldAsFloat('rotation', None) # 0.0
-       sca =           node.getFieldAsFloatTuple('scale', None) # (1.0, 1.0)
-       tx =            node.getFieldAsFloatTuple('translation', None) # (0.0, 0.0)
+def translateTexTransform(node, ancestry):
+       cent =          node.getFieldAsFloatTuple('center', None, ancestry) # (0.0, 0.0)
+       rot =           node.getFieldAsFloat('rotation', None, ancestry) # 0.0
+       sca =           node.getFieldAsFloatTuple('scale', None, ancestry) # (1.0, 1.0)
+       tx =            node.getFieldAsFloatTuple('translation', None, ancestry) # (0.0, 0.0)
        
        
        if cent:
@@ -1279,17 +1514,17 @@ def getFinalMatrix(node, mtx, ancestry):
                mtx = Matrix()
        
        for node_tx in transform_nodes:
-               mat = translateTransform(node_tx)
+               mat = translateTransform(node_tx, ancestry)
                mtx = mtx * mat
        
        return mtx
 
-def importMesh_IndexedFaceSet(geom, bpyima):
+def importMesh_IndexedFaceSet(geom, bpyima, ancestry):
        # print geom.lineno, geom.id, vrmlNode.DEF_NAMESPACE.keys()
        
-       ccw =                           geom.getFieldAsBool('ccw', True)
-       ifs_colorPerVertex =    geom.getFieldAsBool('colorPerVertex', True) # per vertex or per face
-       ifs_normalPerVertex =   geom.getFieldAsBool('normalPerVertex', True)
+       ccw =                           geom.getFieldAsBool('ccw', True, ancestry)
+       ifs_colorPerVertex =    geom.getFieldAsBool('colorPerVertex', True, ancestry) # per vertex or per face
+       ifs_normalPerVertex =   geom.getFieldAsBool('normalPerVertex', True, ancestry)
        
        # This is odd how point is inside Coordinate
        
@@ -1298,14 +1533,14 @@ def importMesh_IndexedFaceSet(geom, bpyima):
        
        coord = geom.getChildBySpec('Coordinate') # works for x3d and vrml
        
-       if coord:       ifs_points = coord.getFieldAsArray('point', 3)
+       if coord:       ifs_points = coord.getFieldAsArray('point', 3, ancestry)
        else:           coord = []
        
        if not coord:
                print '\tWarnint: IndexedFaceSet has no points'
                return None, ccw
        
-       ifs_faces = geom.getFieldAsArray('coordIndex', 0)
+       ifs_faces = geom.getFieldAsArray('coordIndex', 0, ancestry)
        
        coords_tex = None
        if ifs_faces: # In rare cases this causes problems - no faces but UVs???
@@ -1315,8 +1550,8 @@ def importMesh_IndexedFaceSet(geom, bpyima):
                coords_tex = geom.getChildBySpec('TextureCoordinate')
                
                if coords_tex:
-                       ifs_texpoints = coords_tex.getFieldAsArray('point', 2)
-                       ifs_texfaces = geom.getFieldAsArray('texCoordIndex', 0)
+                       ifs_texpoints = coords_tex.getFieldAsArray('point', 2, ancestry)
+                       ifs_texfaces = geom.getFieldAsArray('texCoordIndex', 0, ancestry)
                        
                        if not ifs_texpoints:
                                # IF we have no coords, then dont bother
@@ -1329,11 +1564,11 @@ def importMesh_IndexedFaceSet(geom, bpyima):
        vcolor_spot = None # spot color when we dont have an array of colors
        if vcolor:
                # float to char
-               ifs_vcol = [[int(c*256) for c in col] for col in vcolor.getFieldAsArray('color', 3)]
-               ifs_color_index = geom.getFieldAsArray('colorIndex', 0)
+               ifs_vcol = [[int(c*256) for c in col] for col in vcolor.getFieldAsArray('color', 3, ancestry)]
+               ifs_color_index = geom.getFieldAsArray('colorIndex', 0, ancestry)
                
                if not ifs_vcol:
-                       vcolor_spot = [int(c*256) for c in vcolor.getFieldAsFloatTuple('color', [])]
+                       vcolor_spot = [int(c*256) for c in vcolor.getFieldAsFloatTuple('color', [], ancestry)]
        
        # Convert faces into somthing blender can use
        edges = []
@@ -1516,7 +1751,12 @@ def importMesh_IndexedFaceSet(geom, bpyima):
                                fv = f.verts
                                for i,c in enumerate(fcol):
                                        color_index = fv[i].index # color index is vert index
-                                       if ifs_color_index: color_index = ifs_color_index[color_index]
+                                       if ifs_color_index:
+                                               try:
+                                                       color_index = ifs_color_index[color_index]
+                                               except:
+                                                       print '\tWarning: per vertex color index out of range'
+                                                       continue
                                        
                                        if len(ifs_vcol) < color_index:
                                                c.r, c.g, c.b = ifs_vcol[color_index]
@@ -1540,24 +1780,27 @@ def importMesh_IndexedFaceSet(geom, bpyima):
                                        
                                        col = ifs_vcol[color_index]
                                        for i,c in enumerate(fcol):
-                                               c.r, c.g, c.b = col
+                                               try:
+                                                       c.r, c.g, c.b = col
+                                               except:
+                                                       pass # incase its not between 0 and 255
        
        bpymesh.verts.delete([0,]) # EEKADOODLE
        
        return bpymesh, ccw
 
-def importMesh_IndexedLineSet(geom):
+def importMesh_IndexedLineSet(geom, ancestry):
        # VRML not x3d
        #coord = geom.getChildByName('coord') # 'Coordinate'
        coord = geom.getChildBySpec('Coordinate') # works for x3d and vrml
-       if coord:       points = coord.getFieldAsArray('point', 3)
+       if coord:       points = coord.getFieldAsArray('point', 3, ancestry)
        else:           points = []
        
        if not points:
                print '\tWarning: IndexedLineSet had no points'
                return None
        
-       ils_lines = geom.getFieldAsArray('coordIndex', 0)
+       ils_lines = geom.getFieldAsArray('coordIndex', 0, ancestry)
        
        lines = []
        line = []
@@ -1596,11 +1839,11 @@ def importMesh_IndexedLineSet(geom):
        return bpycurve
 
 
-def importMesh_PointSet(geom):
+def importMesh_PointSet(geom, ancestry):
        # VRML not x3d
        #coord = geom.getChildByName('coord') # 'Coordinate'
        coord = geom.getChildBySpec('Coordinate')  # works for x3d and vrml
-       if coord:       points = coord.getFieldAsArray('point', 3)
+       if coord:       points = coord.getFieldAsArray('point', 3, ancestry)
        else:           points = []
        
        # vcolor = geom.getChildByName('color') # blender dosnt have per vertex color
@@ -1614,26 +1857,26 @@ GLOBALS['CIRCLE_DETAIL'] = 12
 
 MATRIX_Z_TO_Y = RotationMatrix(90, 4, 'x')
 
-def importMesh_Sphere(geom):
+def importMesh_Sphere(geom, ancestry):
        # bpymesh = bpy.data.meshes.new()
-       diameter = geom.getFieldAsFloat('radius', 0.5) * 2 # * 2 for the diameter
+       diameter = geom.getFieldAsFloat('radius', 0.5, ancestry) * 2 # * 2 for the diameter
        bpymesh = Mesh.Primitives.UVsphere(GLOBALS['CIRCLE_DETAIL'], GLOBALS['CIRCLE_DETAIL'], diameter)  
        bpymesh.transform(MATRIX_Z_TO_Y)
        return bpymesh
 
-def importMesh_Cylinder(geom):
+def importMesh_Cylinder(geom, ancestry):
        # bpymesh = bpy.data.meshes.new()
-       diameter = geom.getFieldAsFloat('radius', 1.0) * 2 # * 2 for the diameter
-       height = geom.getFieldAsFloat('height', 2)
+       diameter = geom.getFieldAsFloat('radius', 1.0, ancestry) * 2 # * 2 for the diameter
+       height = geom.getFieldAsFloat('height', 2, ancestry)
        bpymesh = Mesh.Primitives.Cylinder(GLOBALS['CIRCLE_DETAIL'], diameter, height) 
        bpymesh.transform(MATRIX_Z_TO_Y)
        
        # Warning - Rely in the order Blender adds verts
        # not nice design but wont change soon.
        
-       bottom = geom.getFieldAsBool('bottom', True)
-       side = geom.getFieldAsBool('side', True)
-       top = geom.getFieldAsBool('top', True)
+       bottom = geom.getFieldAsBool('bottom', True, ancestry)
+       side = geom.getFieldAsBool('side', True, ancestry)
+       top = geom.getFieldAsBool('top', True, ancestry)
        
        if not top: # last vert is top center of tri fan.
                bpymesh.verts.delete([(GLOBALS['CIRCLE_DETAIL']+GLOBALS['CIRCLE_DETAIL'])+1])
@@ -1647,18 +1890,18 @@ def importMesh_Cylinder(geom):
        
        return bpymesh
 
-def importMesh_Cone(geom):
+def importMesh_Cone(geom, ancestry):
        # bpymesh = bpy.data.meshes.new()
-       diameter = geom.getFieldAsFloat('bottomRadius', 1.0) * 2 # * 2 for the diameter
-       height = geom.getFieldAsFloat('height', 2)
+       diameter = geom.getFieldAsFloat('bottomRadius', 1.0, ancestry) * 2 # * 2 for the diameter
+       height = geom.getFieldAsFloat('height', 2, ancestry)
        bpymesh = Mesh.Primitives.Cone(GLOBALS['CIRCLE_DETAIL'], diameter, height) 
        bpymesh.transform(MATRIX_Z_TO_Y)
        
        # Warning - Rely in the order Blender adds verts
        # not nice design but wont change soon.
        
-       bottom = geom.getFieldAsBool('bottom', True)
-       side = geom.getFieldAsBool('side', True)
+       bottom = geom.getFieldAsBool('bottom', True, ancestry)
+       side = geom.getFieldAsBool('side', True, ancestry)
        
        if not bottom: # last vert is on the bottom
                bpymesh.verts.delete([GLOBALS['CIRCLE_DETAIL']+1])
@@ -1667,10 +1910,10 @@ def importMesh_Cone(geom):
        
        return bpymesh
 
-def importMesh_Box(geom):
+def importMesh_Box(geom, ancestry):
        # bpymesh = bpy.data.meshes.new()
        
-       size = geom.getFieldAsFloatTuple('size', (2.0, 2.0, 2.0))
+       size = geom.getFieldAsFloatTuple('size', (2.0, 2.0, 2.0), ancestry)
        bpymesh = Mesh.Primitives.Cube(1.0) 
 
        # Scale the box to the size set
@@ -1714,7 +1957,7 @@ def importShape(node, ancestry):
                        textx = appr.getChildBySpec('TextureTransform')
                        
                        if textx:
-                               texmtx = translateTexTransform(textx)
+                               texmtx = translateTexTransform(textx, ancestry)
                        
 
                        
@@ -1726,28 +1969,28 @@ def importShape(node, ancestry):
                                
                                # all values between 0.0 and 1.0, defaults from VRML docs
                                bpymat = bpy.data.materials.new()
-                               bpymat.amb =            mat.getFieldAsFloat('ambientIntensity', 0.2)
-                               bpymat.rgbCol =         mat.getFieldAsFloatTuple('diffuseColor', [0.8, 0.8, 0.8])
+                               bpymat.amb =            mat.getFieldAsFloat('ambientIntensity', 0.2, ancestry)
+                               bpymat.rgbCol =         mat.getFieldAsFloatTuple('diffuseColor', [0.8, 0.8, 0.8], ancestry)
                                
                                # NOTE - blender dosnt support emmisive color
                                # Store in mirror color and approximate with emit.
-                               emit =                          mat.getFieldAsFloatTuple('emissiveColor', [0.0, 0.0, 0.0])
+                               emit =                          mat.getFieldAsFloatTuple('emissiveColor', [0.0, 0.0, 0.0], ancestry)
                                bpymat.mirCol =         emit
                                bpymat.emit =           (emit[0]+emit[1]+emit[2])/3.0
                                
-                               bpymat.hard =           int(1+(510*mat.getFieldAsFloat('shininess', 0.2))) # 0-1 -> 1-511
-                               bpymat.specCol =        mat.getFieldAsFloatTuple('specularColor', [0.0, 0.0, 0.0])
-                               bpymat.alpha =          1.0 - mat.getFieldAsFloat('transparency', 0.0)
+                               bpymat.hard =           int(1+(510*mat.getFieldAsFloat('shininess', 0.2, ancestry))) # 0-1 -> 1-511
+                               bpymat.specCol =        mat.getFieldAsFloatTuple('specularColor', [0.0, 0.0, 0.0], ancestry)
+                               bpymat.alpha =          1.0 - mat.getFieldAsFloat('transparency', 0.0, ancestry)
                                if bpymat.alpha < 0.999:
                                        bpymat.mode |= Material.Modes.ZTRANSP
                        
                        
                        if ima:
                                
-                               ima_url =                       ima.getFieldAsString('url')
+                               ima_url =                       ima.getFieldAsString('url', None, ancestry)
                                
                                if ima_url==None:
-                                       try:            ima_url = ima.getFieldAsStringArray('url')[0] # in some cases we get a list of images.
+                                       try:            ima_url = ima.getFieldAsStringArray('url', ancestry)[0] # in some cases we get a list of images.
                                        except:         ima_url = None
                                
                                if ima_url==None:
@@ -1772,8 +2015,8 @@ def importShape(node, ancestry):
                                                else:
                                                        bpymat.setTexture(0, texture, Texture.TexCo.UV, Texture.MapTo.COL)
                                                        
-                                               ima_repS =                      ima.getFieldAsBool('repeatS', True)
-                                               ima_repT =                      ima.getFieldAsBool('repeatT', True)
+                                               ima_repS =                      ima.getFieldAsBool('repeatS', True, ancestry)
+                                               ima_repT =                      ima.getFieldAsBool('repeatT', True, ancestry)
                                                
                                                # To make this work properly we'd need to scale the UV's too, better to ignore th
                                                # texture.repeat =      max(1, ima_repS * 512), max(1, ima_repT * 512)
@@ -1785,19 +2028,19 @@ def importShape(node, ancestry):
                geom_spec = geom.getSpec()
                ccw = True
                if geom_spec == 'IndexedFaceSet':
-                       bpydata, ccw = importMesh_IndexedFaceSet(geom, bpyima)
+                       bpydata, ccw = importMesh_IndexedFaceSet(geom, bpyima, ancestry)
                elif geom_spec == 'IndexedLineSet':
-                       bpydata = importMesh_IndexedLineSet(geom)
+                       bpydata = importMesh_IndexedLineSet(geom, ancestry)
                elif geom_spec == 'PointSet':
-                       bpydata = importMesh_PointSet(geom)
+                       bpydata = importMesh_PointSet(geom, ancestry)
                elif geom_spec == 'Sphere':
-                       bpydata = importMesh_Sphere(geom)
+                       bpydata = importMesh_Sphere(geom, ancestry)
                elif geom_spec == 'Box':
-                       bpydata = importMesh_Box(geom)
+                       bpydata = importMesh_Box(geom, ancestry)
                elif geom_spec == 'Cylinder':
-                       bpydata = importMesh_Cylinder(geom)
+                       bpydata = importMesh_Cylinder(geom, ancestry)
                elif geom_spec == 'Cone':
-                       bpydata = importMesh_Cone(geom)
+                       bpydata = importMesh_Cone(geom, ancestry)
                else:
                        print '\tWarning: unsupported type "%s"' % geom_spec
                        return
@@ -1810,8 +2053,8 @@ def importShape(node, ancestry):
                        bpyob  = node.blendObject = bpy.data.scenes.active.objects.new(bpydata)
                        
                        if type(bpydata) == Types.MeshType:
-                               is_solid =                      geom.getFieldAsBool('solid', True)
-                               creaseAngle =           geom.getFieldAsFloat('creaseAngle', None)
+                               is_solid =                      geom.getFieldAsBool('solid', True, ancestry)
+                               creaseAngle =           geom.getFieldAsFloat('creaseAngle', None, ancestry)
                                
                                if creaseAngle != None:
                                        bpydata.maxSmoothAngle = 1+int(min(79, creaseAngle * RAD_TO_DEG))
@@ -1852,17 +2095,17 @@ def importShape(node, ancestry):
                        bpyob.setMatrix( getFinalMatrix(node, None, ancestry) )
 
 
-def importLamp_PointLight(node):
+def importLamp_PointLight(node, ancestry):
        vrmlname = node.getDefName()
        if not vrmlname: vrmlname = 'PointLight'
        
-       # ambientIntensity = node.getFieldAsFloat('ambientIntensity', 0.0) # TODO
-       # attenuation = node.getFieldAsFloatTuple('attenuation', (1.0, 0.0, 0.0)) # TODO
-       color = node.getFieldAsFloatTuple('color', (1.0, 1.0, 1.0))
-       intensity = node.getFieldAsFloat('intensity', 1.0) # max is documented to be 1.0 but some files have higher.
-       location = node.getFieldAsFloatTuple('location', (0.0, 0.0, 0.0))
-       # is_on = node.getFieldAsBool('on', True) # TODO
-       radius = node.getFieldAsFloat('radius', 100.0)
+       # ambientIntensity = node.getFieldAsFloat('ambientIntensity', 0.0, ancestry) # TODO
+       # attenuation = node.getFieldAsFloatTuple('attenuation', (1.0, 0.0, 0.0), ancestry) # TODO
+       color = node.getFieldAsFloatTuple('color', (1.0, 1.0, 1.0), ancestry)
+       intensity = node.getFieldAsFloat('intensity', 1.0, ancestry) # max is documented to be 1.0 but some files have higher.
+       location = node.getFieldAsFloatTuple('location', (0.0, 0.0, 0.0), ancestry)
+       # is_on = node.getFieldAsBool('on', True, ancestry) # TODO
+       radius = node.getFieldAsFloat('radius', 100.0, ancestry)
        
        bpylamp = bpy.data.lamps.new()
        bpylamp.setType('Lamp')
@@ -1874,15 +2117,15 @@ def importLamp_PointLight(node):
        
        return bpylamp, mtx
 
-def importLamp_DirectionalLight(node):
+def importLamp_DirectionalLight(node, ancestry):
        vrmlname = node.getDefName()
        if not vrmlname: vrmlname = 'DirectLight'
        
        # ambientIntensity = node.getFieldAsFloat('ambientIntensity', 0.0) # TODO
-       color = node.getFieldAsFloatTuple('color', (1.0, 1.0, 1.0))
-       direction = node.getFieldAsFloatTuple('direction', (0.0, 0.0, -1.0))
-       intensity = node.getFieldAsFloat('intensity', 1.0) # max is documented to be 1.0 but some files have higher.
-       # is_on = node.getFieldAsBool('on', True) # TODO
+       color = node.getFieldAsFloatTuple('color', (1.0, 1.0, 1.0), ancestry)
+       direction = node.getFieldAsFloatTuple('direction', (0.0, 0.0, -1.0), ancestry)
+       intensity = node.getFieldAsFloat('intensity', 1.0, ancestry) # max is documented to be 1.0 but some files have higher.
+       # is_on = node.getFieldAsBool('on', True, ancestry) # TODO
        
        bpylamp = bpy.data.lamps.new(vrmlname)
        bpylamp.setType('Sun')
@@ -1896,20 +2139,20 @@ def importLamp_DirectionalLight(node):
 
 # looks like default values for beamWidth and cutOffAngle were swapped in VRML docs.
 
-def importLamp_SpotLight(node):
+def importLamp_SpotLight(node, ancestry):
        vrmlname = node.getDefName()
        if not vrmlname: vrmlname = 'SpotLight'
        
-       # ambientIntensity = geom.getFieldAsFloat('ambientIntensity', 0.0) # TODO
-       # attenuation = geom.getFieldAsFloatTuple('attenuation', (1.0, 0.0, 0.0)) # TODO
-       beamWidth = node.getFieldAsFloat('beamWidth', 1.570796) * RAD_TO_DEG # max is documented to be 1.0 but some files have higher.
-       color = node.getFieldAsFloatTuple('color', (1.0, 1.0, 1.0))
-       cutOffAngle = node.getFieldAsFloat('cutOffAngle', 0.785398) * RAD_TO_DEG # max is documented to be 1.0 but some files have higher.
-       direction = node.getFieldAsFloatTuple('direction', (0.0, 0.0, -1.0))
-       intensity = node.getFieldAsFloat('intensity', 1.0) # max is documented to be 1.0 but some files have higher.
-       location = node.getFieldAsFloatTuple('location', (0.0, 0.0, 0.0))
-       # is_on = node.getFieldAsBool('on', True) # TODO
-       radius = node.getFieldAsFloat('radius', 100.0)
+       # ambientIntensity = geom.getFieldAsFloat('ambientIntensity', 0.0, ancestry) # TODO
+       # attenuation = geom.getFieldAsFloatTuple('attenuation', (1.0, 0.0, 0.0), ancestry) # TODO
+       beamWidth = node.getFieldAsFloat('beamWidth', 1.570796, ancestry) * RAD_TO_DEG # max is documented to be 1.0 but some files have higher.
+       color = node.getFieldAsFloatTuple('color', (1.0, 1.0, 1.0), ancestry)
+       cutOffAngle = node.getFieldAsFloat('cutOffAngle', 0.785398, ancestry) * RAD_TO_DEG # max is documented to be 1.0 but some files have higher.
+       direction = node.getFieldAsFloatTuple('direction', (0.0, 0.0, -1.0), ancestry)
+       intensity = node.getFieldAsFloat('intensity', 1.0, ancestry) # max is documented to be 1.0 but some files have higher.
+       location = node.getFieldAsFloatTuple('location', (0.0, 0.0, 0.0), ancestry)
+       # is_on = node.getFieldAsBool('on', True, ancestry) # TODO
+       radius = node.getFieldAsFloat('radius', 100.0, ancestry)
        
        bpylamp = bpy.data.lamps.new(vrmlname)
        bpylamp.setType('Spot')
@@ -1935,14 +2178,14 @@ def importLamp_SpotLight(node):
 
 def importLamp(node, spec, ancestry):
        if spec=='PointLight':
-               bpylamp,mtx = importLamp_PointLight(node)
+               bpylamp,mtx = importLamp_PointLight(node, ancestry)
        elif spec=='DirectionalLight':
-               bpylamp,mtx = importLamp_DirectionalLight(node)
+               bpylamp,mtx = importLamp_DirectionalLight(node, ancestry)
        elif spec=='SpotLight':
-               bpylamp,mtx = importLamp_SpotLight(node)
+               bpylamp,mtx = importLamp_SpotLight(node, ancestry)
        else:
                print "Error, not a lamp"
-               raise ""
+               raise ValueError
        
        bpyob = node.blendObject = bpy.data.scenes.active.objects.new(bpylamp)
        bpyob.setMatrix( getFinalMatrix(node, mtx, ancestry) )
@@ -1952,11 +2195,11 @@ def importViewpoint(node, ancestry):
        name = node.getDefName()
        if not name: name = 'Viewpoint'
        
-       fieldOfView = node.getFieldAsFloat('fieldOfView', 0.785398) * RAD_TO_DEG # max is documented to be 1.0 but some files have higher.
-       # jump = node.getFieldAsBool('jump', True)
-       orientation = node.getFieldAsFloatTuple('orientation', (0.0, 0.0, 1.0, 0.0))
-       position = node.getFieldAsFloatTuple('position', (0.0, 0.0, 0.0))
-       description = node.getFieldAsString('description', '')
+       fieldOfView = node.getFieldAsFloat('fieldOfView', 0.785398, ancestry) * RAD_TO_DEG # max is documented to be 1.0 but some files have higher.
+       # jump = node.getFieldAsBool('jump', True, ancestry)
+       orientation = node.getFieldAsFloatTuple('orientation', (0.0, 0.0, 1.0, 0.0), ancestry)
+       position = node.getFieldAsFloatTuple('position', (0.0, 0.0, 0.0), ancestry)
+       description = node.getFieldAsString('description', '', ancestry)
        
        bpycam = bpy.data.cameras.new(name)
        
@@ -1976,63 +2219,80 @@ def importTransform(node, ancestry):
        bpyob = node.blendObject = bpy.data.scenes.active.objects.new('Empty', name) # , name)
        bpyob.setMatrix( getFinalMatrix(node, None, ancestry) )
 
+       # so they are not too annoying
+       bpyob.emptyShape= Blender.Object.EmptyShapes.AXES
+       bpyob.drawSize= 0.2
+
        
 #def importTimeSensor(node):
 
 
-def translatePositionInterpolator(node, ipo):
-       key = node.getFieldAsArray('key', 0)
-       keyValue = node.getFieldAsArray('keyValue', 3)
-       
-       loc_x = ipo.addCurve('LocX')
-       loc_y = ipo.addCurve('LocY')
-       loc_z = ipo.addCurve('LocZ')
+def translatePositionInterpolator(node, ipo, ancestry):
+       key = node.getFieldAsArray('key', 0, ancestry)
+       keyValue = node.getFieldAsArray('keyValue', 3, ancestry)
        
+       try:
+               loc_x = ipo.addCurve('LocX')
+               loc_y = ipo.addCurve('LocY')
+               loc_z = ipo.addCurve('LocZ')
+       except ValueError:
+               return
+               
        loc_x.interpolation = loc_y.interpolation = loc_z.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
        
        for i, time in enumerate(key):
-               x,y,z = keyValue[i]
+               try:            x,y,z = keyValue[i]
+               except: continue
                
                loc_x.append((time,x))
                loc_y.append((time,y))
                loc_z.append((time,z))
 
-def translateOrientationInterpolator(node, ipo):
-       key = node.getFieldAsArray('key', 0)
-       keyValue = node.getFieldAsArray('keyValue', 4)
+def translateOrientationInterpolator(node, ipo, ancestry):
+       key = node.getFieldAsArray('key', 0, ancestry)
+       keyValue = node.getFieldAsArray('keyValue', 4, ancestry)
        
-       rot_x = ipo.addCurve('RotX')
-       rot_y = ipo.addCurve('RotY')
-       rot_z = ipo.addCurve('RotZ')
+       try:
+               rot_x = ipo.addCurve('RotX')
+               rot_y = ipo.addCurve('RotY')
+               rot_z = ipo.addCurve('RotZ')
+       except ValueError:
+               return
        
        rot_x.interpolation = rot_y.interpolation = rot_z.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
        
        for i, time in enumerate(key):
+               try:            x,y,z,w = keyValue[i]
+               except: continue
                
-               mtx = translateRotation(keyValue[i])
+               mtx = translateRotation((x,y,z,w))
                eul = mtx.toEuler()
                rot_x.append((time,eul.x/10.0))
                rot_y.append((time,eul.y/10.0))
                rot_z.append((time,eul.z/10.0))
 
 # Untested!
-def translateScalarInterpolator(node, ipo):
-       key = node.getFieldAsArray('key', 0)
-       keyValue = node.getFieldAsArray('keyValue', 4)
+def translateScalarInterpolator(node, ipo, ancestry):
+       key = node.getFieldAsArray('key', 0, ancestry)
+       keyValue = node.getFieldAsArray('keyValue', 4, ancestry)
        
-       sca_x = ipo.addCurve('SizeX')
-       sca_y = ipo.addCurve('SizeY')
-       sca_z = ipo.addCurve('SizeZ')
+       try:
+               sca_x = ipo.addCurve('ScaleX')
+               sca_y = ipo.addCurve('ScaleY')
+               sca_z = ipo.addCurve('ScaleZ')
+       except ValueError:
+               return
        
        sca_x.interpolation = sca_y.interpolation = sca_z.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
        
        for i, time in enumerate(key):
-               x,y,z = keyValue[i]
+               try:            x,y,z = keyValue[i]
+               except: continue
                sca_x.append((time,x/10.0))
                sca_y.append((time,y/10.0))
                sca_z.append((time,z/10.0))
 
-def translateTimeSensor(node, ipo):
+def translateTimeSensor(node, ipo, ancestry):
        '''
        Apply a time sensor to an IPO, VRML has many combinations of loop/start/stop/cycle times
        to give different results, for now just do the basics
@@ -2041,15 +2301,15 @@ def translateTimeSensor(node, ipo):
        time_cu = ipo.addCurve('Time')
        time_cu.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
        
-       cycleInterval = node.getFieldAsFloat('cycleInterval', None)
+       cycleInterval = node.getFieldAsFloat('cycleInterval', None, ancestry)
        
-       startTime = node.getFieldAsFloat('startTime', 0.0)
-       stopTime = node.getFieldAsFloat('stopTime', 250.0)
+       startTime = node.getFieldAsFloat('startTime', 0.0, ancestry)
+       stopTime = node.getFieldAsFloat('stopTime', 250.0, ancestry)
                
        if cycleInterval != None:
                stopTime = startTime+cycleInterval
        
-       loop = node.getFieldAsBool('loop', False)
+       loop = node.getFieldAsBool('loop', False, ancestry)
        
        time_cu.append((1+startTime, 0.0))
        time_cu.append((1+stopTime, 1.0/10.0))# anoying, the UI uses /10
@@ -2059,11 +2319,14 @@ def translateTimeSensor(node, ipo):
                time_cu.extend = Blender.IpoCurve.ExtendTypes.CYCLIC # or - EXTRAP, CYCLIC_EXTRAP, CONST, 
 
 
-def importRoute(node):
+def importRoute(node, ancestry):
        '''
        Animation route only at the moment
        '''
        
+       if not hasattr(node, 'fields'):
+               return
+       
        routeIpoDict = node.getRouteIpoDict()
        
        def getIpo(id):
@@ -2093,29 +2356,33 @@ ROUTE champFly001.bindTime TO vpTs.set_startTime
        
        for field in node.fields:
                if field and field[0]=='ROUTE':
-                       from_id, from_type = field[1].split('.')
-                       to_id, to_type = field[3].split('.')
+                       try:
+                               from_id, from_type = field[1].split('.')
+                               to_id, to_type = field[3].split('.')
+                       except:
+                               print "Warning, invalid ROUTE", field
+                               continue
                        
                        if from_type == 'value_changed':
                                if to_type == 'set_position':
                                        ipo = getIpo(to_id)
                                        set_data_from_node = defDict[from_id]
-                                       translatePositionInterpolator(set_data_from_node, ipo)
+                                       translatePositionInterpolator(set_data_from_node, ipo, ancestry)
                                
-                               if to_type == 'set_orientation':
+                               if to_type in ('set_orientation', 'rotation'):
                                        ipo = getIpo(to_id)
                                        set_data_from_node = defDict[from_id]
-                                       translateOrientationInterpolator(set_data_from_node, ipo)
+                                       translateOrientationInterpolator(set_data_from_node, ipo, ancestry)
                                
                                if to_type == 'set_scale':
                                        ipo = getIpo(to_id)
                                        set_data_from_node = defDict[from_id]
-                                       translateScalarInterpolator(set_data_from_node, ipo)
+                                       translateScalarInterpolator(set_data_from_node, ipo, ancestry)
                                
-                       elif from_type == 'bindTime':
+                       elif from_type =='bindTime':
                                ipo = getIpo(from_id)
                                time_node = defDict[to_id]
-                               translateTimeSensor(time_node, ipo)
+                               translateTimeSensor(time_node, ipo, ancestry)
                        
                
 
@@ -2147,6 +2414,16 @@ def load_web3d(path, PREF_FLAT=False, PREF_CIRCLE_DIV=16, HELPER_FUNC = None):
                #       continue
                
                spec = node.getSpec()
+               '''
+               prefix = node.getPrefix()
+               if prefix=='PROTO':
+                       pass
+               else
+               '''
+               if HELPER_FUNC and HELPER_FUNC(node, ancestry):
+                       # Note, include this function so the VRML/X3D importer can be extended
+                       # by an external script. - gets first pick 
+                       pass
                if spec=='Shape':
                        importShape(node, ancestry)
                elif spec in ('PointLight', 'DirectionalLight', 'SpotLight'):
@@ -2163,18 +2440,12 @@ def load_web3d(path, PREF_FLAT=False, PREF_CIRCLE_DIV=16, HELPER_FUNC = None):
                        ipo = bpy.data.ipos.new('web3d_ipo', 'Object')
                        translatePositionInterpolator(node, ipo)
                        '''
-                       
-               else:
-                       # Note, include this function so the VRML/X3D importer can be extended
-                       # by an external script.
-                       if HELPER_FUNC:
-                               HELPER_FUNC(node, ancestry)
-
-
-
+       
+       
+       
        # After we import all nodes, route events - anim paths
        for node, ancestry in all_nodes:
-               importRoute(node)
+               importRoute(node, ancestry)
        
        for node, ancestry in all_nodes:
                if node.isRoot():
@@ -2289,24 +2560,32 @@ if __name__ == '__main__':
 
 # load_web3d('/fe/x3d/www.web3d.org/x3d/content/examples/Basic/StudentProjects/PlayRoom.x3d') # invalid UVs
 
-'''
-import os
-# files = os.popen('find /fe/wrl -iname "*.wrl"').readlines()
-# files = os.popen('find /fe/x3d -iname "*.x3d"').readlines()
-files = os.popen('find   /fe/x3d/X3dExamplesSavage   -iname "*.x3d"').readlines()
 
-files.sort()
-tot = len(files)
-for i, f in enumerate(files):
-       if i < 12803 or i > 1000000:
-               continue
-       #if i != 12686:
-       #       continue
+
+def test():
+       import os
        
-       f = f.strip()
-       print f, i, tot
-       sce = bpy.data.scenes.new(f.split('/')[-1])
-       bpy.data.scenes.active = sce
-       # Window.
-       load_web3d(f, PREF_FLAT=True)
-'''
\ No newline at end of file
+       files = os.popen('find /fe/wrl -iname "*.wrl"').readlines()
+       # files = os.popen('find /fe/x3d -iname "*.x3d"').readlines()
+       # files = os.popen('find   /fe/x3d/X3dExamplesSavage   -iname "*.x3d"').readlines()
+
+       files.sort()
+       tot = len(files)
+       for i, f in enumerate(files):
+               if i < 124 or i > 1000000:
+                       continue
+               
+               #if i != 1068:
+               #       continue
+               
+               #if i != 12686:
+               #       continue
+               
+               f = f.strip()
+               print f, i, tot
+               sce = bpy.data.scenes.new(str(i) + '_' + f.split('/')[-1])
+               bpy.data.scenes.active = sce
+               # Window.
+               load_web3d(f, PREF_FLAT=True)
+       
+# test()
index 006bdf10b49f3b38e0c72c44c96b8c8d528ffd73..670165dda51cdaba6814b4837519114b6e11f091 100644 (file)
@@ -112,7 +112,7 @@ def mesh2polys():
        Window.EditMode(0)
        me = meshOb.getData(mesh=1)
        polygons= polysFromMesh(me)
-       w=t=1
+       w = 1.0
        cu= Curve.New()
        cu.name = me.name
        cu.setFlag(1)
@@ -128,7 +128,7 @@ def mesh2polys():
                        vIdx= 0
                
                v= poly[vIdx]
-               cu.appendNurb([v.co.x, v.co.y, v.co.z, w, t])
+               cu.appendNurb((v.co.x, v.co.y, v.co.z, w))
                vIdx += 1
                cu[i].type= 0 # Poly Line
                
@@ -139,7 +139,7 @@ def mesh2polys():
                # Add all the points in the polyline.
                while vIdx<len(poly):
                        v= poly[vIdx]
-                       cu.appendPoint(i, [v.co.x, v.co.y, v.co.z, w])
+                       cu.appendPoint(i, (v.co.x, v.co.y, v.co.z, w))
                        vIdx+=1
                i+=1
        Window.WaitCursor(0)
diff --git a/release/scripts/scripttemplate_background_job.py b/release/scripts/scripttemplate_background_job.py
new file mode 100644 (file)
index 0000000..86b5899
--- /dev/null
@@ -0,0 +1,124 @@
+#!BPY
+"""
+Name: 'Background Job Example'
+Blender: 248
+Group: 'ScriptTemplate'
+Tooltip: 'Script template for automating tasks from the command line with blender'
+"""
+
+from Blender import Window
+import bpy
+
+script_data = \
+'''# This script is an example of how you can run blender from the command line (in background mode with no interface)
+# to automate tasks, in this example it creates a text object, camera and light, then renders and/or saves it.
+# This example also shows how you can parse command line options to python scripts.
+# 
+# Example usage for this test.
+#  blender -b -P $HOME/background_job.py -- --text="Hello World" --render="/tmp/hello" --save="/tmp/hello.blend"
+# 
+# Notice all python args are after the '--' argument.
+
+import Blender
+import bpy
+
+def example_function(body_text, save_path, render_path):
+       
+       sce= bpy.data.scenes.active
+
+       txt_data= bpy.data.curves.new('MyText', 'Text3d')
+       
+       # Text Object
+       txt_ob = sce.objects.new(txt_data)                      # add the data to the scene as an object
+       txt_data.setText(body_text)                                     # set the body text to the command line arg given
+       txt_data.setAlignment(Blender.Text3d.MIDDLE)# center text
+       
+       # Camera
+       cam_data= bpy.data.cameras.new('MyCam')         # create new camera data
+       cam_ob= sce.objects.new(cam_data)                       # add the camera data to the scene (creating a new object)
+       sce.objects.camera= cam_ob                                      # set the active camera
+       cam_ob.loc= 0,0,10
+       
+       # Lamp
+       lamp_data= bpy.data.lamps.new('MyLamp')
+       lamp_ob= sce.objects.new(lamp_data)
+       lamp_ob.loc= 2,2,5
+
+       if save_path:
+               try:
+                       f= open(save_path, 'w')
+                       f.close()
+                       ok= True
+               except:
+                       print 'Cannot save to path "%s"' % save_path
+                       ok= False
+               
+               if ok:
+                       Blender.Save(save_path, 1)
+       
+       if render_path:
+               render= sce.render
+               render.extensions= True
+               render.renderPath = render_path
+               render.sFrame= 1
+               render.eFrame= 1
+               render.renderAnim()
+
+
+
+import sys             # to get command line args
+import optparse        # to parse options for us and print a nice help message
+
+script_name= 'background_job.py'
+
+def main():
+       
+       # get the args passed to blender after "--", all of which are ignored by blender specifically
+       # so python may receive its own arguments
+       argv= sys.argv
+
+       if '--' not in argv:
+               argv = [] # as if no args are passed
+       else:   
+               argv = argv[argv.index('--')+1: ] # get all args after "--"
+       
+       # When --help or no args are given, print this help
+       usage_text =  'Run blender in background mode with this script:\n'
+       usage_text += '  blender -b -P ' + script_name + ' -- [options]'
+                       
+       parser = optparse.OptionParser(usage = usage_text)
+       
+
+       # Example background utility, add some text and renders or saves it (with options)
+       # Possible types are: string, int, long, choice, float and complex.
+       parser.add_option('-t', '--text', dest='body_text', help='This text will be used to render an image', type='string')
+
+       parser.add_option('-s', '--save', dest='save_path', help='Save the generated file to the specified path', metavar='FILE')
+       parser.add_option('-r', '--render', dest='render_path', help='Render an image to the specified path', metavar='FILE')
+
+       options, args = parser.parse_args(argv) # In this example we wont use the args
+       
+       if not argv:
+               parser.print_help()
+               return
+
+       if not options.body_text:
+               print 'Error: --text="some string" argument not given, aborting.\n'
+               parser.print_help()
+               return
+       
+       # Run the example function
+       example_function(options.body_text, options.save_path, options.render_path)
+
+       print 'batch job finished, exiting'
+
+
+if __name__ == '__main__':
+       main()
+'''
+
+new_text = bpy.data.texts.new('background_job.py')
+new_text.write(script_data)
+bpy.data.texts.active = new_text
+Window.RedrawAll()
+
index 79a445329cccfc14a4aa8dd0885f9e8588bebec4..83df200991f24e112dfb55e0124bf7a8c642cf9c 100644 (file)
@@ -42,28 +42,15 @@ from Blender import *
 import bpy
 import BPyMesh
 
-def extend():
-       sce = bpy.data.scenes.active
-       ob = sce.objects.active
-       
-       # print ob, ob.type
-       if ob == None or ob.type != 'Mesh':
-               Draw.PupMenu('ERROR: No mesh object.')
+def extend(EXTEND_MODE,ob):
+       if EXTEND_MODE == -1:
                return
-       
-       # Toggle Edit mode
+       me = ob.getData(mesh=1)
+       me_verts = me.verts
+               # Toggle Edit mode
        is_editmode = Window.EditMode()
        if is_editmode:
                Window.EditMode(0)
-       
-       me = ob.getData(mesh=1)
-       me_verts = me.verts
-       
-       # 0:normal extend, 1:edge length
-       EXTEND_MODE = Draw.PupMenu("Use Face Area%t|Loop Average%x2|None%x0")
-       if EXTEND_MODE == -1:
-               return
-       
        Window.WaitCursor(1)
        t = sys.time()
        edge_average_lengths = {}
@@ -153,8 +140,7 @@ def extend():
                        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.faceUV:
-               Draw.PupMenu('ERROR: Mesh has no face UV coords.')
-               return
+               me.faceUV= True
        
        face_act =      me.activeFace
        if face_act == -1:
@@ -247,7 +233,22 @@ def extend():
        Window.RedrawAll()
        Window.WaitCursor(0)
 
-if __name__ == '__main__':
-       extend()
+
+def main():
+       sce = bpy.data.scenes.active
+       ob = sce.objects.active
+       
+       # print ob, ob.type
+       if ob == None or ob.type != 'Mesh':
+               Draw.PupMenu('ERROR: No mesh object.')
+               return
        
-       
\ No newline at end of file
+
+       
+       # 0:normal extend, 1:edge length
+       EXTEND_MODE = Draw.PupMenu("Use Face Area%t|Loop Average%x2|None%x0")
+       extend(EXTEND_MODE,ob)
+
+if __name__ == '__main__':
+       main()
+
index 0bba747e010cb73968f667eb0f80bfec603f28a2..130a7e5af7729e83fa1680e43ad5f9b7f451e381 100644 (file)
@@ -171,6 +171,9 @@ def main():
                f_uv = f.uv
                return [(v.co-face_corner_main, f_uv[i]) for i,v in enumerate(f.v)]
        
+       if me.faceUV==False:
+               me.faceUV= True
+
        coords = [ (co,uv) for f in me.faces if f.sel for co, uv in get_face_coords(f)]
        
        coords_orig = [uv.copy() for co, uv in coords]
@@ -264,4 +267,5 @@ def main():
        
 if __name__=='__main__':
        main()
-       Window.DrawProgressBar(1.0, '')
\ No newline at end of file
+       Window.DrawProgressBar(1.0, '')
+
index 2df5b7e721fcfe186ddbedd8ba91d939392d46dd..9668c521f3a2553bd0a974d65155bb056dbb2745 100644 (file)
@@ -27,6 +27,7 @@ def matcol(mat):
                int(mat.R*255),\
                int(mat.G*255),\
                int(mat.B*255)
+       else:
                return None
 
 def mat2vcol(PREF_SEL_FACES_ONLY, PREF_ACTOB_ONLY, PREF_MULTIPLY_COLOR):
@@ -47,7 +48,7 @@ def mat2vcol(PREF_SEL_FACES_ONLY, PREF_ACTOB_ONLY, PREF_MULTIPLY_COLOR):
                me= ob.getData(mesh=1)
                
                try:
-                       me.faceUV=True
+                       me.vertexColors=True
                except: # no faces
                        continue
                
index 0f46e6abfafdb943053b78b8e4a42012d3476e17..46fbffeb610e10759d52f0489407d71c711cda47 100644 (file)
@@ -243,6 +243,7 @@ PULIB += $(OCGDIR)/blender/ed_curve/libed_curve.a
 PULIB += $(OCGDIR)/blender/ed_armature/libed_armature.a
 PULIB += $(OCGDIR)/blender/ed_mesh/libed_mesh.a
 PULIB += $(OCGDIR)/blender/ed_sculpt/libed_sculpt.a
+PULIB += $(OCGDIR)/blender/ed_physics/libed_physics.a
 PULIB += $(OCGDIR)/blender/ed_animation/libed_animation.a
 PULIB += $(OCGDIR)/blender/ed_transform/libed_transform.a
 PULIB += $(OCGDIR)/blender/ed_util/libed_util.a
index 07ca975c46fecefb142c257b1486be506abee8b2..eba7558d4920dfdf491afc5e2e83c61dfcc44771 100644 (file)
@@ -34,6 +34,7 @@
 struct ID;
 struct Brush;
 struct ImBuf;
+struct wmOperator;
 
 /* datablock functions */
 struct Brush *add_brush(char *name);
@@ -58,6 +59,7 @@ typedef enum {
        BRUSH_PRESET_MAX
 } BrushCurvePreset;
 void brush_curve_preset(struct Brush *b, BrushCurvePreset preset);
+float brush_curve_strength(struct Brush *br, float p, const float len);
 
 /* sampling */
 float brush_sample_falloff(struct Brush *brush, float dist);
@@ -79,5 +81,12 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
 void brush_painter_break_stroke(BrushPainter *painter);
 void brush_painter_free(BrushPainter *painter);
 
+/* texture */
+unsigned int *brush_gen_texture_cache(struct Brush *br, int half_side);
+
+/* radial control */
+void brush_radial_control_invoke(struct wmOperator *op, struct Brush *br);
+int brush_radial_control_exec(struct wmOperator *op, struct Brush *br);
+
 #endif
 
index 7065948ea0b50a4cbca40049e69fc0db181d6c6b..b17f4a76198d78d5a1a0ca931674ecd6d7da4d03 100644 (file)
@@ -49,6 +49,7 @@ struct BevList;
 
 void unlink_curve( struct Curve *cu);
 void free_curve( struct Curve *cu);
+void BKE_free_editfont(struct Curve *cu);
 struct Curve *add_curve(char *name, int type);
 struct Curve *copy_curve( struct Curve *cu);
 void make_local_curve( struct Curve *cu);
index 8732d63f0472f7e240abba8e74ae61da8d43fa86..bed909fd0409e6b31e67b7b65355c19d05c6e891 100644 (file)
@@ -95,6 +95,8 @@ void testhandles_fcurve(struct FCurve *fcu);
 void sort_time_fcurve(struct FCurve *fcu);
 short test_time_fcurve(struct FCurve *fcu);
 
+void correct_bezpart(float *v1, float *v2, float *v3, float *v4);
+
 /* -------- Evaluation --------  */
 
 /* evaluate fcurve */
index 3445e5b1ce2461a0727306b321ae78716c3bfde2..d328ccd57f4631b5bc5b11fc66003b691083cbf3 100644 (file)
@@ -43,6 +43,7 @@ struct Object;
 struct Curve;
 struct objfnt;
 struct TmpFont;
+struct CharInfo;
 
 struct chartrans {
        float xof, yof;
@@ -55,20 +56,31 @@ typedef struct SelBox {
        float x, y, w, h;
 } SelBox;
 
-extern struct SelBox *selboxes;
+typedef struct EditFont {      
+       wchar_t *copybuf;
+       wchar_t *copybufinfo;
+       
+       wchar_t *textbuf;
+       struct CharInfo *textbufinfo;
+       wchar_t *oldstr;
+       struct CharInfo *oldstrinfo;
+       
+       float textcurs[4][2];
+       
+} EditFont;
+
 
 void BKE_font_register_builtin(void *mem, int size);
 
 void free_vfont(struct VFont *sc); 
 void free_ttfont(void);
+struct VFont *get_builtin_font(void);
 struct VFont *load_vfont(char *name);
 struct TmpFont *vfont_find_tmpfont(struct VFont *vfont);
 
-struct chartrans *text_to_curve(struct Scene *scene, struct Object *ob, int mode);
-int style_to_sel(int style, int toggle);
-int mat_to_sel(void);
+struct chartrans *BKE_text_to_curve(struct Scene *scene, struct Object *ob, int mode);
 
-int getselection(struct Object *ob, int *start, int *end);
+int BKE_font_getselection(struct Object *ob, int *start, int *end);
 
 void chtoutf8(unsigned long c, char *o);
 void wcs2utf8s(char *dst, wchar_t *src);
index 4bd9435708d7859e3bf41d314ee592b2069eaf7e..0d5208ed90dc09a69fbd42b4c6822cff57e11551 100644 (file)
@@ -76,8 +76,6 @@ typedef struct Global {
        /* Used for BMesh transformations */
        struct BME_Glob *editBMesh;
     
-       float textcurs[4][2];
-    
        /* Frank's variables */
        int     save_over;
 
@@ -180,6 +178,7 @@ typedef struct Global {
 #define G_FILE_GLSL_NO_RAMPS    (1 << 19)
 #define G_FILE_GLSL_NO_NODES    (1 << 20)
 #define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21)
+#define G_FILE_IGNORE_DEPRECATION_WARNINGS     (1 << 22)
 
 /* G.windowstate */
 #define G_WINDOWSTATE_USERDEF          0
index fae62b4a23e8f2e41b72cba9b5166ac520c1c073..a3f451438bd71bea5fa4ba46353e80c047ec608b 100644 (file)
@@ -24,7 +24,7 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): 2008, Joshua Leung (Animation Cleanup)
+ * Contributor(s): 2008,2009  Joshua Leung (Animation Cleanup, Animation Systme Recode)
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 extern "C" {
 #endif
 
-       
-/* -------- IPO-Curve (Bezier) Calculations ---------- */
-
-// xxx perhaps this should be in curve api not in anim api
-void correct_bezpart(float *v1, float *v2, float *v3, float *v4);
-       
-
-// XXX this file will soon be depreceated...
-#if 0 // XXX old animation system
-
-typedef struct CfraElem {
-       struct CfraElem *next, *prev;
-       float cfra;
-       int sel;
-} CfraElem;
-
+struct Main;
 struct Ipo;
-struct IpoCurve;
-struct MTex;
-struct Material;
-struct Scene;
-struct Object;
-struct Sequence;
-struct ListBase;
-struct BezTriple;
-struct ID;
-struct bPoseChannel;
-struct bActionChannel;
-struct rctf;
 
-/* ------------ Time Management ------------ */
+void do_versions_ipo_to_animato(struct Main *main);
 
-float frame_to_float(struct Scene *scene, int cfra);
+/* --------------------- xxx stuff ------------------------ */
 
-/* ------------ IPO Management ---------- */
-
-void free_ipo_curve(struct IpoCurve *icu);
 void free_ipo(struct Ipo *ipo);
 
-void ipo_default_v2d_cur(struct Scene *scene, int blocktype, struct rctf *cur);
-
-struct Ipo *add_ipo(struct Scene *scene, char *name, int idcode);
-struct Ipo *copy_ipo(struct Ipo *ipo);
-
-void ipo_idnew(struct Ipo *ipo);
-
-struct IpoCurve *find_ipocurve(struct Ipo *ipo, int adrcode);
-short has_ipo_code(struct Ipo *ipo, int code);
-
-/* -------------- Make Local -------------- */
-
-void make_local_obipo(struct Ipo *ipo);
-void make_local_matipo(struct Ipo *ipo);
-void make_local_keyipo(struct Ipo *ipo);
-void make_local_ipo(struct Ipo *ipo);
-
-/* ------------ IPO-Curve Sanity ---------------- */
-
-void calchandles_ipocurve(struct IpoCurve *icu);
-void testhandles_ipocurve(struct IpoCurve *icu);
-void sort_time_ipocurve(struct IpoCurve *icu);
-int test_time_ipocurve(struct IpoCurve *icu);
-
-void set_interpolation_ipocurve(struct IpoCurve *icu, short ipo);
-
-/* -------- IPO-Curve (Bezier) Calculations ---------- */
-
+// xxx perhaps this should be in curve api not in anim api
 void correct_bezpart(float *v1, float *v2, float *v3, float *v4);
-int findzero(float x, float q0, float q1, float q2, float q3, float *o);
-void berekeny(float f1, float f2, float f3, float f4, float *o, int b);
-void berekenx(float *f, float *o, int b);
-
-/* -------- IPO Curve Calculation and Evaluation --------- */
-
-float eval_icu(struct IpoCurve *icu, float ipotime);
-void calc_icu(struct IpoCurve *icu, float ctime);
-float calc_ipo_time(struct Ipo *ipo, float ctime);
-void calc_ipo(struct Ipo *ipo, float ctime);
-
-void calc_ipo_range(struct Ipo *ipo, float *start, float *end);
-
-/* ------------ Keyframe Column Tools -------------- */
-
-void add_to_cfra_elem(struct ListBase *lb, struct BezTriple *bezt);
-void make_cfra_list(struct Ipo *ipo, struct ListBase *elems);
-
-/* ---------------- IPO DataAPI ----------------- */
-
-void write_ipo_poin(void *poin, int type, float val);
-float read_ipo_poin(void *poin, int type);
-
-void *give_mtex_poin(struct MTex *mtex, int adrcode );
-void *get_pchan_ipo_poin(struct bPoseChannel *pchan, int adrcode);
-void *get_ipo_poin(struct ID *id, struct IpoCurve *icu, int *type);
-
-void set_icu_vars(struct IpoCurve *icu);
-
-/* ---------------- IPO Execution --------------- */
-
-void execute_ipo(struct ID *id, struct Ipo *ipo);
-void execute_action_ipo(struct bActionChannel *achan, struct bPoseChannel *pchan);
-
-void do_ipo_nocalc(struct Scene *scene, struct Ipo *ipo);
-void do_ipo(struct Scene *scene, struct Ipo *ipo);
-void do_mat_ipo(struct Scene *scene, struct Material *ma);
-void do_ob_ipo(struct Scene *scene, struct Object *ob);
-void do_seq_ipo(struct Scene *scene, struct Sequence *seq, int cfra);
-void do_ob_ipodrivers(struct Object *ob, struct Ipo *ipo, float ctime);
-
-void do_all_data_ipos(struct Scene *scene);
-short calc_ipo_spec(struct Ipo *ipo, int adrcode, float *ctime);
-void clear_delta_obipo(struct Ipo *ipo);
-
-/* ----------- IPO <-> GameEngine API ---------------- */
-
-/* the short is an IPO_Channel... */
-
-short IPO_GetChannels(struct Ipo *ipo, short *channels);
-float IPO_GetFloatValue(struct Ipo *ipo, short c, float ctime);
-
-#endif // XXX old animation system
+       
 
 #ifdef __cplusplus
 };
index 2ca4b3aa39a3d9b1f07845d9e0303e33d2d99cb9..042b3b3046c7d24026275bbf54da1019c5bf7091 100644 (file)
@@ -39,6 +39,7 @@ struct ListBase;
 struct MDeformVert;
 struct Mesh;
 struct MFace;
+struct MEdge;
 struct MVert;
 struct MCol;
 struct Object;
@@ -109,6 +110,16 @@ UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned
 UvMapVert *get_uv_map_vert(UvVertMap *vmap, unsigned int v);
 void free_uv_vert_map(UvVertMap *vmap);
 
+/* Connectivity data */
+typedef struct IndexNode {
+       struct IndexNode *next, *prev;
+       int index;
+} IndexNode;
+void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *mface,
+                         const int totvert, const int totface);
+void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *medge,
+                         const int totvert, const int totedge);
+
 /* Partial Mesh Visibility */
 struct PartialVisibility *mesh_pmv_copy(struct PartialVisibility *);
 void mesh_pmv_free(struct PartialVisibility *);
index 8ee1d15d0f3a5847c13bc7752a8c7c322376b6e7..3b0ff2db6f46292bfd328c3f06558db5c972dbd9 100644 (file)
@@ -38,16 +38,6 @@ typedef struct MultiresSubsurf {
        struct Mesh *me;
 } MultiresSubsurf;
 
-typedef struct IndexNode {
-       struct IndexNode *next, *prev;
-       int index;
-} IndexNode;
-
-void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *mface,
-                         const int totvert, const int totface);
-void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *medge,
-                         const int totvert, const int totedge);
-
 /* MultiresDM */
 struct Mesh *MultiresDM_get_mesh(struct DerivedMesh *dm);
 struct DerivedMesh *MultiresDM_new(struct MultiresSubsurf *, struct DerivedMesh*, int, int, int);
index 5c11a56452760c1c90dcb7fdcf194717e1376441..616bf737889f77b4cd128bd80e151c96ae58b385 100644 (file)
@@ -301,6 +301,10 @@ void do_effectors(int pa_no, struct ParticleData *pa, struct ParticleKey *state,
 void psys_calc_dmcache(struct Object *ob, struct DerivedMesh *dm, struct ParticleSystem *psys);
 int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int index, float *fw, struct LinkNode *node);
 
+void reset_particle(struct Scene *scene, struct ParticleData *pa, struct ParticleSystem *psys, struct ParticleSystemModifierData *psmd, struct Object *ob,
+                                       float dtime, float cfra, float *vg_vel, float *vg_tan, float *vg_rot);
+
+
 /* psys_reset */
 #define PSYS_RESET_ALL                 1
 #define PSYS_RESET_DEPSGRAPH   2
index 54d750db3aff0d4228da1b40ba87ff982985cd98..7e5a6a3c01c2bca23ce7fcffa38290539ea66990 100644 (file)
@@ -40,13 +40,10 @@ struct StrokeCache;
 typedef struct SculptSession {
        struct ProjVert *projverts;
 
-       /* An array of lists; array is sized as
-          large as the number of verts in the mesh,
-          the list for each vert contains the index
-          for all the faces that use that vertex */
-       struct ListBase *vertex_users;
-       struct IndexNode *vertex_users_mem;
-       int vertex_users_size;
+       /* Mesh connectivity */
+       struct ListBase *fmap;
+       struct IndexNode *fmap_mem;
+       int fmap_size;
 
        /* Used temporarily per-stroke */
        float *vertexcosnos;
@@ -54,7 +51,7 @@ typedef struct SculptSession {
        ListBase damaged_verts;
        
        /* Used to cache the render of the active texture */
-       unsigned int texcache_w, texcache_h, *texcache;
+       unsigned int texcache_side, *texcache, texcache_actual;
 
        void *cursor; /* wm handle */
 
@@ -66,6 +63,5 @@ typedef struct SculptSession {
 } SculptSession;
 
 void sculptsession_free(struct Sculpt *sculpt);
-void sculpt_vertexusers_free(struct SculptSession *ss);
 
 #endif
index 94eb8e0495feba05dcb94e3d83ea19ddbc2722e8..5bf0e84c7c46aa9db62224a7a51ea73c13772bc8 100644 (file)
@@ -137,7 +137,7 @@ struct SeqEffectHandle {
 /* sequence.c */
 
 // extern
-void seq_free_sequence(struct Sequence *seq);
+void seq_free_sequence(struct Editing *ed, struct Sequence *seq);
 void seq_free_strip(struct Strip *strip);
 void seq_free_editing(struct Editing *ed);
 char *give_seqname(struct Sequence *seq);
@@ -161,8 +161,24 @@ void update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_s
 /* seqeffects.c */
 // intern?
 struct SeqEffectHandle get_sequence_blend(struct Sequence *seq);
-void sequence_effect_speed_rebuild_map(struct Scene *scene, struct Sequence *seq, int force);
+void sequence_effect_speed_rebuild_map(struct Sequence *seq, int force);
 
 // extern
 struct SeqEffectHandle get_sequence_effect(struct Sequence *seq);
 int get_sequence_effect_num_inputs(int seq_type);
+
+/* for transform but also could use elsewhere */
+int seq_tx_get_start(struct Sequence *seq);
+int seq_tx_get_end(struct Sequence *seq);
+int seq_tx_get_final_left(struct Sequence *seq, int metaclip);
+int seq_tx_get_final_right(struct Sequence *seq, int metaclip);
+void seq_tx_set_final_left(struct Sequence *seq, int val);
+void seq_tx_set_final_right(struct Sequence *seq, int val);
+void seq_tx_handle_xlimits(struct Sequence *seq, int leftflag, int rightflag);
+int seq_tx_test(struct Sequence * seq);
+int check_single_seq(struct Sequence *seq);
+void fix_single_seq(struct Sequence *seq);
+int seq_test_overlap(struct ListBase * seqbasep, struct Sequence *test);
+int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test);
+void free_imbuf_seq(struct ListBase * seqbasep);
+
index 3948a2bf2afd388955d2d961f3cfb01305ed4f06..46153b928aa75cc499d4ef50c89858d645d1da44 100644 (file)
@@ -56,18 +56,12 @@ IF(WITH_FFMPEG)
   ADD_DEFINITIONS(-DWITH_FFMPEG)
 ENDIF(WITH_FFMPEG)
 
-IF(WITH_PLAYER)
-  SUBDIRS(bad_level_call_stubs)
-ENDIF(WITH_PLAYER)
-
 IF(WITH_PYTHON)
   SET(INC ${INC} ../python ${PYTHON_INC})
 ELSE(WITH_PYTHON)
   ADD_DEFINITIONS(-DDISABLE_PYTHON)
 ENDIF(WITH_PYTHON)
 
-BLENDERLIB(bf_blenkernel "${SRC}" "${INC}")
-
 IF(WITH_INTERNATIONAL)
    ADD_DEFINITIONS(-DWITH_FREETYPE2)
 ENDIF(WITH_INTERNATIONAL)
@@ -75,3 +69,10 @@ ENDIF(WITH_INTERNATIONAL)
 IF(NOT WITH_ELBEEM)
   ADD_DEFINITIONS(-DDISABLE_ELBEEM)
 ENDIF(NOT WITH_ELBEEM)
+
+IF(WIN32)
+  SET(INC ${INC} ${PTHREADS_INC})
+ENDIF(WIN32)
+
+BLENDERLIB(bf_blenkernel "${SRC}" "${INC}")
+
index aae4addd71ee713a6897fe2c80f68b324ce3d184..cb0c60fb1f14f8ec7d7471d283f8655234f44f23 100644 (file)
@@ -35,6 +35,9 @@ if env['WITH_BF_INTERNATIONAL']:
 if env['WITH_BF_OPENEXR']:
     defs += ' WITH_OPENEXR'
 
+if env['WITH_BF_OPENJPEG']:
+    defs += ' WITH_OPENJPEG'
+
 if env['WITH_BF_DDS']:
     defs += ' WITH_DDS'
 
@@ -46,10 +49,13 @@ if env['WITH_BF_QUICKTIME']:
     defs += ' WITH_QUICKTIME'
     incs += ' ' + env['BF_QUICKTIME_INC']
 
+if env['WITH_BF_BULLET']:
+    defs += ' WITH_BULLET'
+
 if env['BF_NO_ELBEEM']:
     defs += ' DISABLE_ELBEEM'
 
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
     incs += ' ' + env['BF_PTHREADS_INC']
 
-env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = Split(defs), libtype=['core'], priority = [155] )
+env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = Split(defs), libtype=['core'], priority = [165] )
index 58bd4b59181f80a71f42cf9e173f0898f0844b7c..1e332bcf393ea335d328ce375c7d264f8e5163f0 100644 (file)
@@ -427,8 +427,9 @@ void BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td, EditMesh *em) {
                                efa->f |= SELECT;
                        }
                        if(f->flag & ME_HIDE) efa->h= 1;
-                       if((G.f & G_FACESELECT) && (efa->f & SELECT))
-                               ; //XXX EM_select_face(efa, 1); /* flush down */
+                       // XXX flag depricated
+                       // if((G.f & G_FACESELECT) && (efa->f & SELECT))
+                               //XXX EM_select_face(efa, 1); /* flush down */
                        CustomData_em_copy_data(&bm->pdata, &em->fdata, f->data, &efa->data);
                        BME_loops_to_corners(bm, &em->fdata, efa->data, f,numCol,numTex);
                }
index e9d0fc7c95a6ae8bf9080452a2bf5818a1afbf35..8c71a1d807ead12d4f33394fa74b58d589a4deb9 100644 (file)
@@ -991,7 +991,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
        
        /* in par the family name is stored, use this to find the other objects */
        
-       chartransdata= text_to_curve(scene, par, FO_DUPLI);
+       chartransdata= BKE_text_to_curve(scene, par, FO_DUPLI);
        if(chartransdata==0) return;
        
        memset(obar, 0, 256*sizeof(void *));
index fb2a9731a40090839b66eee1e330a92f25540040..30e5daeeb3b99e2aef36468c04ac808341b3fd2f 100644 (file)
@@ -86,7 +86,10 @@ AnimData *BKE_id_add_animdata (ID *id)
        if (id_has_animdata(id)) {
                IdAdtTemplate *iat= (IdAdtTemplate *)id;
                
-               iat->adt= MEM_callocN(sizeof(AnimData), "AnimData");
+               /* check if there's already AnimData, in which case, don't add */
+               if (iat->adt == NULL)
+                       iat->adt= MEM_callocN(sizeof(AnimData), "AnimData");
+               
                return iat->adt;
        }
        else 
@@ -232,7 +235,8 @@ static void animsys_execute_fcurve (PointerRNA *ptr, AnimMapper *remap, FCurve *
        free_path= animsys_remap_path(remap, fcu->rna_path, &path);
        
        /* write value to setting */
-       animsys_write_rna_setting(ptr, path, fcu->array_index, fcu->curval);
+       if (path)
+               animsys_write_rna_setting(ptr, path, fcu->array_index, fcu->curval);
        
        /* free temp path-info */
        if (free_path)
@@ -586,7 +590,7 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re
         *        or be layered on top of existing animation data.
         *      - Drivers should be in the appropriate order to be evaluated without problems...
         */
-       if ((recalc & ADT_RECALC_DRIVERS) && (adt->recalc & ADT_RECALC_DRIVERS))
+       if ((recalc & ADT_RECALC_DRIVERS) /*&& (adt->recalc & ADT_RECALC_DRIVERS)*/) // XXX for now, don't check yet, as depsgraph hasn't been updated
        {
                animsys_evaluate_drivers(&id_ptr, adt, ctime);
        }
@@ -615,7 +619,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
 {
        ID *id;
        
-       //printf("Evaluate all animation - %f \n", ctime);
+       printf("Evaluate all animation - %f \n", ctime);
 
        /* macro for less typing */
 #define EVAL_ANIM_IDS(first) \
@@ -640,7 +644,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
        EVAL_ANIM_IDS(main->camera.first);
        
        /* shapekeys */
-       // TODO...
+       EVAL_ANIM_IDS(main->key.first);
        
        /* curves */
        // TODO...
index ae18a75daa0c20a35f2a115e91961bfcfa6a8044..2ad0c98bb79bb127e1f9017c85a7ce501551edfc 100644 (file)
@@ -74,6 +74,7 @@
 #include "BKE_font.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
+#include "BKE_ipo.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
 #include "BKE_object.h"
@@ -371,12 +372,12 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
                //setscreen(G.curscreen);
        }
        
+       // XXX is this in the right place?
+       do_versions_ipos_to_animato(G.main); // XXX fixme... complicated versionpatching
+       
        /* baseflags, groups, make depsgraph, etc */
        set_scene_bg(CTX_data_scene(C));
 
-       /* clear BONE_UNKEYED flags, these are not valid anymore for proxies */
-       framechange_poses_clear_unkeyed();
-
        /* last stage of do_versions actually, that sets recalc flags for recalc poses */
        for(ob= G.main->object.first; ob; ob= ob->id.next) {
                if(ob->type==OB_ARMATURE)
index cd5eb2eb3d30017d82f19c5f7d582d51a8215fd4..804b14b66b168ceb9280318d0847dc6b08b5e0c0 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include <math.h>
+#include <string.h>
 
 #include "MEM_guardedalloc.h"
 
@@ -36,6 +37,9 @@
 #include "DNA_image_types.h"
 #include "DNA_texture_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "RNA_access.h"
 
 #include "BLI_arithb.h"
 #include "BLI_blenlib.h"
@@ -43,6 +47,7 @@
 #include "BKE_brush.h"
 #include "BKE_colortools.h"
 #include "BKE_global.h"
+#include "BKE_image.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_texture.h"
@@ -52,6 +57,7 @@
 #include "IMB_imbuf_types.h"
 
 #include "RE_render_ext.h" /* externtex */
+#include "RE_shader_ext.h"
 
 /* Datablock add/copy/free/make_local */
 
@@ -935,4 +941,123 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
        return totpaintops;
 }
 
+/* Uses the brush curve control to find a strength value between 0 and 1 */
+float brush_curve_strength(Brush *br, float p, const float len)
+{
+       if(p > len) p= len;
+       return curvemapping_evaluateF(br->curve, 0, p/len);
+}
+
+/* TODO: should probably be unified with BrushPainter stuff? */
+unsigned int *brush_gen_texture_cache(Brush *br, int half_side)
+{
+       unsigned int *texcache = NULL;
+       MTex *mtex = br->mtex[br->texact];
+       TexResult texres;
+       int hasrgb, ix, iy;
+       int side = half_side * 2;
+
+       memset(&texres, 0, sizeof(TexResult));
+       
+       if(mtex && mtex->tex) {
+               float x, y, step = 2.0 / side, co[3];
+
+               texcache = MEM_callocN(sizeof(int) * side * side, "Brush texture cache");
+
+               BKE_image_get_ibuf(mtex->tex->ima, NULL);
+               
+               /*do normalized cannonical view coords for texture*/
+               for (y=-1.0, iy=0; iy<side; iy++, y += step) {
+                       for (x=-1.0, ix=0; ix<side; ix++, x += step) {
+                               co[0]= x;
+                               co[1]= y;
+                               co[2]= 0.0f;
+                               
+                               /* This is copied from displace modifier code */
+                               hasrgb = multitex_ext(mtex->tex, co, NULL, NULL, 1, &texres);
+                       
+                               /* if the texture gave an RGB value, we assume it didn't give a valid
+                                * intensity, so calculate one (formula from do_material_tex).
+                                * if the texture didn't give an RGB value, copy the intensity across
+                                */
+                               if(hasrgb & TEX_RGB)
+                                       texres.tin = (0.35 * texres.tr + 0.45 *
+                                                     texres.tg + 0.2 * texres.tb);
+
+                               texres.tin = texres.tin * 255.0;
+                               ((char*)texcache)[(iy*side+ix)*4] = (char)texres.tin;
+                               ((char*)texcache)[(iy*side+ix)*4+1] = (char)texres.tin;
+                               ((char*)texcache)[(iy*side+ix)*4+2] = (char)texres.tin;
+                               ((char*)texcache)[(iy*side+ix)*4+3] = (char)texres.tin;
+                       }
+               }
+       }
+
+       return texcache;
+}
+
+/**** Radial Control ****/
+static struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
+{
+       ImBuf *im = MEM_callocN(sizeof(ImBuf), "radial control texture");
+       unsigned int *texcache;
+       int side = 128;
+       int half = side / 2;
+       int i, j;
+
+       texcache = brush_gen_texture_cache(br, half);
+       im->rect_float = MEM_callocN(sizeof(float) * side * side, "radial control rect");
+       im->x = im->y = side;
+
+       for(i=0; i<side; ++i) {
+               for(j=0; j<side; ++j) {
+                       float magn= sqrt(pow(i - half, 2) + pow(j - half, 2));
+                       im->rect_float[i*side + j]= brush_curve_strength(br, magn, half);
+               }
+       }
+
+       /* Modulate curve with texture */
+       if(texcache) {
+               for(i=0; i<side; ++i)
+                       for(j=0; j<side; ++j) {
+                               const int col= texcache[i*side+j];
+                               im->rect_float[i*side+j]*= (((char*)&col)[0]+((char*)&col)[1]+((char*)&col)[2])/3.0f/255.0f;
+                       }
+       }
+
+       MEM_freeN(texcache);
 
+       return im;
+}
+
+void brush_radial_control_invoke(wmOperator *op, Brush *br)
+{
+       int mode = RNA_int_get(op->ptr, "mode");
+       float original_value;
+
+       if(mode == WM_RADIALCONTROL_SIZE)
+               original_value = br->size;
+       else if(mode == WM_RADIALCONTROL_STRENGTH)
+               original_value = br->alpha;
+       else if(mode == WM_RADIALCONTROL_ANGLE)
+               original_value = br->rot;
+
+       RNA_float_set(op->ptr, "initial_value", original_value);
+       op->customdata = brush_gen_radial_control_imbuf(br);
+}
+
+int brush_radial_control_exec(wmOperator *op, Brush *br)
+{
+       int mode = RNA_int_get(op->ptr, "mode");
+       float new_value = RNA_float_get(op->ptr, "new_value");
+       const float conv = 0.017453293;
+
+       if(mode == WM_RADIALCONTROL_SIZE)
+               br->size = new_value;
+       else if(mode == WM_RADIALCONTROL_STRENGTH)
+               br->alpha = new_value;
+       else if(mode == WM_RADIALCONTROL_ANGLE)
+               br->rot = new_value * conv;
+
+       return OPERATOR_FINISHED;
+}
index 9e57fef41f7368f76df189d1398064996d1c22c1..c122145c98fff64eca077cfbb687e202117ac1b0 100644 (file)
@@ -1237,7 +1237,7 @@ int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModifierDat
                                                if(out_normalVelocity < 0.0)
                                                {
                                                        out_normalVelocity*= -1.0;
-                                                       VecMulf(out_normal, -1.0);
+                                                       VecNegf(out_normal);
                                                }
 */
                                                /* Inelastic repulsion impulse. */
index f5613a347000fb556f455d3a8da9a4835e395e6f..912bc7ab3bd9e87b5dd4f082f55f59545139bf20 100644 (file)
@@ -898,7 +898,7 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
                n[2] = 1.0;
        }
        if (axis > 2) axis -= 3;
-       else VecMulf(n,-1);
+       else VecNegf(n);
 
        /* n specifies the transformation of the track axis */
        if (flags & TARGET_Z_UP) { 
@@ -2039,7 +2039,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        Projf(vec2, vec, cob->matrix[0]);
                                        VecSubf(totmat[1], vec, vec2);
                                        Normalize(totmat[1]);
-                                       VecMulf(totmat[1],-1);
+                                       VecNegf(totmat[1]);
                                        
                                        /* the x axis is fixed */
                                        totmat[0][0] = cob->matrix[0][0];
@@ -2057,7 +2057,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        Projf(vec2, vec, cob->matrix[0]);
                                        VecSubf(totmat[2], vec, vec2);
                                        Normalize(totmat[2]);
-                                       VecMulf(totmat[2],-1);
+                                       VecNegf(totmat[2]);
                                                
                                        /* the x axis is fixed */
                                        totmat[0][0] = cob->matrix[0][0];
@@ -2122,7 +2122,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        Projf(vec2, vec, cob->matrix[1]);
                                        VecSubf(totmat[0], vec, vec2);
                                        Normalize(totmat[0]);
-                                       VecMulf(totmat[0],-1);
+                                       VecNegf(totmat[0]);
                                        
                                        /* the y axis is fixed */
                                        totmat[1][0] = cob->matrix[1][0];
@@ -2140,7 +2140,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        Projf(vec2, vec, cob->matrix[1]);
                                        VecSubf(totmat[2], vec, vec2);
                                        Normalize(totmat[2]);
-                                       VecMulf(totmat[2],-1);
+                                       VecNegf(totmat[2]);
                                        
                                        /* the y axis is fixed */
                                        totmat[1][0] = cob->matrix[1][0];
@@ -2205,7 +2205,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        Projf(vec2, vec, cob->matrix[2]);
                                        VecSubf(totmat[0], vec, vec2);
                                        Normalize(totmat[0]);
-                                       VecMulf(totmat[0],-1);
+                                       VecNegf(totmat[0]);
                                        
                                        /* the z axis is fixed */
                                        totmat[2][0] = cob->matrix[2][0];
@@ -2223,7 +2223,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
                                        Projf(vec2, vec, cob->matrix[2]);
                                        VecSubf(totmat[1], vec, vec2);
                                        Normalize(totmat[1]);
-                                       VecMulf(totmat[1],-1);
+                                       VecNegf(totmat[1]);
                                        
                                        /* the z axis is fixed */
                                        totmat[2][0] = cob->matrix[2][0];
index 81712acee5c574caf453f812924d2dc0ec8435e2..2a24e5a9d0fd6df2991c494a8a27e949503954d6 100644 (file)
@@ -197,6 +197,10 @@ struct uiBlock *CTX_wm_ui_block(const bContext *C)
 void CTX_wm_manager_set(bContext *C, wmWindowManager *wm)
 {
        C->wm.manager= wm;
+       C->wm.window= NULL;
+       C->wm.screen= NULL;
+       C->wm.area= NULL;
+       C->wm.region= NULL;
 }
 
 void CTX_wm_window_set(bContext *C, wmWindow *win)
@@ -204,17 +208,22 @@ void CTX_wm_window_set(bContext *C, wmWindow *win)
        C->wm.window= win;
        C->wm.screen= (win)? win->screen: NULL;
        C->data.scene= (C->wm.screen)? C->wm.screen->scene: NULL;
+       C->wm.area= NULL;
+       C->wm.region= NULL;
 }
 
 void CTX_wm_screen_set(bContext *C, bScreen *screen)
 {
        C->wm.screen= screen;
        C->data.scene= (C->wm.screen)? C->wm.screen->scene: NULL;
+       C->wm.area= NULL;
+       C->wm.region= NULL;
 }
 
 void CTX_wm_area_set(bContext *C, ScrArea *area)
 {
        C->wm.area= area;
+       C->wm.region= NULL;
 }
 
 void CTX_wm_region_set(bContext *C, ARegion *region)
index 91189fc7d3af698c313b128f617f2a71be779412..2e0347870ccf9a2f642919d01f270a972e19dad2 100644 (file)
@@ -56,6 +56,7 @@
 #include "BKE_anim.h"  
 #include "BKE_curve.h"  
 #include "BKE_displist.h"  
+#include "BKE_font.h" 
 #include "BKE_global.h" 
 #include "BKE_key.h"  
 #include "BKE_library.h"  
@@ -86,14 +87,32 @@ void unlink_curve(Curve *cu)
        cu->key= 0;
 }
 
+/* frees editcurve entirely */
+void BKE_free_editfont(Curve *cu)
+{
+       if(cu->editfont) {
+               EditFont *ef= cu->editfont;
+               
+               if(ef->oldstr) MEM_freeN(ef->oldstr);
+               if(ef->oldstrinfo) MEM_freeN(ef->oldstrinfo);
+               if(ef->textbuf) MEM_freeN(ef->textbuf);
+               if(ef->textbufinfo) MEM_freeN(ef->textbufinfo);
+               if(ef->copybuf) MEM_freeN(ef->copybuf);
+               if(ef->copybufinfo) MEM_freeN(ef->copybufinfo);
+               
+               MEM_freeN(ef);
+               cu->editfont= NULL;
+       }
+}
 
-/* niet curve zelf vrijgeven */
+/* don't free curve itself */
 void free_curve(Curve *cu)
 {
 
        freeNurblist(&cu->nurb);
        BLI_freelistN(&cu->bev);
        freedisplist(&cu->disp);
+       BKE_free_editfont(cu);
        
        if(cu->editnurb) {
                freeNurblist(cu->editnurb);
@@ -131,6 +150,18 @@ Curve *add_curve(char *name, int type)
        
        cu->bb= unit_boundbox();
        
+       if(type==OB_FONT) {
+               cu->vfont= cu->vfontb= cu->vfonti= cu->vfontbi= get_builtin_font();
+               cu->vfont->id.us+=4;
+               cu->str= MEM_mallocN(12, "str");
+               strcpy(cu->str, "Text");
+               cu->pos= 4;
+               cu->strinfo= MEM_callocN(12*sizeof(CharInfo), "strinfo");
+               cu->totbox= cu->actbox= 1;
+               cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox");
+               cu->tb[0].w = cu->tb[0].h = 0.0;
+       }
+       
        return cu;
 }
 
index 57dca4ddcb570cf6689ca66afaacb5b9a7945dec..4f083c4bf9b5f93c364d93a8d6c6e8a096b8e897 100644 (file)
@@ -303,50 +303,66 @@ DagForest * dag_init()
        return forest;
 }
 
-static void dag_add_driver_relation(Ipo *ipo, DagForest *dag, DagNode *node, int isdata)
+/* isdata = object data... */
+// XXX this needs to be extended to be more flexible (so that not only objects are evaluated via depsgraph)...
+static void dag_add_driver_relation(AnimData *adt, DagForest *dag, DagNode *node, int isdata)
 {
-       IpoCurve *icu;
+       FCurve *fcu;
        DagNode *node1;
        
-       for(icu= ipo->curve.first; icu; icu= icu->next) {
-               if(icu->driver) {
-
-                       if (icu->driver->type == IPO_DRIVER_TYPE_PYTHON) {
-
-                               if ((icu->driver->flag & IPO_DRIVER_FLAG_INVALID) || (icu->driver->name[0] == '\0'))
-                                       continue; /* empty or invalid expression */
+       for (fcu= adt->drivers.first; fcu; fcu= fcu->next) {
+               ChannelDriver *driver= fcu->driver;
+               
+               if (driver->type == DRIVER_TYPE_PYTHON) {
+                       /* PyDriver / 'Expression' */
+                       
+                       /* skip if invalid in some way */
+                       if ((driver->flag & DRIVER_FLAG_INVALID) || (driver->expression[0] == '\0'))
+                               continue;
 #ifndef DISABLE_PYTHON
-                               else {
-                                       /* now we need refs to all objects mentioned in this
-                                        * pydriver expression, to call 'dag_add_relation'
-                                        * for each of them */
-                                       Object **obarray = BPY_pydriver_get_objects(icu->driver);
-                                       if (obarray) {
-                                               Object *ob, **oba = obarray;
-
-                                               while (*oba) {
-                                                       ob = *oba;
-                                                       node1 = dag_get_node(dag, ob);
-                                                       if (ob->type == OB_ARMATURE)
-                                                               dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Python Ipo Driver");
-                                                       else
-                                                               dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Python Ipo Driver");
-                                                       oba++;
-                                               }
-
-                                               MEM_freeN(obarray);
+                       else {
+                               /* now we need refs to all objects mentioned in this
+                                * pydriver expression, to call 'dag_add_relation'
+                                * for each of them */
+                               Object **obarray = BPY_pydriver_get_objects(fcu->driver);
+                               if (obarray) {
+                                       Object *ob, **oba = obarray;
+                                       
+                                       while (*oba) {
+                                               ob = *oba;
+                                               node1 = dag_get_node(dag, ob);
+                                               if (ob->type == OB_ARMATURE)
+                                                       dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Python Driver");
+                                               else
+                                                       dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Python Driver");
+                                               oba++;
                                        }
+                                       
+                                       MEM_freeN(obarray);
                                }
-#endif /* DISABLE_PYTHON */
-                       }
-                       else if (icu->driver->ob) {
-                               node1 = dag_get_node(dag, icu->driver->ob);
-                               if(icu->driver->blocktype==ID_AR)
-                                       dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Ipo Driver");
-                               else
-                                       dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Ipo Driver");
                        }
+#endif /* DISABLE_PYTHON */
+               }
+               else if (driver->type == DRIVER_TYPE_ROTDIFF) {
+                       // XXX rotational difference 
+               }
+               else if (driver->id) {
+                       /* normal channel-drives-channel */
+                       node1 = dag_get_node(dag, driver->id);  // XXX we assume that id is an object...
+                       
+                       // XXX what happens for bone drivers?
+                       dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Ipo Driver");
                }
+#if 0 // XXX old 'normal' type
+
+               else if (icu->driver->ob) {
+                       node1 = dag_get_node(dag, icu->driver->ob);
+                       if(icu->driver->blocktype==ID_AR)
+                               dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Ipo Driver");
+                       else
+                               dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Ipo Driver");
+               }
+#endif // XXX old 'normal' type
        }
 }
 
@@ -371,7 +387,6 @@ static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Objec
 static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, Object *ob, int mask)
 {
        bConstraint *con;
-       bConstraintChannel *conchan;
        DagNode * node;
        DagNode * node2;
        DagNode * node3;
@@ -426,6 +441,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
        }
        
        /* driver dependencies, nla modifiers */
+#if 0 // XXX old animation system
        if(ob->ipo) 
                dag_add_driver_relation(ob->ipo, dag, node, 0);
        
@@ -466,6 +482,14 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                        }
                }
        }
+#endif // XXX old animation system
+       if (ob->adt)
+               dag_add_driver_relation(ob->adt, dag, node, (ob->type == OB_ARMATURE)); // XXX isdata arg here doesn't give an accurate picture of situation
+               
+       key= ob_get_key(ob);
+       if (key && key->adt)
+               dag_add_driver_relation(key->adt, dag, node, 1);
+
        if (ob->modifiers.first) {
                ModifierData *md;
                
@@ -515,11 +539,12 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Proxy");
                /* inverted relation, so addtoroot shouldn't be set to zero */
        }
+       
+
        if (ob->type==OB_CAMERA) {
                Camera *cam = (Camera *)ob->data;
-               if (cam->ipo) {
-                       dag_add_driver_relation(cam->ipo, dag, node, 1);
-               }
+               if (cam->adt)
+                       dag_add_driver_relation(cam->adt, dag, node, 1);
                if (cam->dof_ob) {
                        node2 = dag_get_node(dag, cam->dof_ob);
                        dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Camera DoF");
@@ -527,10 +552,10 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
        }
        if (ob->type==OB_LAMP) {
                Lamp *la = (Lamp *)ob->data;
-               if (la->ipo) {
-                       dag_add_driver_relation(la->ipo, dag, node, 1);
-               }
+               if (la->adt)
+                       dag_add_driver_relation(la->adt, dag, node, 1);
        }
+       
        if (ob->transflag & OB_DUPLI) {
                if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
                        GroupObject *go;
@@ -566,9 +591,8 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                        node2 = dag_get_node(dag, cu->taperobj);
                        dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
                }
-               if(cu->ipo)
-                       dag_add_driver_relation(cu->ipo, dag, node, 1);
-
+               if (cu->adt)
+                       dag_add_driver_relation(cu->adt, dag, node, 1);
        }
        else if(ob->type==OB_FONT) {
                Curve *cu= ob->data;
@@ -1953,24 +1977,6 @@ static int object_modifiers_use_time(Object *ob)
        return 0;
 }
 
-#if 0 // XXX old animation system
-static int exists_channel(Object *ob, char *name)
-{
-       bActionStrip *strip;
-       
-       if(ob->action)
-               if(get_action_channel(ob->action, name))
-                       return 1;
-       
-       for (strip=ob->nlastrips.first; strip; strip=strip->next)
-               if(get_action_channel(strip->act, name))
-                       return 1;
-
-       return 0;
-}
-#endif // XXX old animation system
-
-
 static short animdata_use_time(AnimData *adt)
 {
        NlaTrack *nlt;
@@ -2023,14 +2029,8 @@ static void dag_object_time_update_flags(Object *ob)
        }
        
 #if 0 // XXX old animation system
-       if(ob->action || ob->nlastrips.first) {
-               /* since actions now are mixed, we set the recalcs on the safe side */
-               ob->recalc |= OB_RECALC_OB;
-               if(ob->type==OB_ARMATURE)
-                       ob->recalc |= OB_RECALC_DATA;
-               else if(exists_channel(ob, "Shape"))
-                       ob->recalc |= OB_RECALC_DATA;
-               else if(ob->dup_group) {
+       if(ob->nlastrips.first) {
+               if(ob->dup_group) {
                        bActionStrip *strip;
                        /* this case is for groups with nla, whilst nla target has no action or nla */
                        for(strip= ob->nlastrips.first; strip; strip= strip->next) {
@@ -2041,6 +2041,7 @@ static void dag_object_time_update_flags(Object *ob)
        }
 #endif // XXX old animation system
        if(animdata_use_time(ob->adt)) ob->recalc |= OB_RECALC;
+       if((ob->adt) && (ob->type==OB_ARMATURE)) ob->recalc |= OB_RECALC_DATA;
        
        if(object_modifiers_use_time(ob)) ob->recalc |= OB_RECALC_DATA;
        if((ob->pose) && (ob->pose->flag & POSE_CONSTRAINTS_TIMEDEPEND)) ob->recalc |= OB_RECALC_DATA;
@@ -2316,6 +2317,7 @@ void DAG_pose_sort(Object *ob)
                        ListBase targets = {NULL, NULL};
                        bConstraintTarget *ct;
                        
+#if 0 // XXX old animation system... driver stuff to watch out for
                        if(con->ipo) {
                                IpoCurve *icu;
                                for(icu= con->ipo->curve.first; icu; icu= icu->next) {
@@ -2327,7 +2329,7 @@ void DAG_pose_sort(Object *ob)
                                                if(target) {
                                                        node2 = dag_get_node(dag, target);
                                                        dag_add_relation(dag, node2, node, 0, "Ipo Driver");
-
+                                                       
                                                        /* uncommented this line, results in dependencies
                                                         * not being added properly for this constraint,
                                                         * what is the purpose of this? - brecht */
@@ -2336,6 +2338,7 @@ void DAG_pose_sort(Object *ob)
                                        }
                                }
                        }
+#endif // XXX old animation system... driver stuff to watch out for
                        
                        if (cti && cti->get_constraint_targets) {
                                cti->get_constraint_targets(con, &targets);
index 952c49ea12a5cf7cea83ed847dfdc41c54a7a1c7..645f468d250f91af8df998bc52fec81ba5959664 100644 (file)
@@ -1477,7 +1477,7 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
                if(cu->path) free_path(cu->path);
                cu->path= NULL;
                
-               if(ob->type==OB_FONT) text_to_curve(scene, ob, 0);
+               if(ob->type==OB_FONT) BKE_text_to_curve(scene, ob, 0);
                
                if(!forOrco) curve_calc_modifiers_pre(scene, ob, 0, &originalVerts, &deformedVerts, &numVerts);
 
index 6c959f2190e9027a205d630bcf70442b97a99454..5217464c2c9327627667e34e9c58258d82283b8b 100644 (file)
@@ -86,7 +86,6 @@
 #ifndef DISABLE_ELBEEM
 #include "DNA_object_fluidsim.h"
 #include "LBM_fluidsim.h"
-#include "elbeem.h"
 #include <zlib.h>
 #include <string.h>
 #endif // DISABLE_ELBEEM
@@ -253,7 +252,7 @@ static float eff_calc_visibility(Scene *scene, Object *ob, float *co, float *dir
                return 0;
        
        VECCOPY(norm, dir);
-       VecMulf(norm, -1.0);
+       VecNegf(norm);
        len = Normalize(norm);
        
        // check all collision objects
index 9c5d67660baef0e79d116b300889d249e6df451a..249d3db942328353abab3784b6d096b2a4b4de96 100644 (file)
@@ -2387,7 +2387,7 @@ void write_stl(Scene *scene, char *str)
 
 static void write_videoscape_mesh(Scene *scene, Object *ob, char *str)
 {
-       Mesh *me;
+       Mesh *me= ob->data;
        EditMesh *em = me->edit_mesh;
        Material *ma;
        MFace *mface;
index f547b483092346bcc241f366dd738a5fec3f3d4a..56f0b53c16df4a0c6cddcf3d6836535e90c59379 100644 (file)
@@ -1190,7 +1190,7 @@ static void fcm_cycles_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, flo
                        cycles= data->after_cycles;
                }
        }
-       if ELEM3(0, side, mode, cycles)
+       if ELEM(0, side, mode)
                return;
                
        /* extrapolation mode is 'cyclic' - find relative place within a cycle */
@@ -1209,7 +1209,12 @@ static void fcm_cycles_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, flo
                if (cycdx == 0)
                        return;
                /* check that cyclic is still enabled for the specified time */
-               if ( ((float)side * (evaltime - ofs) / cycdx) > cycles )
+               if (cycles == 0) {
+                       /* catch this case so that we don't exit when we have cycles=0
+                        * as this indicates infinite cycles...
+                        */
+               }
+               else if ( ((float)side * (evaltime - ofs) / cycdx) > cycles )
                        return;
                
                
@@ -1407,10 +1412,13 @@ FModifier *fcurve_add_modifier (FCurve *fcu, int type)
                return NULL;
        }
        
-       /* add modifier data */
+       /* add modifier itself */
        fcm= MEM_callocN(sizeof(FModifier), "F-Curve Modifier");
        BLI_addtail(&fcu->modifiers, fcm);
        
+       /* add modifier's data */
+       fcm->data= MEM_callocN(fmi->size, "F-Curve Modifier Data");
+               
        /* init custom settings if necessary */
        if (fmi->new_data)      
                fmi->new_data(fcm->data);
@@ -1447,16 +1455,25 @@ void fcurve_remove_modifier (FCurve *fcu, FModifier *fcm)
 {
        FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm);
        
-       /* sanity checks */
-       if ELEM3(NULL, fcu, fcm, fmi)
+       /* sanity check */
+       if (fcm == NULL)
                return;
-               
-       /* free modifier's special data */
-       if (fmi->free_data)
+       
+       /* free modifier's special data (stored inside fcm->data) */
+       if (fmi && fmi->free_data)
                fmi->free_data(fcm);
+               
+       /* free modifier's data (fcm->data) */
+       MEM_freeN(fcm->data);
        
        /* remove modifier from stack */
-       BLI_freelinkN(&fcu->modifiers, fcm);
+       if (fcu)
+               BLI_freelinkN(&fcu->modifiers, fcm);
+       else {
+               // XXX