merged 30707:31141 from trunk
authorMike Erwin <significant.bit@gmail.com>
Sat, 7 Aug 2010 12:51:51 +0000 (12:51 +0000)
committerMike Erwin <significant.bit@gmail.com>
Sat, 7 Aug 2010 12:51:51 +0000 (12:51 +0000)
506 files changed:
CMakeLists.txt
Makefile
SConstruct
build_files/cmake/macros.cmake
build_files/make/nan_compile.mk
build_files/make/nan_definitions.mk
build_files/make/nan_link.mk
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
extern/CMakeLists.txt
intern/CMakeLists.txt
intern/audaspace/intern/AUD_IReader.h
intern/audaspace/intern/AUD_StreamBufferFactory.cpp
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/smoke/extern/smoke_API.h
intern/smoke/intern/FLUID_3D.cpp
intern/smoke/intern/FLUID_3D.h
intern/smoke/intern/smoke_API.cpp
po/Makefile
release/Makefile
release/bin/.blender/.Blanguages [moved from bin/.blender/.Blanguages with 100% similarity]
release/bin/.blender/.bfont.ttf [moved from bin/.blender/.bfont.ttf with 100% similarity]
release/bin/blender-thumbnailer.py [moved from bin/blender-thumbnailer.py with 100% similarity]
release/scripts/io/engine_render_pov.py [deleted file]
release/scripts/io/export_3ds.py
release/scripts/io/export_fbx.py
release/scripts/io/export_mdd.py
release/scripts/io/export_obj.py
release/scripts/io/export_ply.py
release/scripts/io/export_x3d.py
release/scripts/io/import_anim_bvh.py
release/scripts/io/import_scene_3ds.py
release/scripts/io/import_scene_obj.py
release/scripts/io/import_shape_mdd.py
release/scripts/io/netrender/__init__.py
release/scripts/io/netrender/client.py
release/scripts/io/netrender/operators.py
release/scripts/io/netrender/repath.py [changed mode: 0755->0644]
release/scripts/io/netrender/ui.py
release/scripts/io/netrender/utils.py
release/scripts/modules/bpy/__init__.py
release/scripts/modules/bpy/path.py [new file with mode: 0644]
release/scripts/modules/bpy/utils.py
release/scripts/modules/bpy_types.py
release/scripts/modules/rigify/__init__.py
release/scripts/modules/rna_prop_ui.py
release/scripts/op/add_armature_human.py
release/scripts/op/add_mesh_torus.py
release/scripts/op/console_python.py
release/scripts/op/fcurve_euler_filter.py
release/scripts/op/image.py
release/scripts/op/mesh.py
release/scripts/op/nla.py
release/scripts/op/object.py
release/scripts/op/object_align.py
release/scripts/op/object_randomize_transform.py
release/scripts/op/presets.py
release/scripts/op/screen_play_rendered_anim.py
release/scripts/op/sequencer.py
release/scripts/op/uv.py
release/scripts/op/uvcalc_follow_active.py
release/scripts/op/uvcalc_smart_project.py
release/scripts/op/vertexpaint_dirt.py
release/scripts/op/wm.py
release/scripts/templates/operator.py
release/scripts/templates/operator_modal.py
release/scripts/templates/operator_modal_draw.py
release/scripts/templates/operator_modal_view3d.py
release/scripts/templates/operator_simple.py
release/scripts/templates/operator_uv.py
release/scripts/templates/panel_simple.py
release/scripts/ui/properties_animviz.py
release/scripts/ui/properties_data_armature.py
release/scripts/ui/properties_data_armature_rigify.py
release/scripts/ui/properties_data_bone.py
release/scripts/ui/properties_data_camera.py
release/scripts/ui/properties_data_curve.py
release/scripts/ui/properties_data_empty.py
release/scripts/ui/properties_data_lamp.py
release/scripts/ui/properties_data_lattice.py
release/scripts/ui/properties_data_mesh.py
release/scripts/ui/properties_data_metaball.py
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_game.py
release/scripts/ui/properties_material.py
release/scripts/ui/properties_object.py
release/scripts/ui/properties_object_constraint.py
release/scripts/ui/properties_particle.py
release/scripts/ui/properties_physics_cloth.py
release/scripts/ui/properties_physics_common.py
release/scripts/ui/properties_physics_field.py
release/scripts/ui/properties_physics_fluid.py
release/scripts/ui/properties_physics_smoke.py
release/scripts/ui/properties_physics_softbody.py
release/scripts/ui/properties_render.py
release/scripts/ui/properties_scene.py
release/scripts/ui/properties_texture.py
release/scripts/ui/properties_world.py
release/scripts/ui/space_buttons.py [deleted file]
release/scripts/ui/space_console.py
release/scripts/ui/space_dopesheet.py
release/scripts/ui/space_filebrowser.py
release/scripts/ui/space_graph.py
release/scripts/ui/space_image.py
release/scripts/ui/space_info.py
release/scripts/ui/space_logic.py
release/scripts/ui/space_nla.py
release/scripts/ui/space_node.py
release/scripts/ui/space_outliner.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_text.py
release/scripts/ui/space_time.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_userpref_keymap.py
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
release/text/copyright.txt
release/windows/installer/01.installer.bmp [new file with mode: 0644]
source/Makefile
source/blender/CMakeLists.txt
source/blender/SConscript
source/blender/avi/CMakeLists.txt
source/blender/blenkernel/BKE_anim.h
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_depsgraph.h
source/blender/blenkernel/BKE_displist.h
source/blender/blenkernel/BKE_image.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/BKE_pointcache.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/BKE_texture.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/BME_conversions.c
source/blender/blenkernel/intern/Makefile
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.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/font.c
source/blender/blenkernel/intern/icons.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/world.c
source/blender/blenlib/BLI_math_rotation.h
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/BLI_storage_types.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/math_vector_inline.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/blenpluginapi/CMakeLists.txt
source/blender/collada/DocumentImporter.cpp
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/drivers.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/armature/poseobject.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/datafiles/startup.blend.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_curve.h
source/blender/editors/include/ED_datafiles.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_icons.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_icons.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_group.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/physics/CMakeLists.txt
source/blender/editors/physics/particle_boids.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_ops.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/render/render_preview.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_intern.h
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_file/CMakeLists.txt
source/blender/editors/space_file/Makefile
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/writeimage.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_image/CMakeLists.txt
source/blender/editors/space_image/Makefile
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_stats.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/logic_header.c [deleted file]
source/blender/editors/space_logic/logic_intern.h
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_outliner/outliner.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_text/space_text.c
source/blender/editors/space_text/text_draw.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/drawanimviz.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.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_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_input.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/util/ed_util.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/gpu/GPU_material.h
source/blender/gpu/intern/gpu_material.c
source/blender/gpu/intern/gpu_shader_material.glsl
source/blender/gpu/intern/gpu_shader_material.glsl.c
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/SConscript
source/blender/imbuf/intern/Makefile
source/blender/imbuf/intern/allocimbuf.c
source/blender/imbuf/intern/cineon/CMakeLists.txt
source/blender/imbuf/intern/dds/CMakeLists.txt
source/blender/imbuf/intern/filetype.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/openexr/CMakeLists.txt
source/blender/imbuf/intern/radiance_hdr.c
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/tiff.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/DNA_ID.h
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_constraint_types.h
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_image_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesdna/DNA_smoke_types.h
source/blender/makesdna/DNA_sound_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_wave_types.h [deleted file]
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_define.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/SConscript
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/Makefile
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_animviz.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_boid.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_cloth.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_context.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_lamp.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_sensor.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_smoke.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/makesrna/intern/rna_world.c
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_cast.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_fluidsim.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/modifiers/intern/MOD_shrinkwrap.c
source/blender/modifiers/intern/MOD_simpledeform.c
source/blender/modifiers/intern/MOD_smoke.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c
source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c
source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c
source/blender/nodes/intern/CMP_nodes/CMP_value.c
source/blender/nodes/intern/SHD_nodes/SHD_value.c
source/blender/python/SConscript
source/blender/python/doc/sphinx_doc_gen.py
source/blender/python/generic/bpy_internal_import.c
source/blender/python/generic/bpy_internal_import.h
source/blender/python/generic/mathutils.c
source/blender/python/generic/mathutils.h
source/blender/python/generic/mathutils_quat.c
source/blender/python/generic/mathutils_vector.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_rna.c
source/blender/quicktime/CMakeLists.txt
source/blender/quicktime/apple/Makefile
source/blender/readblenfile/CMakeLists.txt
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/include/renderdatabase.h
source/blender/render/intern/include/texture.h
source/blender/render/intern/raytrace/Makefile
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/pointdensity.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/sss.c
source/blender/render/intern/source/texture.c
source/blender/render/intern/source/volumetric.c
source/blender/render/intern/source/voxeldata.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_operators.c
source/blenderplayer/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/Makefile
source/creator/SConscript
source/creator/creator.c
source/darwin/Makefile
source/gameengine/BlenderRoutines/CMakeLists.txt
source/gameengine/Converter/BL_ArmatureChannel.cpp
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/KX_ConvertControllers.cpp
source/gameengine/Expressions/CMakeLists.txt
source/gameengine/GameLogic/CMakeLists.txt
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GamePlayer/common/CMakeLists.txt
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KXNetwork/CMakeLists.txt
source/gameengine/Ketsji/KX_KetsjiEngine.h
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/Makefile
source/gameengine/Network/CMakeLists.txt
source/gameengine/Network/LoopBackNetwork/CMakeLists.txt
source/gameengine/Physics/Bullet/CMakeLists.txt
source/gameengine/Physics/Dummy/CMakeLists.txt
source/gameengine/Physics/common/CMakeLists.txt
source/gameengine/PyDoc/SConscript [deleted file]
source/gameengine/PyDoc/bge.types.rst
source/gameengine/Rasterizer/CMakeLists.txt
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
source/gameengine/SceneGraph/CMakeLists.txt
source/gameengine/VideoTexture/CMakeLists.txt
source/kernel/CMakeLists.txt

index bec1353a8cf3a16165066210eb5531c9549d8294..87265e959e53e73c7b6400e85f976b556ab48b85 100644 (file)
@@ -69,7 +69,7 @@ OPTION(WITH_INTERNATIONAL "Enable I18N   (International fonts and text)" ON)
 OPTION(WITH_LCMS          "Enable color correction with lcms" OFF)
 OPTION(WITH_PYTHON        "Enable Embedded Python API" ON)
 OPTION(WITH_BUILDINFO     "Include extra build details" ON)
-OPTION(WITH_ELBEEM        "Enable Elbeem (Fluid Simulation)" ON)
+OPTION(WITH_FLUID        "Enable Elbeem (Fluid Simulation)" ON)
 OPTION(WITH_FFTW3         "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
 OPTION(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
 OPTION(WITH_GAMEENGINE    "Enable Game Engine" ON)
@@ -82,10 +82,12 @@ ELSE()
 ENDIF()
 
 # Image format support
-OPTION(WITH_OPENEXR       "Enable OpenEXR Support (http://www.openexr.com)" ON)
-OPTION(WITH_OPENJPEG      "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
-OPTION(WITH_TIFF          "Enable LibTIFF Support" ON)
-OPTION(WITH_DDS           "Enable DDS Support" ON)
+OPTION(WITH_IMAGE_OPENEXR       "Enable OpenEXR Support (http://www.openexr.com)" ON)
+OPTION(WITH_IMAGE_OPENJPEG      "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
+OPTION(WITH_IMAGE_TIFF          "Enable LibTIFF Support" ON)
+OPTION(WITH_IMAGE_DDS           "Enable DDS Image Support" ON)
+OPTION(WITH_IMAGE_CINEON        "Enable CINEON and DPX Image Support" ON)
+OPTION(WITH_IMAGE_HDR           "Enable HDR Image Support" ON)
 
 # Audio format support
 OPTION(WITH_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
@@ -115,6 +117,7 @@ OPTION(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)"
 OPTION(WITH_RAYOPTIMIZATION    "Enable use of SIMD (SSE) optimizations for the raytracer" ON) 
 OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking" OFF)
 OPTION(WITH_INSTALL       "Install accompanying scripts and language files needed to run blender" ON)
+OPTION(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
 
 IF(APPLE)
        OPTION(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
@@ -130,6 +133,10 @@ IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
        MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
 ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
 
+IF(NOT WITH_INSTALL AND WITH_PYTHON_INSTALL)
+       MESSAGE("WARNING: WITH_PYTHON_INSTALL needs WITH_INSTALL")
+ENDIF(NOT WITH_INSTALL AND WITH_PYTHON_INSTALL)
+
 TEST_SSE_SUPPORT()
 
 # disabled for now, not supported
@@ -215,7 +222,7 @@ IF(UNIX AND NOT APPLE)
                ENDIF(NOT SDL_FOUND)
        ENDIF(WITH_SDL)
 
-       IF(WITH_OPENEXR)
+       IF(WITH_IMAGE_OPENEXR)
                SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
                FIND_PATH(OPENEXR_INC
                        ImfXdr.h
@@ -230,16 +237,16 @@ IF(UNIX AND NOT APPLE)
                SET(OPENEXR_LIB Half IlmImf Iex Imath)
                
                IF(NOT OPENEXR_INC)
-                       SET(WITH_OPENEXR OFF)
+                       SET(WITH_IMAGE_OPENEXR OFF)
                ENDIF(NOT OPENEXR_INC)
-       ENDIF(WITH_OPENEXR)
+       ENDIF(WITH_IMAGE_OPENEXR)
 
-       IF(WITH_TIFF)
+       IF(WITH_IMAGE_TIFF)
                FIND_PACKAGE(TIFF)
                IF(NOT TIFF_FOUND)
-                       SET(WITH_TIFF OFF)
+                       SET(WITH_IMAGE_TIFF OFF)
                ENDIF(NOT TIFF_FOUND)
-       ENDIF(WITH_TIFF)
+       ENDIF(WITH_IMAGE_TIFF)
 
        FIND_PACKAGE(JPEG REQUIRED)
 
@@ -492,7 +499,7 @@ IF(WIN32)
                        SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
                ENDIF(WITH_FFMPEG)
 
-               IF(WITH_OPENEXR)
+               IF(WITH_IMAGE_OPENEXR)
                        SET(OPENEXR ${LIBDIR}/openexr)
                        SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
                        SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
@@ -504,14 +511,14 @@ IF(WIN32)
                        IF (MSVC90)
                                SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
                        ENDIF(MSVC90)
-               ENDIF(WITH_OPENEXR)
+               ENDIF(WITH_IMAGE_OPENEXR)
 
-               IF(WITH_TIFF)
+               IF(WITH_IMAGE_TIFF)
                        SET(TIFF ${LIBDIR}/tiff)
                        SET(TIFF_LIBRARY libtiff)
                        SET(TIFF_INCLUDE_DIR ${TIFF}/include)
                        SET(TIFF_LIBPATH ${TIFF}/lib)
-               ENDIF(WITH_TIFF)
+               ENDIF(WITH_IMAGE_TIFF)
 
                IF(WITH_JACK)
                        SET(JACK ${LIBDIR}/jack)
@@ -602,19 +609,19 @@ IF(WIN32)
                        SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
                ENDIF(WITH_FFMPEG)
 
-               IF(WITH_OPENEXR)
+               IF(WITH_IMAGE_OPENEXR)
                        SET(OPENEXR ${LIBDIR}/gcc/openexr)
                        SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/OpenEXR)
                        SET(OPENEXR_LIB Half IlmImf Imath IlmThread)
                        SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
-               ENDIF(WITH_OPENEXR)
+               ENDIF(WITH_IMAGE_OPENEXR)
 
-               IF(WITH_TIFF)
+               IF(WITH_IMAGE_TIFF)
                        SET(TIFF ${LIBDIR}/gcc/tiff)
                        SET(TIFF_LIBRARY tiff)
                        SET(TIFF_INCLUDE_DIR ${TIFF}/include)
                        SET(TIFF_LIBPATH ${TIFF}/lib)
-               ENDIF(WITH_TIFF)
+               ENDIF(WITH_IMAGE_TIFF)
 
                IF(WITH_JACK)
                        SET(JACK ${LIBDIR}/jack)
@@ -722,12 +729,12 @@ IF(APPLE)
        SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
        SET(FREETYPE_LIBRARY freetype)
 
-       IF(WITH_OPENEXR)
+       IF(WITH_IMAGE_OPENEXR)
                SET(OPENEXR ${LIBDIR}/openexr)
                SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
                SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
                SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
-       ENDIF(WITH_OPENEXR)
+       ENDIF(WITH_IMAGE_OPENEXR)
 
        IF(WITH_LCMS)
                SET(LCMS ${LIBDIR}/lcms)
@@ -805,12 +812,12 @@ IF(APPLE)
        SET(JPEG_INC "${JPEG}/include")
        SET(JPEG_LIBPATH ${JPEG}/lib)
 
-       IF(WITH_TIFF)
+       IF(WITH_IMAGE_TIFF)
                SET(TIFF ${LIBDIR}/tiff)
                SET(TIFF_INCLUDE_DIR ${TIFF}/include)
                SET(TIFF_LIBRARY tiff)
                SET(TIFF_LIBPATH ${TIFF}/lib)
-       ENDIF(WITH_TIFF)
+       ENDIF(WITH_IMAGE_TIFF)
 
        IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
                SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}")
@@ -864,11 +871,11 @@ ENDIF(WITH_BUILDINFO)
        
 #-----------------------------------------------------------------------------
 # Common.
-IF(WITH_OPENJPEG)
+IF(WITH_IMAGE_OPENJPEG)
        set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
        set(OPENJPEG_INC ${OPENJPEG})
        set(OPENJPEG_LIb extern_libopenjpeg)
-ENDIF(WITH_OPENJPEG)
+ENDIF(WITH_IMAGE_OPENJPEG)
 
 #-----------------------------------------------------------------------------
 # Blender WebPlugin
index b16e046d5e858dc41c3335529ea9724c5573bf9c..d92edf2c02c3c3439ee2e0f06eb69593e1035825 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ MAKEFLAGS=-I$(NANBLENDERHOME)/build_files/make --no-print-directory
 
 SOURCEDIR = 
 ifeq ($(FREE_WINDOWS),true)
-    DIRS ?= dlltool extern intern source po
+    DIRS ?= $(NANBLENDERHOME)/build_files/make/dlltool extern intern source po
 else
     DIRS ?= extern intern source po
 endif
index acdf6182504406a1ef6f19b4abfd7244d92a791b..1f67f79f10b25e9edd685b58d03c4280902213cc 100644 (file)
@@ -210,14 +210,36 @@ SetOption('num_jobs', int(env['BF_NUMJOBS']))
 print B.bc.OKGREEN + "Build with parallel jobs%s: %s" % (B.bc.ENDC, GetOption('num_jobs'))
 print B.bc.OKGREEN + "Build with debug symbols%s: %s" % (B.bc.ENDC, env['BF_DEBUG'])
 
-# BLENDERPATH is a unix only option to enable typical style paths this is
-# spesifically a data-dir, which is used a lot but cant replace BF_INSTALLDIR
-# because the blender binary is installed in $BF_INSTALLDIR/bin/blender
+if 'blenderlite' in B.targets:
+       target_env_defs = {}
+       target_env_defs['WITH_BF_GAMEENGINE'] = False
+       target_env_defs['WITH_BF_OPENAL'] = False
+       target_env_defs['WITH_BF_OPENEXR'] = False
+       target_env_defs['WITH_BF_OPENMP'] = False
+       target_env_defs['WITH_BF_ICONV'] = False
+       target_env_defs['WITH_BF_INTERNATIONAL'] = False
+       target_env_defs['WITH_BF_OPENJPEG'] = False
+       target_env_defs['WITH_BF_FFMPEG'] = False
+       target_env_defs['WITH_BF_QUICKTIME'] = False
+       target_env_defs['WITH_BF_REDCODE'] = False
+       target_env_defs['WITH_BF_DDS'] = False
+       target_env_defs['WITH_BF_CINEON'] = False
+       target_env_defs['WITH_BF_HDR'] = False
+       target_env_defs['WITH_BF_ZLIB'] = False
+       target_env_defs['WITH_BF_SDL'] = False
+       target_env_defs['WITH_BF_JPEG'] = False
+       target_env_defs['WITH_BF_PNG'] = False
+       target_env_defs['WITH_BF_BULLET'] = False
+       target_env_defs['WITH_BF_BINRELOC'] = False
+       target_env_defs['BF_BUILDINFO'] = False
+       target_env_defs['BF_NO_ELBEEM'] = True
+       target_env_defs['WITH_BF_PYTHON'] = False
+       
+       # Merge blenderlite, let command line to override
+       for k,v in target_env_defs.iteritems():
+               if k not in B.arguments:
+                       env[k] = v
 
-if env['WITH_BF_FHS']:
-       BLENDERPATH = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION'])
-else:
-       BLENDERPATH = env['BF_INSTALLDIR']
 
 if env['WITH_BF_OPENMP'] == 1:
                if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
@@ -271,34 +293,6 @@ if 'blenderplayer' in B.targets:
 if 'blendernogame' in B.targets:
        env['WITH_BF_GAMEENGINE'] = False
 
-if 'blenderlite' in B.targets:
-       target_env_defs = {}
-       target_env_defs['WITH_BF_GAMEENGINE'] = False
-       target_env_defs['WITH_BF_OPENAL'] = False
-       target_env_defs['WITH_BF_OPENEXR'] = False
-       target_env_defs['WITH_BF_OPENMP'] = False
-       target_env_defs['WITH_BF_ICONV'] = False
-       target_env_defs['WITH_BF_INTERNATIONAL'] = False
-       target_env_defs['WITH_BF_OPENJPEG'] = False
-       target_env_defs['WITH_BF_FFMPEG'] = False
-       target_env_defs['WITH_BF_QUICKTIME'] = False
-       target_env_defs['WITH_BF_REDCODE'] = False
-       target_env_defs['WITH_BF_DDS'] = False
-       target_env_defs['WITH_BF_ZLIB'] = False
-       target_env_defs['WITH_BF_SDL'] = False
-       target_env_defs['WITH_BF_JPEG'] = False
-       target_env_defs['WITH_BF_PNG'] = False
-       target_env_defs['WITH_BF_BULLET'] = False
-       target_env_defs['WITH_BF_BINRELOC'] = False
-       target_env_defs['BF_BUILDINFO'] = False
-       target_env_defs['BF_NO_ELBEEM'] = True
-       target_env_defs['WITH_BF_PYTHON'] = False
-       
-       # Merge blenderlite, let command line to override
-       for k,v in target_env_defs.iteritems():
-               if k not in B.arguments:
-                       env[k] = v
-
 # disable elbeem (fluidsim) compilation?
 if env['BF_NO_ELBEEM'] == 1:
        env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
@@ -311,7 +305,7 @@ if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-min
 
 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
 B.root_build_dir = env['BF_BUILDDIR']
-B.doc_build_dir = os.path.join(BLENDERPATH, 'doc')
+B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
 if not B.root_build_dir[-1]==os.sep:
        B.root_build_dir += os.sep
 if not B.doc_build_dir[-1]==os.sep:
@@ -366,8 +360,9 @@ if not os.path.isdir ( B.root_build_dir):
        os.makedirs ( B.root_build_dir + 'extern' )
        os.makedirs ( B.root_build_dir + 'lib' )
        os.makedirs ( B.root_build_dir + 'bin' )
-if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
-       os.makedirs ( B.doc_build_dir )
+# # Docs not working with epy anymore
+# if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
+#      os.makedirs ( B.doc_build_dir )
 
 Help(opts.GenerateHelpText(env))
 
@@ -436,10 +431,7 @@ if  env['OURPLATFORM']=='darwin':
                        source=[dp+os.sep+f for f in df]
                        blenderinstall.append(env.Install(dir=dir,source=source))
 else:
-       if env['WITH_BF_FHS']:  dir= os.path.join(env['BF_INSTALLDIR'], 'bin')
-       else:                                   dir= env['BF_INSTALLDIR']
-       
-       blenderinstall = env.Install(dir=dir, source=B.program_list)
+       blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
 
 #-- local path = config files in install dir: installdir\VERSION
 #- dont do config and scripts for darwin, it is already in the bundle
@@ -466,15 +458,12 @@ if  env['OURPLATFORM']!='darwin':
                                
                                if 'locale' in dp:
                                        datafileslist.append(os.path.join(dp,f))
-                                       if env['WITH_BF_FHS']:  dir= os.path.join(*([BLENDERPATH] + ['datafiles'] + dp.split(os.sep)[2:]))      # skip bin/.blender
-                                       else:                                   dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:]))  # skip bin
+                                       dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:])) # skip bin
                                        datafilestargetlist.append(dir + os.sep + f)
 
                                else:
                                        dotblendlist.append(os.path.join(dp, f))
-                                       if env['WITH_BF_FHS']:  dir= os.path.join(*([BLENDERPATH] + ['config'] + dp.split(os.sep)[2:])) # skip bin/.blender
-                                       else:                                   dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['config'] + dp.split(os.sep)[1:]))     # skip bin
-                                       
+                                       dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[1:]))    # skip bin
                                        dottargetlist.append(dir + os.sep + f)
                                        
                dotblenderinstall = []
@@ -493,8 +482,7 @@ if  env['OURPLATFORM']!='darwin':
                                        if '.svn' in dn:
                                                dn.remove('.svn')
                                        
-                                       if env['WITH_BF_FHS']:          dir = BLENDERPATH
-                                       else:                                           dir = os.path.join(env['BF_INSTALLDIR'], VERSION)                               
+                                       dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
                                        dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
                                        
                                        source=[os.path.join(dp, f) for f in df if f[-3:]!='pyc']
@@ -510,7 +498,7 @@ if env['OURPLATFORM']=='linux2':
                        tn.remove('.svn')
                for f in tf:
                        iconlist.append(os.path.join(tp, f))
-                       icontargetlist.append( os.path.join(*([BLENDERPATH] + tp.split(os.sep)[2:] + [f])) )
+                       icontargetlist.append( os.path.join(*([env['BF_INSTALLDIR']] + tp.split(os.sep)[2:] + [f])) )
 
        iconinstall = []
        for targetdir,srcfile in zip(icontargetlist, iconlist):
@@ -537,24 +525,24 @@ for tp, tn, tf in os.walk('release/plugins'):
        df = tp[8:] # remove 'release/'
        for f in tf:
                pluglist.append(os.path.join(tp, f))
-               plugtargetlist.append( os.path.join(BLENDERPATH, df, f) )
+               plugtargetlist.append( os.path.join(env['BF_INSTALLDIR'], df, f) )
 
 
 # header files for plugins
 pluglist.append('source/blender/blenpluginapi/documentation.h')
-plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'documentation.h'))
+plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'documentation.h'))
 pluglist.append('source/blender/blenpluginapi/externdef.h')
-plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'externdef.h'))
+plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'externdef.h'))
 pluglist.append('source/blender/blenpluginapi/floatpatch.h')
-plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'floatpatch.h'))
+plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'floatpatch.h'))
 pluglist.append('source/blender/blenpluginapi/iff.h')
-plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'iff.h'))
+plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'iff.h'))
 pluglist.append('source/blender/blenpluginapi/plugin.h')
-plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'plugin.h'))
+plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'plugin.h'))
 pluglist.append('source/blender/blenpluginapi/util.h')
-plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'util.h'))
+plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'util.h'))
 pluglist.append('source/blender/blenpluginapi/plugin.DEF')
-plugtargetlist.append(os.path.join(BLENDERPATH, 'plugins', 'include', 'plugin.def'))
+plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], 'plugins', 'include', 'plugin.def'))
 
 plugininstall = []
 for targetdir,srcfile in zip(plugtargetlist, pluglist):
@@ -569,7 +557,7 @@ for tp, tn, tf in os.walk('release/text'):
        for f in tf:
                textlist.append(tp+os.sep+f)
 
-textinstall = env.Install(dir=BLENDERPATH, source=textlist)
+textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
 
 if  env['OURPLATFORM']=='darwin':
                allinstall = [blenderinstall, plugininstall, textinstall]
@@ -662,17 +650,3 @@ Default(B.program_list)
 
 if not env['WITHOUT_BF_INSTALL']:
                Default(installtarget)
-
-#------------ EPYDOC
-if env['WITH_BF_DOCS']:
-    try:
-        import epydoc
-    except ImportError:
-        epydoc = None
-
-    if epydoc:
-        SConscript('source/gameengine/PyDoc/SConscript')
-    else:
-        print "No epydoc install detected, Python API and Gameengine API Docs will not be generated "
-
-
index 84e6b788dc0906dfe2ceb1e24320ab06852874e6..22c090342ef7b4b8a8d74025ddc1500697c48668 100644 (file)
@@ -58,12 +58,12 @@ MACRO(SETUP_LIBDIRS)
        IF(WITH_FFMPEG)
                LINK_DIRECTORIES(${FFMPEG_LIBPATH})
        ENDIF(WITH_FFMPEG)
-       IF(WITH_OPENEXR)
+       IF(WITH_IMAGE_OPENEXR)
                LINK_DIRECTORIES(${OPENEXR_LIBPATH})
-       ENDIF(WITH_OPENEXR)
-       IF(WITH_TIFF)
+       ENDIF(WITH_IMAGE_OPENEXR)
+       IF(WITH_IMAGE_TIFF)
                LINK_DIRECTORIES(${TIFF_LIBPATH})
-       ENDIF(WITH_TIFF)
+       ENDIF(WITH_IMAGE_TIFF)
        IF(WITH_LCMS)
                LINK_DIRECTORIES(${LCMS_LIBPATH})
        ENDIF(WITH_LCMS)
@@ -140,10 +140,10 @@ MACRO(SETUP_LIBLINKS
        IF(WITH_QUICKTIME)
                TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
        ENDIF(WITH_QUICKTIME)
-       IF(WITH_TIFF)
+       IF(WITH_IMAGE_TIFF)
                TARGET_LINK_LIBRARIES(${target} ${TIFF_LIBRARY})
-       ENDIF(WITH_TIFF)
-       IF(WITH_OPENEXR)
+       ENDIF(WITH_IMAGE_TIFF)
+       IF(WITH_IMAGE_OPENEXR)
                IF(WIN32)
                        FOREACH(loop_var ${OPENEXR_LIB})
                                TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
@@ -152,7 +152,7 @@ MACRO(SETUP_LIBLINKS
                ELSE(WIN32)
                        TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
                ENDIF(WIN32)
-       ENDIF(WITH_OPENEXR)
+       ENDIF(WITH_IMAGE_OPENEXR)
        IF(WITH_LCMS)
                TARGET_LINK_LIBRARIES(${target} ${LCMS_LIBRARY})
        ENDIF(WITH_LCMS)
@@ -198,6 +198,7 @@ MACRO(TEST_SSE_SUPPORT)
        SUPPORT_SSE_BUILD)
 ENDMACRO(TEST_SSE_SUPPORT)
 
+
 MACRO(GET_BLENDER_VERSION)
        FILE(READ ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h CONTENT)
        STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}")
index 36c315a8e1124e1b1c15afd00c48afd568a2595a..be38eac4f92a50696b61c1e8c06aea30b01e7de8 100644 (file)
@@ -89,7 +89,6 @@ ifeq ($(OS),darwin)
         CCFLAGS += -pipe -fPIC -funsigned-char
     endif
 
-
     CFLAGS += -arch $(MACOSX_ARCHITECTURE) #-isysroot $(MACOSX_SDK) -mmacosx-version-min=$(MACOSX_MIN_VERS)
     CCFLAGS += -arch $(MACOSX_ARCHITECTURE) #-isysroot $(MACOSX_SDK) -mmacosx-version-min=$(MACOSX_MIN_VERS)
 
index d14bdb0a13cb79f91447b5ac8f3058398fd56e48..d8da2189e6d07510fcbdac7d67cddcae760bbbde 100644 (file)
@@ -159,6 +159,17 @@ ifndef CONFIG_GUESS
   endif
 
   export WITH_TIFF ?= true
+
+  #enable raytracing optimization (currently only for i386 and x86_64)
+  ifeq ($(CPU),powerpc)
+    export WITH_BF_RAYOPTIMIZATION ?= false
+  else
+    export WITH_BF_RAYOPTIMIZATION ?= true
+  endif
+
+  export WITH_LCMS ?= false
+  export WITH_CINEON ?= true
+  export WITH_HDR ?= true
   
   # Compare recreated .mo files with committed ones
   export BF_VERIFY_MO_FILES ?= true
@@ -622,6 +633,11 @@ ifndef CONFIG_GUESS
   # default tiff libs
   export NAN_TIFF_LIBS ?= $(NAN_TIFF)/lib/libtiff.a
 
+  # default path to lcms, may be overidden in platform sections above or in user-def.mk
+  export BF_LCMS ?= $(LCGDIR)/lcms
+  export BF_LCMS_INC ?= $(BF_LCMS)/include
+  export BF_LCMS_LIBS ?= $(BF_LCMS)/lib/liblcms.a
+
 endif # CONFIG_GUESS
 
 # Don't want to build the gameengine?
index bbf4053b14c083e36a5d82b2c72824c1bb33431f..43fba13f45b693becda0a6d9909c8a1c098a68d4 100644 (file)
@@ -195,4 +195,8 @@ ifeq ($(WITH_TIFF),true)
    LLIBS += $(NAN_TIFF_LIBS)
 endif
 
+ifeq ($(WITH_LCMS),true)
+   LLIBS += $(BF_LCMS_LIBS)
+endif
+
 LLIBS += $(NAN_PYTHON_LIB)
index ce34737fd498e0278ef8199078173a86f5303039..3572dd113bf55f951bd525b5856191b11f32dda0 100644 (file)
@@ -130,7 +130,7 @@ BF_OPENJPEG_LIB = ''
 BF_OPENJPEG_INC = '${BF_OPENJPEG}'
 BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
 
-WITH_BF_FFTW3 = False
+WITH_BF_FFTW3 = True
 BF_FFTW3 = LIBDIR + '/fftw3'
 BF_FFTW3_INC = '${BF_FFTW3}/include'
 BF_FFTW3_LIB = 'libfftw'
index 46b9034823cca58d22bc74ada117d080d75bd7be..0a4b05a28bf2b5c7d4e945d9a880061db813d6a0 100644 (file)
@@ -194,8 +194,6 @@ CXX_WARN = []
 
 LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
 
-WITH_BF_DOCS=False
-
 BF_DEBUG=False
 BF_BSC=False
 
index 7f5ce4767e38c86ee28cca0838f5e4c0412ff594..89c4ef9cac9008ea0c375a6d609009bc74476297 100644 (file)
@@ -501,10 +501,7 @@ def AppIt(target=None, source=None, env=None):
        installdir = env['BF_INSTALLDIR']
        print("compiled architecture: %s"%(osxarch))
        print("Installing to %s"%(installdir))
-       if  libdir == '../lib/darwin-9.x.universal':
-               python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
-       else:
-               python_zip = 'python.zip' # compatibility for darwin8 python.zip
+       python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
        print("unzipping to app-bundle: %s"%(python_zip))
        bldroot = env.Dir('.').abspath
        binary = env['BINARYKIND']
@@ -529,13 +526,13 @@ def AppIt(target=None, source=None, env=None):
 #      print cmd
        commands.getoutput(cmd)
        cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION)
-       shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd)
-       shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd)
-       cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
+       shutil.copy(bldroot + '/release/bin/.blender/.bfont.ttf', cmd)
+       shutil.copy(bldroot + '/release/bin/.blender/.Blanguages', cmd)
+       cmd = 'cp -R %s/release/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
        commands.getoutput(cmd)
-       cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION)
+       cmd = 'cp -R %s/release/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION)
        commands.getoutput(cmd)
-       cmd = 'cp %s/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
+       cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
        commands.getoutput(cmd)
        cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
        commands.getoutput(cmd)
@@ -570,10 +567,9 @@ def UnixPyBundle(target=None, source=None, env=None):
        def run(cmd):
                print 'Install command:', cmd
                commands.getoutput(cmd)
-       
-       if env['WITH_BF_FHS']:  dir = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION']) # BLENDERPATH
-       else:                                   dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
-       
+
+       dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
+
        py_src =        env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
        py_target =     env.subst( dir + '/python/lib/python'+env['BF_PYTHON_VERSION'] )
        
index 5647ef0ebaaf03117d9431f1206d7eab5133548a..c930c150cb6f8af29a9916615b18ea20e8c01c26 100644 (file)
@@ -36,7 +36,7 @@ def validate_arguments(args, bc):
             'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH',
             'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
             'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC',
-            'WITH_BF_DDS',
+            'WITH_BF_DDS', 'WITH_BF_CINEON', 'WITH_BF_HDR',
             'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG',  'BF_FFMPEG_INC',
             'WITH_BF_OGG', 'BF_OGG', 'BF_OGG_LIB',
             'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
@@ -78,7 +78,6 @@ def validate_arguments(args, bc):
             'WITH_BF_DOCS',
             'BF_NUMJOBS',
             'BF_MSVS',
-            'WITH_BF_FHS',
             'BF_VERSION',
             'BF_GHOST_DEBUG',
             'WITH_BF_RAYOPTIMIZATION',
@@ -224,7 +223,11 @@ def read_opts(env, cfg, args):
         ('BF_OPENEXR_LIBPATH', 'OPENEXR library path', ''),
         ('BF_OPENEXR_LIB_STATIC', 'OPENEXR static library', ''),
 
-        (BoolVariable('WITH_BF_DDS', 'Use DDS if true', True)),
+        (BoolVariable('WITH_BF_DDS', 'Support DDS image format if true', True)),
+
+        (BoolVariable('WITH_BF_CINEON', 'Support CINEON and DPX image formats if true', True)),
+
+        (BoolVariable('WITH_BF_HDR', 'Support HDR image formats if true', True)),
 
         (BoolVariable('WITH_BF_FFMPEG', 'Use FFMPEG if true', False)),
         ('BF_FFMPEG', 'FFMPEG base path', ''),
@@ -428,13 +431,12 @@ def read_opts(env, cfg, args):
         
         ('BF_X264_CONFIG', 'configuration flags for x264', ''),
         ('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
-        (BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
+#        (BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
         
         ('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'),
         ('BF_NUMJOBS', 'Number of build processes to spawn', '1'),
         ('BF_MSVS', 'Generate MSVS project files and solution', False),
-        
-        (BoolVariable('WITH_BF_FHS', 'Use the Unix "Filesystem Hierarchy Standard" rather then a redistributable directory layout', False)),
+
         ('BF_VERSION', 'The root path for Unix (non-apple)', '2.5'),
 
         (BoolVariable('BF_UNIT_TEST', 'Build with unit test support.', False)),
index 35271d24a2d4945bdc1f20fd73e4fbf155c75ed7..b15c8a31c730a15eb706770a1de3e8176ec83dcf 100644 (file)
@@ -34,9 +34,9 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 
 ADD_SUBDIRECTORY(glew)
 
-IF(WITH_OPENJPEG)
+IF(WITH_IMAGE_OPENJPEG)
        ADD_SUBDIRECTORY(libopenjpeg)
-ENDIF(WITH_OPENJPEG)
+ENDIF(WITH_IMAGE_OPENJPEG)
 
 IF(WITH_LZO)
        ADD_SUBDIRECTORY(lzo)
index a370118f061a5dc766bfadf535b881e0cbdb2154..d64029a66718313e8d6bb8f8ef180cab485e0363 100644 (file)
@@ -38,8 +38,8 @@ ADD_SUBDIRECTORY(boolop)
 ADD_SUBDIRECTORY(opennl)
 ADD_SUBDIRECTORY(smoke)
 
-IF(WITH_ELBEEM)
+IF(WITH_FLUID)
        ADD_SUBDIRECTORY(elbeem)
-ENDIF(WITH_ELBEEM)
+ENDIF(WITH_FLUID)
 
 ADD_SUBDIRECTORY(bsp)
index 4b5631006598d916d260fb00f922f359688352be..02a46098d32cb20f6b7c8f8d059d014529978635 100644 (file)
@@ -60,7 +60,7 @@ public:
        virtual void seek(int position)=0;
 
        /**
-        * Returns an aproximated length of the source in samples.
+        * Returns an approximated length of the source in samples.
         * For readers of the type buffer this has to return a correct value!
         * \return The length as sample count. May be negative if unknown.
         * \see getType
index 4d2cd9e2505fa89ec1594c4c4e66e70160059ab0..cb97e6125fbe3a0d23f0adeaa43fac8edbf99ae2 100644 (file)
@@ -44,7 +44,7 @@ AUD_StreamBufferFactory::AUD_StreamBufferFactory(AUD_IFactory* factory)
        int index = 0;
        sample_t* buffer;
 
-       // get an aproximated size if possible
+       // get an approximated size if possible
        int size = reader->getLength();
 
        if(size <= 0)
index b17f7ab7c2e43e471d159714490bab3a40d95f4a..b0c7f10f3296458633db1e744276f6ebb37c50ed 100644 (file)
@@ -1322,6 +1322,11 @@ GHOST_TUns8 GHOST_SystemCocoa::handleQuitRequest()
                        NSArray *windowsList = [NSApp orderedWindows];
                        if ([windowsList count]) {
                                [[windowsList objectAtIndex:0] makeKeyAndOrderFront:nil];
+                               //Handle the modifiers keyes changed state issue
+                               //as recovering from the quit dialog is like application
+                               //gaining focus back.
+                               //Main issue fixed is Cmd modifier not being cleared
+                               handleApplicationBecomeActiveEvent();
                        }
                }
 
index 3e296fd7c9031a1cb8c6a90fbc5af1f8b3d7d050..b340c914519c3352b0530a3d74ff47140a49860f 100644 (file)
@@ -38,11 +38,11 @@ struct FLUID_3D;
 void smoke_export(struct FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles);
 
 // low res
-struct FLUID_3D *smoke_init(int *res, float *p0, float dt);
+struct FLUID_3D *smoke_init(int *res, float *p0);
 void smoke_free(struct FLUID_3D *fluid);
 
-void smoke_initBlenderRNA(struct FLUID_3D *fluid, float *alpha, float *beta);
-void smoke_step(struct FLUID_3D *fluid, size_t framenr);
+void smoke_initBlenderRNA(struct FLUID_3D *fluid, float *alpha, float *beta, float *dt_factor, float *vorticity, int *border_colli);
+void smoke_step(struct FLUID_3D *fluid, size_t framenr, float fps);
 
 float *smoke_get_density(struct FLUID_3D *fluid);
 float *smoke_get_heat(struct FLUID_3D *fluid);
index 4ac960b5ef07ead3f23ce2cb3d7f48eb777692b9..05fbb918d248d8fcfbd437dcd66571b256ba7a25 100644 (file)
 #include <omp.h>
 #endif // PARALLEL 
 
-// boundary conditions of the fluid domain
-#define DOMAIN_BC_FRONT  0 // z
-#define DOMAIN_BC_TOP    1 // y
-#define DOMAIN_BC_LEFT   1 // x
-#define DOMAIN_BC_BACK   DOMAIN_BC_FRONT
-#define DOMAIN_BC_BOTTOM DOMAIN_BC_TOP
-#define DOMAIN_BC_RIGHT  DOMAIN_BC_LEFT
-
 //////////////////////////////////////////////////////////////////////
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
 
-FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
-       _xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f), _dt(dt)
+FLUID_3D::FLUID_3D(int *res, float *p0) :
+       _xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f)
 {
        // set simulation consts
-       // _dt = dt; // 0.10
+       _dt = DT_DEFAULT;       // just in case. set in step from a RNA factor
        
        // start point of array
        _p0[0] = p0[0];
@@ -61,7 +53,6 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
        _iterations = 100;
        _tempAmb = 0; 
        _heatDiffusion = 1e-3;
-       _vorticityEps = 2.0;
        _totalTime = 0.0f;
        _totalSteps = 0;
        _res = Vec3Int(_xRes,_yRes,_zRes);
@@ -77,9 +68,9 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
        
        // scale the constants according to the refinement of the grid
        _dx = 1.0f / (float)_maxRes;
-       float scaling = 64.0f / _maxRes;
-       scaling = (scaling < 1.0f) ? 1.0f : scaling;
-       _vorticityEps /= scaling;
+       _constantScaling = 64.0f / _maxRes;
+       _constantScaling = (_constantScaling < 1.0f) ? 1.0f : _constantScaling;
+       _vorticityEps = 2.0f / _constantScaling; // Just in case set a default value
 
        // allocate arrays
        _totalCells   = _xRes * _yRes * _zRes;
@@ -126,30 +117,42 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
                _obstacles[x]    = false;
        }
 
+       // boundary conditions of the fluid domain
+       // set default values -> vertically non-colliding
+       _domainBcFront = true;
+       _domainBcTop = false;
+       _domainBcLeft = true;
+       _domainBcBack = _domainBcFront;
+       _domainBcBottom = _domainBcTop;
+       _domainBcRight  = _domainBcLeft;
+
+       _colloPrev = 1; // default value
+
+
        // set side obstacles
        int index;
        for (int y = 0; y < _yRes; y++)
        for (int x = 0; x < _xRes; x++)
        {
-               // front slab
+               // bottom slab
                index = x + y * _xRes;
-               if(DOMAIN_BC_FRONT==1) _obstacles[index] = 1;
+               if(_domainBcBottom==1) _obstacles[index] = 1;
 
-               // back slab
+               // top slab
                index += _totalCells - _slabSize;
-               if(DOMAIN_BC_BACK==1) _obstacles[index] = 1;
+               if(_domainBcTop==1) _obstacles[index] = 1;
        }
 
        for (int z = 0; z < _zRes; z++)
        for (int x = 0; x < _xRes; x++)
        {
-               // bottom slab
+               // front slab
                index = x + z * _slabSize;
-               if(DOMAIN_BC_BOTTOM==1) _obstacles[index] = 1;
+               if(_domainBcFront==1) _obstacles[index] = 1;
 
-               // top slab
+               // back slab
                index += _slabSize - _xRes;
-               if(DOMAIN_BC_TOP==1) _obstacles[index] = 1;
+               if(_domainBcBack==1) _obstacles[index] = 1;
        }
 
        for (int z = 0; z < _zRes; z++)
@@ -157,12 +160,13 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
        {
                // left slab
                index = y * _xRes + z * _slabSize;
-               if(DOMAIN_BC_LEFT==1) _obstacles[index] = 1;
+               if(_domainBcLeft==1) _obstacles[index] = 1;
 
                // right slab
                index += _xRes - 1;
-               if(DOMAIN_BC_RIGHT==1) _obstacles[index] = 1;
+               if(_domainBcRight==1) _obstacles[index] = 1;
        }
+
 }
 
 FLUID_3D::~FLUID_3D()
@@ -193,17 +197,32 @@ FLUID_3D::~FLUID_3D()
 }
 
 // init direct access functions from blender
-void FLUID_3D::initBlenderRNA(float *alpha, float *beta)
+void FLUID_3D::initBlenderRNA(float *alpha, float *beta, float *dt_factor, float *vorticity, int *borderCollision)
 {
        _alpha = alpha;
        _beta = beta;
+       _dtFactor = dt_factor;
+       _vorticityRNA = vorticity;
+       _borderColli = borderCollision;
 }
 
 //////////////////////////////////////////////////////////////////////
 // step simulation once
 //////////////////////////////////////////////////////////////////////
-void FLUID_3D::step()
+void FLUID_3D::step(float dt)
 {
+       // If border rules have been changed
+       if (_colloPrev != *_borderColli) {
+               setBorderCollisions();
+       }
+
+
+       // set delta time by dt_factor
+       _dt = (*_dtFactor) * dt;
+       // set vorticity from RNA value
+       _vorticityEps = (*_vorticityRNA)/_constantScaling;
+
+
 #if PARALLEL==1
        int threadval = 1;
        threadval = omp_get_max_threads();
@@ -246,6 +265,13 @@ void FLUID_3D::step()
        #pragma omp single
        {
 #endif
+       /*
+       * addForce() changed Temp values to preserve thread safety
+       * (previous functions in per thread loop still needed
+       *  original velocity data)
+       *
+       * So swap temp values to velocity
+       */
        SWAP_POINTERS(_xVelocity, _xVelocityTemp);
        SWAP_POINTERS(_yVelocity, _yVelocityTemp);
        SWAP_POINTERS(_zVelocity, _zVelocityTemp);
@@ -276,6 +302,10 @@ void FLUID_3D::step()
        #pragma omp single
        {
 #endif
+       /*
+       * For thread safety use "Old" to read
+       * "current" values but still allow changing values.
+       */
        SWAP_POINTERS(_xVelocity, _xVelocityOld);
        SWAP_POINTERS(_yVelocity, _yVelocityOld);
        SWAP_POINTERS(_zVelocity, _zVelocityOld);
@@ -334,6 +364,10 @@ void FLUID_3D::step()
        }
 #endif
 
+       /*
+       * swap final velocity back to Velocity array
+       * from temp xForce storage
+       */
        SWAP_POINTERS(_xVelocity, _xForce);
        SWAP_POINTERS(_yVelocity, _yForce);
        SWAP_POINTERS(_zVelocity, _zForce);
@@ -351,6 +385,88 @@ void FLUID_3D::step()
 
 }
 
+
+// Set border collision model from RNA setting
+
+void FLUID_3D::setBorderCollisions() {
+
+
+       _colloPrev = *_borderColli;             // saving the current value
+
+       // boundary conditions of the fluid domain
+       if (_colloPrev == 0)
+       {
+               // No collisions
+               _domainBcFront = false;
+               _domainBcTop = false;
+               _domainBcLeft = false;
+       }
+       else if (_colloPrev == 2)
+       {
+               // Collide with all sides
+               _domainBcFront = true;
+               _domainBcTop = true;
+               _domainBcLeft = true;
+       }
+       else
+       {
+               // Default values: Collide with "walls", but not top and bottom
+               _domainBcFront = true;
+               _domainBcTop = false;
+               _domainBcLeft = true;
+       }
+
+       _domainBcBack = _domainBcFront;
+       _domainBcBottom = _domainBcTop;
+       _domainBcRight  = _domainBcLeft;
+
+
+
+       // set side obstacles
+       int index;
+       for (int y = 0; y < _yRes; y++)
+       for (int x = 0; x < _xRes; x++)
+       {
+               // front slab
+               index = x + y * _xRes;
+               if(_domainBcBottom==1) _obstacles[index] = 1;
+               else _obstacles[index] = 0;
+
+               // back slab
+               index += _totalCells - _slabSize;
+               if(_domainBcTop==1) _obstacles[index] = 1;
+               else _obstacles[index] = 0;
+       }
+
+       for (int z = 0; z < _zRes; z++)
+       for (int x = 0; x < _xRes; x++)
+       {
+               // bottom slab
+               index = x + z * _slabSize;
+               if(_domainBcFront==1) _obstacles[index] = 1;
+               else _obstacles[index] = 0;
+
+               // top slab
+               index += _slabSize - _xRes;
+               if(_domainBcBack==1) _obstacles[index] = 1;
+               else _obstacles[index] = 0;
+       }
+
+       for (int z = 0; z < _zRes; z++)
+       for (int y = 0; y < _yRes; y++)
+       {
+               // left slab
+               index = y * _xRes + z * _slabSize;
+               if(_domainBcLeft==1) _obstacles[index] = 1;
+               else _obstacles[index] = 0;
+
+               // right slab
+               index += _xRes - 1;
+               if(_domainBcRight==1) _obstacles[index] = 1;
+               else _obstacles[index] = 0;
+       }
+}
+
 //////////////////////////////////////////////////////////////////////
 // helper function to dampen co-located grid artifacts of given arrays in intervals
 // (only needed for velocity, strength (w) depends on testcase...
@@ -428,6 +544,10 @@ void FLUID_3D::artificialDampingExactSL(int pos) {
                        for (y = 1; y < _res[1]-1; y++)
                                for (x = 1+(y+z)%2; x < _res[0]-1; x+=2) {
                                        index = x + y*_res[0] + posslab;
+                                       /*
+                                       * Uses xForce as temporary storage to allow other threads to read
+                                       * old values from xVelocityTemp
+                                       */
                                        _xForce[index] = (1-w)*_xVelocityTemp[index] + 1./6. * w*(
                                                        _xVelocityTemp[index+1] + _xVelocityTemp[index-1] +
                                                        _xVelocityTemp[index+_res[0]] + _xVelocityTemp[index-_res[0]] +
@@ -450,6 +570,11 @@ void FLUID_3D::artificialDampingExactSL(int pos) {
                        for (y = 1; y < _res[1]-1; y++)
                                for (x = 1+(y+z+1)%2; x < _res[0]-1; x+=2) {
                                        index = x + y*_res[0] + posslab;
+
+                                       /*
+                                       * Uses xForce as temporary storage to allow other threads to read
+                                       * old values from xVelocityTemp
+                                       */
                                        _xForce[index] = (1-w)*_xVelocityTemp[index] + 1./6. * w*(
                                                        _xVelocityTemp[index+1] + _xVelocityTemp[index-1] +
                                                        _xVelocityTemp[index+_res[0]] + _xVelocityTemp[index-_res[0]] +
@@ -661,13 +786,13 @@ void FLUID_3D::project()
        setObstacleBoundaries(_pressure, 0, _zRes);
        
        // copy out the boundaries
-       if(DOMAIN_BC_LEFT == 0)  setNeumannX(_xVelocity, _res, 0, _zRes);
+       if(_domainBcLeft == 0)  setNeumannX(_xVelocity, _res, 0, _zRes);
        else setZeroX(_xVelocity, _res, 0, _zRes); 
 
-       if(DOMAIN_BC_TOP == 0)   setNeumannY(_yVelocity, _res, 0, _zRes);
+       if(_domainBcFront == 0)   setNeumannY(_yVelocity, _res, 0, _zRes);
        else setZeroY(_yVelocity, _res, 0, _zRes); 
 
-       if(DOMAIN_BC_FRONT == 0) setNeumannZ(_zVelocity, _res, 0, _zRes);
+       if(_domainBcTop == 0) setNeumannZ(_zVelocity, _res, 0, _zRes);
        else setZeroZ(_zVelocity, _res, 0, _zRes);
 
        // calculate divergence
@@ -1060,13 +1185,13 @@ void FLUID_3D::advectMacCormackBegin(int zBegin, int zEnd)
 {
        Vec3Int res = Vec3Int(_xRes,_yRes,_zRes);
 
-       if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocityOld, res, zBegin, zEnd);
+       if(_domainBcLeft == 0) copyBorderX(_xVelocityOld, res, zBegin, zEnd);
        else setZeroX(_xVelocityOld, res, zBegin, zEnd);
 
-       if(DOMAIN_BC_TOP == 0) copyBorderY(_yVelocityOld, res, zBegin, zEnd);
+       if(_domainBcFront == 0) copyBorderY(_yVelocityOld, res, zBegin, zEnd);
        else setZeroY(_yVelocityOld, res, zBegin, zEnd); 
 
-       if(DOMAIN_BC_FRONT == 0) copyBorderZ(_zVelocityOld, res, zBegin, zEnd);
+       if(_domainBcTop == 0) copyBorderZ(_zVelocityOld, res, zBegin, zEnd);
        else setZeroZ(_zVelocityOld, res, zBegin, zEnd);
 }
 
@@ -1114,13 +1239,13 @@ void FLUID_3D::advectMacCormackEnd2(int zBegin, int zEnd)
        advectFieldMacCormack2(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _yVelocityOld, _yVelocityTemp, _yVelocity, t1, res, _obstacles, zBegin, zEnd);
        advectFieldMacCormack2(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _zVelocityOld, _zVelocityTemp, _zVelocity, t1, res, _obstacles, zBegin, zEnd);
 
-       if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocityTemp, res, zBegin, zEnd);
+       if(_domainBcLeft == 0) copyBorderX(_xVelocityTemp, res, zBegin, zEnd);
        else setZeroX(_xVelocityTemp, res, zBegin, zEnd);                               
 
-       if(DOMAIN_BC_TOP == 0) copyBorderY(_yVelocityTemp, res, zBegin, zEnd);
+       if(_domainBcFront == 0) copyBorderY(_yVelocityTemp, res, zBegin, zEnd);
        else setZeroY(_yVelocityTemp, res, zBegin, zEnd); 
 
-       if(DOMAIN_BC_FRONT == 0) copyBorderZ(_zVelocityTemp, res, zBegin, zEnd);
+       if(_domainBcTop == 0) copyBorderZ(_zVelocityTemp, res, zBegin, zEnd);
        else setZeroZ(_zVelocityTemp, res, zBegin, zEnd);
 
        setZeroBorder(_density, res, zBegin, zEnd);
index 6ca50b2c03207c710065af3305911aabb2ae210c..c244180ee57e783f9f50456d7a0aeea10b342a32 100644 (file)
@@ -36,6 +36,9 @@
 // #include "WTURBULENCE.h"
 #include "VEC3.h"
 
+// timestep default value for nice appearance
+#define DT_DEFAULT 0.1f;
+
 using namespace std;
 using namespace BasicVector;
 class WTURBULENCE;
@@ -43,11 +46,11 @@ class WTURBULENCE;
 class FLUID_3D  
 {
        public:
-               FLUID_3D(int *res, /* int amplify, */ float *p0, float dt);
+               FLUID_3D(int *res, /* int amplify, */ float *p0);
                FLUID_3D() {};
                virtual ~FLUID_3D();
 
-               void initBlenderRNA(float *alpha, float *beta);
+               void initBlenderRNA(float *alpha, float *beta, float *dt_factor, float *vorticity, int *border_colli);
                
                // create & allocate vector noise advection 
                void initVectorNoise(int amplify);
@@ -55,7 +58,7 @@ class FLUID_3D
                void addSmokeColumn();
                static void addSmokeTestCase(float* field, Vec3Int res);
 
-               void step();
+               void step(float dt);
                void addObstacle(OBSTACLE* obstacle);
 
                const float* xVelocity() { return _xVelocity; }; 
@@ -111,11 +114,25 @@ class FLUID_3D
 
                // simulation constants
                float _dt;
+               float *_dtFactor;
                float _vorticityEps;
                float _heatDiffusion;
+               float *_vorticityRNA;   // RNA-pointer.
                float *_alpha; // for the buoyancy density term <-- as pointer to get blender RNA in here
                float *_beta; // was _buoyancy <-- as pointer to get blender RNA in here
                float _tempAmb; /* ambient temperature */
+               float _constantScaling;
+
+               bool _domainBcFront;  // z
+               bool _domainBcTop;    // y
+               bool _domainBcLeft;   // x
+               bool _domainBcBack;   // DOMAIN_BC_FRONT
+               bool _domainBcBottom; // DOMAIN_BC_TOP
+               bool _domainBcRight;  // DOMAIN_BC_LEFT
+               int *_borderColli; // border collision rules <-- as pointer to get blender RNA in here
+               int _colloPrev;         // To track whether value has been changed (to not
+                                                       // have to recalibrate borders if nothing has changed
+               void setBorderCollisions();
 
                // WTURBULENCE object, if active
                // WTURBULENCE* _wTurbulence;
index 427f4d53171cc463f3890452d96bd1ff4e370359..168395f370d11ac3d114a7f959e1e48740d12a75 100644 (file)
 #include <math.h>
 
 // y in smoke is z in blender
-extern "C" FLUID_3D *smoke_init(int *res, float *p0, float dt)
+extern "C" FLUID_3D *smoke_init(int *res, float *p0)
 {
        // smoke lib uses y as top-bottom/vertical axis where blender uses z
-       FLUID_3D *fluid = new FLUID_3D(res, p0, dt);
+       FLUID_3D *fluid = new FLUID_3D(res, p0);
 
        // printf("xres: %d, yres: %d, zres: %d\n", res[0], res[1], res[2]);
 
@@ -75,9 +75,41 @@ extern "C" size_t smoke_get_index2d(int x, int max_x, int y /*, int max_y, int z
        return x + y * max_x;
 }
 
-extern "C" void smoke_step(FLUID_3D *fluid, size_t framenr)
+extern "C" void smoke_step(FLUID_3D *fluid, size_t framenr, float fps)
 {
-       fluid->step();
+       /* stability values copied from wturbulence.cpp */
+       const int maxSubSteps = 25;
+       const float maxVel = 0.5f; /* TODO: maybe 0.5 is still too high, please confirm! -dg */
+
+       float dt = DT_DEFAULT;
+       float maxVelMag = 0.0f;
+       int totalSubsteps;
+       int substep = 0;
+       float dtSubdiv;
+
+       /* get max velocity and lower the dt value if it is too high */
+       size_t size= fluid->_xRes * fluid->_yRes * fluid->_zRes;
+
+       for(size_t i = 0; i < size; i++)
+       {
+               float vtemp = (fluid->_xVelocity[i]*fluid->_xVelocity[i]+fluid->_yVelocity[i]*fluid->_yVelocity[i]+fluid->_zVelocity[i]*fluid->_zVelocity[i]);
+               if(vtemp > maxVelMag)
+                       maxVelMag = vtemp;
+       }
+
+       /* adapt timestep for different framerates, dt = 0.1 is at 25fps */
+       dt *= (25.0f / fps);
+
+       maxVelMag = sqrt(maxVelMag) * dt * (*(fluid->_dtFactor));
+       totalSubsteps = (int)((maxVelMag / maxVel) + 1.0f); /* always round up */
+       totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps;
+       totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps;
+       dtSubdiv = (float)dt / (float)totalSubsteps;
+
+       // printf("totalSubsteps: %d, maxVelMag: %f, dt: %f\n", totalSubsteps, maxVelMag, dt);
+
+       for(substep = 0; substep < totalSubsteps; substep++)
+               fluid->step(dtSubdiv);
 }
 
 extern "C" void smoke_turbulence_step(WTURBULENCE *wt, FLUID_3D *fluid)
@@ -85,9 +117,9 @@ extern "C" void smoke_turbulence_step(WTURBULENCE *wt, FLUID_3D *fluid)
        wt->stepTurbulenceFull(fluid->_dt/fluid->_dx, fluid->_xVelocity, fluid->_yVelocity, fluid->_zVelocity, fluid->_obstacles); 
 }
 
-extern "C" void smoke_initBlenderRNA(FLUID_3D *fluid, float *alpha, float *beta)
+extern "C" void smoke_initBlenderRNA(FLUID_3D *fluid, float *alpha, float *beta, float *dt_factor, float *vorticity, int *border_colli)
 {
-       fluid->initBlenderRNA(alpha, beta);
+       fluid->initBlenderRNA(alpha, beta, dt_factor, vorticity, border_colli);
 }
 
 extern "C" void smoke_dissolve(FLUID_3D *fluid, int speed, int log)
index b656a00fb381d33fcdddbf895b37de39b35c897e..bbd1caa68ad422c60d7083c7e91d195f36c3079f 100644 (file)
@@ -51,7 +51,7 @@ $(DIR)%/LC_MESSAGES/blender.mo: %.po
        mkdir -p $(@D)
        msgfmt -o $@ $<
 ifeq ($(BF_VERIFY_MO_FILES), true)
-       @cmp $@ $(NANBLENDERHOME)/bin/.blender/locale/$(basename $<)/LC_MESSAGES/blender.mo \
+       @cmp $@ $(NANBLENDERHOME)/release/bin/.blender/locale/$(basename $<)/LC_MESSAGES/blender.mo \
           || ( echo Mismatch between generated and commited $(basename $<).mo catalog && \
                rm -f $@ && false )
 endif
index 809ac54872412d4961d9263d22b1ca35c5426504..e6d904ea13cb625394e90a8be03b7b1b913a27fe 100644 (file)
@@ -114,8 +114,8 @@ install: package
     ifneq ($(OS), darwin)
        @[ ! -d $(OCGDIR)/bin/.blender ] || \
                cp -r $(OCGDIR)/bin/.blender $(DISTDIR)
-       @cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR)
-       @cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR)
+       @cp $(NANBLENDERHOME)/release/bin/.blender/.Blanguages $(CONFDIR)
+       @cp $(NANBLENDERHOME)/release/bin/.blender/.bfont.ttf $(CONFDIR)
     endif
        @echo "----> Copy blender$(EXT0) executable"
     ifeq ($(TYPE),-static)
diff --git a/release/scripts/io/engine_render_pov.py b/release/scripts/io/engine_render_pov.py
deleted file mode 100644 (file)
index 9cda437..0000000
+++ /dev/null
@@ -1,1001 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-import bpy
-
-from math import atan, pi, degrees
-import subprocess
-import os
-import sys
-import time
-
-import platform as pltfrm
-
-if pltfrm.architecture()[0] == '64bit':
-    bitness = 64
-else:
-    bitness = 32
-
-
-def write_pov(filename, scene=None, info_callback=None):
-    file = open(filename, 'w')
-
-    # Only for testing
-    if not scene:
-        scene = bpy.data.scenes[0]
-
-    render = scene.render
-    world = scene.world
-
-    def uniqueName(name, nameSeq):
-
-        if name not in nameSeq:
-            return name
-
-        name_orig = name
-        i = 1
-        while name in nameSeq:
-            name = '%s_%.3d' % (name_orig, i)
-            i += 1
-
-        return name
-
-    def writeMatrix(matrix):
-        file.write('\tmatrix <%.6f, %.6f, %.6f,  %.6f, %.6f, %.6f,  %.6f, %.6f, %.6f,  %.6f, %.6f, %.6f>\n' %\
-        (matrix[0][0], matrix[0][1], matrix[0][2], matrix[1][0], matrix[1][1], matrix[1][2], matrix[2][0], matrix[2][1], matrix[2][2], matrix[3][0], matrix[3][1], matrix[3][2]))
-
-    def writeObjectMaterial(material):
-        if material and material.transparency_method == 'RAYTRACE':
-            file.write('\tinterior { ior %.6f }\n' % material.raytrace_transparency.ior)
-
-            # Other interior args
-            # fade_distance 2
-            # fade_power [Value]
-            # fade_color
-
-            # dispersion
-            # dispersion_samples
-
-    materialNames = {}
-    DEF_MAT_NAME = 'Default'
-
-    def writeMaterial(material):
-        # Assumes only called once on each material
-
-        if material:
-            name_orig = material.name
-        else:
-            name_orig = DEF_MAT_NAME
-
-        name = materialNames[name_orig] = uniqueName(bpy.utils.clean_name(name_orig), materialNames)
-
-        file.write('#declare %s = finish {\n' % name)
-
-        if material:
-            file.write('\tdiffuse %.3g\n' % material.diffuse_intensity)
-            file.write('\tspecular %.3g\n' % material.specular_intensity)
-
-            file.write('\tambient %.3g\n' % material.ambient)
-            #file.write('\tambient rgb <%.3g, %.3g, %.3g>\n' % tuple([c*material.ambient for c in world.ambient_color])) # povray blends the global value
-
-            # map hardness between 0.0 and 1.0
-            roughness = ((1.0 - ((material.specular_hardness - 1.0) / 510.0)))
-            # scale from 0.0 to 0.1
-            roughness *= 0.1
-            # add a small value because 0.0 is invalid
-            roughness += (1 / 511.0)
-
-            file.write('\troughness %.3g\n' % roughness)
-
-            # 'phong 70.0 '
-
-            if material.raytrace_mirror.enabled:
-                raytrace_mirror = material.raytrace_mirror
-                if raytrace_mirror.reflect_factor:
-                    file.write('\treflection {\n')
-                    file.write('\t\trgb <%.3g, %.3g, %.3g>' % tuple(material.mirror_color))
-                    file.write('\t\tfresnel 1 falloff %.3g exponent %.3g metallic %.3g} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_factor, raytrace_mirror.reflect_factor))
-
-        else:
-            file.write('\tdiffuse 0.8\n')
-            file.write('\tspecular 0.2\n')
-
-
-        # This is written into the object
-        '''
-        if material and material.transparency_method=='RAYTRACE':
-            'interior { ior %.3g} ' % material.raytrace_transparency.ior
-        '''
-
-        #file.write('\t\t\tcrand 1.0\n') # Sand granyness
-        #file.write('\t\t\tmetallic %.6f\n' % material.spec)
-        #file.write('\t\t\tphong %.6f\n' % material.spec)
-        #file.write('\t\t\tphong_size %.6f\n' % material.spec)
-        #file.write('\t\t\tbrilliance %.6f ' % (material.specular_hardness/256.0) # Like hardness
-
-        file.write('}\n')
-
-    def exportCamera():
-        camera = scene.camera
-        matrix = camera.matrix_world
-
-        # compute resolution
-        Qsize = float(render.resolution_x) / float(render.resolution_y)
-
-        file.write('camera {\n')
-        file.write('\tlocation  <0, 0, 0>\n')
-        file.write('\tlook_at  <0, 0, -1>\n')
-        file.write('\tright <%s, 0, 0>\n' % - Qsize)
-        file.write('\tup <0, 1, 0>\n')
-        file.write('\tangle  %f \n' % (360.0 * atan(16.0 / camera.data.lens) / pi))
-
-        file.write('\trotate  <%.6f, %.6f, %.6f>\n' % tuple([degrees(e) for e in matrix.rotation_part().to_euler()]))
-        file.write('\ttranslate <%.6f, %.6f, %.6f>\n' % (matrix[3][0], matrix[3][1], matrix[3][2]))
-        file.write('}\n')
-
-    def exportLamps(lamps):
-        # Get all lamps
-        for ob in lamps:
-            lamp = ob.data
-
-            matrix = ob.matrix_world
-
-            color = tuple([c * lamp.energy for c in lamp.color]) # Colour is modified by energy
-
-            file.write('light_source {\n')
-            file.write('\t< 0,0,0 >\n')
-            file.write('\tcolor rgb<%.3g, %.3g, %.3g>\n' % color)
-
-            if lamp.type == 'POINT': # Point Lamp
-                pass
-            elif lamp.type == 'SPOT': # Spot
-                file.write('\tspotlight\n')
-
-                # Falloff is the main radius from the centre line
-                file.write('\tfalloff %.2f\n' % (degrees(lamp.spot_size) / 2.0)) # 1 TO 179 FOR BOTH
-                file.write('\tradius %.6f\n' % ((degrees(lamp.spot_size) / 2.0) * (1.0 - lamp.spot_blend)))
-
-                # Blender does not have a tightness equivilent, 0 is most like blender default.
-                file.write('\ttightness 0\n') # 0:10f
-
-                file.write('\tpoint_at  <0, 0, -1>\n')
-            elif lamp.type == 'SUN':
-                file.write('\tparallel\n')
-                file.write('\tpoint_at  <0, 0, -1>\n') # *must* be after 'parallel'
-
-            elif lamp.type == 'AREA':
-
-                size_x = lamp.size
-                samples_x = lamp.shadow_ray_samples_x
-                if lamp.shape == 'SQUARE':
-                    size_y = size_x
-                    samples_y = samples_x
-                else:
-                    size_y = lamp.size_y
-                    samples_y = lamp.shadow_ray_samples_y
-
-                file.write('\tarea_light <%d,0,0>,<0,0,%d> %d, %d\n' % (size_x, size_y, samples_x, samples_y))
-                if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
-                    if lamp.jitter:
-                        file.write('\tjitter\n')
-                else:
-                    file.write('\tadaptive 1\n')
-                    file.write('\tjitter\n')
-
-            if lamp.shadow_method == 'NOSHADOW':
-                file.write('\tshadowless\n')
-
-            file.write('\tfade_distance %.6f\n' % lamp.distance)
-            file.write('\tfade_power %d\n' % 1) # Could use blenders lamp quad?
-            writeMatrix(matrix)
-
-            file.write('}\n')
-
-    def exportMeta(metas):
-
-        # TODO - blenders 'motherball' naming is not supported.
-
-        for ob in metas:
-            meta = ob.data
-
-            file.write('blob {\n')
-            file.write('\t\tthreshold %.4g\n' % meta.threshold)
-
-            try:
-                material = meta.materials[0] # lame! - blender cant do enything else.
-            except:
-                material = None
-
-            for elem in meta.elements:
-
-                if elem.type not in ('BALL', 'ELLIPSOID'):
-                    continue # Not supported
-
-                loc = elem.location
-
-                stiffness = elem.stiffness
-                if elem.negative:
-                    stiffness = - stiffness
-
-                if elem.type == 'BALL':
-
-                    file.write('\tsphere { <%.6g, %.6g, %.6g>, %.4g, %.4g ' % (loc.x, loc.y, loc.z, elem.radius, stiffness))
-
-                    # After this wecould do something simple like...
-                    #  "pigment {Blue} }"
-                    # except we'll write the color
-
-                elif elem.type == 'ELLIPSOID':
-                    # location is modified by scale
-                    file.write('\tsphere { <%.6g, %.6g, %.6g>, %.4g, %.4g ' % (loc.x / elem.size_x, loc.y / elem.size_y, loc.z / elem.size_z, elem.radius, stiffness))
-                    file.write('scale <%.6g, %.6g, %.6g> ' % (elem.size_x, elem.size_y, elem.size_z))
-
-                if material:
-                    diffuse_color = material.diffuse_color
-
-                    if material.transparency and material.transparency_method == 'RAYTRACE':
-                        trans = 1.0 - material.raytrace_transparency.filter
-                    else:
-                        trans = 0.0
-
-                    file.write('pigment {rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>} finish {%s} }\n' % \
-                        (diffuse_color[0], diffuse_color[1], diffuse_color[2], 1.0 - material.alpha, trans, materialNames[material.name]))
-
-                else:
-                    file.write('pigment {rgb<1 1 1>} finish {%s} }\n' % DEF_MAT_NAME)          # Write the finish last.
-
-            writeObjectMaterial(material)
-
-            writeMatrix(ob.matrix_world)
-
-            file.write('}\n')
-
-    def exportMeshs(scene, sel):
-
-        ob_num = 0
-
-        for ob in sel:
-            ob_num += 1
-
-            if ob.type in ('LAMP', 'CAMERA', 'EMPTY', 'META', 'ARMATURE'):
-                continue
-
-            me = ob.data
-            me_materials = me.materials
-
-            me = ob.create_mesh(scene, True, 'RENDER')
-
-            if not me:
-                continue
-
-            if info_callback:
-                info_callback('Object %2.d of %2.d (%s)' % (ob_num, len(sel), ob.name))
-
-            #if ob.type!='MESH':
-            #  continue
-            # me = ob.data
-
-            matrix = ob.matrix_world
-            try:
-                uv_layer = me.active_uv_texture.data
-            except:
-                uv_layer = None
-
-            try:
-                vcol_layer = me.active_vertex_color.data
-            except:
-                vcol_layer = None
-
-            faces_verts = [f.verts for f in me.faces]
-            faces_normals = [tuple(f.normal) for f in me.faces]
-            verts_normals = [tuple(v.normal) for v in me.verts]
-
-            # quads incur an extra face
-            quadCount = len([f for f in faces_verts if len(f) == 4])
-
-            file.write('mesh2 {\n')
-            file.write('\tvertex_vectors {\n')
-            file.write('\t\t%s' % (len(me.verts))) # vert count
-            for v in me.verts:
-                file.write(',\n\t\t<%.6f, %.6f, %.6f>' % tuple(v.co)) # vert count
-            file.write('\n  }\n')
-
-
-            # Build unique Normal list
-            uniqueNormals = {}
-            for fi, f in enumerate(me.faces):
-                fv = faces_verts[fi]
-                # [-1] is a dummy index, use a list so we can modify in place
-                if f.smooth: # Use vertex normals
-                    for v in fv:
-                        key = verts_normals[v]
-                        uniqueNormals[key] = [-1]
-                else: # Use face normal
-                    key = faces_normals[fi]
-                    uniqueNormals[key] = [-1]
-
-            file.write('\tnormal_vectors {\n')
-            file.write('\t\t%d' % len(uniqueNormals)) # vert count
-            idx = 0
-            for no, index in uniqueNormals.items():
-                file.write(',\n\t\t<%.6f, %.6f, %.6f>' % no) # vert count
-                index[0] = idx
-                idx += 1
-            file.write('\n  }\n')
-
-
-            # Vertex colours
-            vertCols = {} # Use for material colours also.
-
-            if uv_layer:
-                # Generate unique UV's
-                uniqueUVs = {}
-
-                for fi, uv in enumerate(uv_layer):
-
-                    if len(faces_verts[fi]) == 4:
-                        uvs = uv.uv1, uv.uv2, uv.uv3, uv.uv4
-                    else:
-                        uvs = uv.uv1, uv.uv2, uv.uv3
-
-                    for uv in uvs:
-                        uniqueUVs[tuple(uv)] = [-1]
-
-                file.write('\tuv_vectors {\n')
-                #print unique_uvs
-                file.write('\t\t%s' % (len(uniqueUVs))) # vert count
-                idx = 0
-                for uv, index in uniqueUVs.items():
-                    file.write(',\n\t\t<%.6f, %.6f>' % uv)
-                    index[0] = idx
-                    idx += 1
-                '''
-                else:
-                    # Just add 1 dummy vector, no real UV's
-                    file.write('\t\t1') # vert count
-                    file.write(',\n\t\t<0.0, 0.0>')
-                '''
-                file.write('\n  }\n')
-
-
-            if me.vertex_colors:
-
-                for fi, f in enumerate(me.faces):
-                    material_index = f.material_index
-                    material = me_materials[material_index]
-
-                    if material and material.vertex_color_paint:
-
-                        col = vcol_layer[fi]
-
-                        if len(faces_verts[fi]) == 4:
-                            cols = col.color1, col.color2, col.color3, col.color4
-                        else:
-                            cols = col.color1, col.color2, col.color3
-
-                        for col in cols:
-                            key = col[0], col[1], col[2], material_index # Material index!
-                            vertCols[key] = [-1]
-
-                    else:
-                        if material:
-                            diffuse_color = tuple(material.diffuse_color)
-                            key = diffuse_color[0], diffuse_color[1], diffuse_color[2], material_index
-                            vertCols[key] = [-1]
-
-
-            else:
-                # No vertex colours, so write material colours as vertex colours
-                for i, material in enumerate(me_materials):
-
-                    if material:
-                        diffuse_color = tuple(material.diffuse_color)
-                        key = diffuse_color[0], diffuse_color[1], diffuse_color[2], i # i == f.mat
-                        vertCols[key] = [-1]
-
-
-            # Vert Colours
-            file.write('\ttexture_list {\n')
-            file.write('\t\t%s' % (len(vertCols))) # vert count
-            idx = 0
-            for col, index in vertCols.items():
-
-                if me_materials:
-                    material = me_materials[col[3]]
-                    material_finish = materialNames[material.name]
-
-                    if material.transparency and material.transparency_method == 'RAYTRACE':
-                        trans = 1.0 - material.raytrace_transparency.filter
-                    else:
-                        trans = 0.0
-
-                else:
-                    material_finish = DEF_MAT_NAME # not working properly,
-                    trans = 0.0
-
-                #print material.apl
-                file.write(',\n\t\ttexture { pigment {rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>} finish {%s}}' %
-                            (col[0], col[1], col[2], 1.0 - material.alpha, trans, material_finish))
-
-                index[0] = idx
-                idx += 1
-
-            file.write('\n  }\n')
-
-            # Face indicies
-            file.write('\tface_indices {\n')
-            file.write('\t\t%d' % (len(me.faces) + quadCount)) # faces count
-            for fi, f in enumerate(me.faces):
-                fv = faces_verts[fi]
-                material_index = f.material_index
-                if len(fv) == 4:
-                    indicies = (0, 1, 2), (0, 2, 3)
-                else:
-                    indicies = ((0, 1, 2),)
-
-                if vcol_layer:
-                    col = vcol_layer[fi]
-
-                    if len(fv) == 4:
-                        cols = col.color1, col.color2, col.color3, col.color4
-                    else:
-                        cols = col.color1, col.color2, col.color3
-
-
-                if not me_materials or me_materials[material_index] == None: # No materials
-                    for i1, i2, i3 in indicies:
-                        file.write(',\n\t\t<%d,%d,%d>' % (fv[i1], fv[i2], fv[i3])) # vert count
-                else:
-                    material = me_materials[material_index]
-                    for i1, i2, i3 in indicies:
-                        if me.vertex_colors and material.vertex_color_paint:
-                            # Colour per vertex - vertex colour
-
-                            col1 = cols[i1]
-                            col2 = cols[i2]
-                            col3 = cols[i3]
-
-                            ci1 = vertCols[col1[0], col1[1], col1[2], material_index][0]
-                            ci2 = vertCols[col2[0], col2[1], col2[2], material_index][0]
-                            ci3 = vertCols[col3[0], col3[1], col3[2], material_index][0]
-                        else:
-                            # Colour per material - flat material colour
-                            diffuse_color = material.diffuse_color
-                            ci1 = ci2 = ci3 = vertCols[diffuse_color[0], diffuse_color[1], diffuse_color[2], f.material_index][0]
-
-                        file.write(',\n\t\t<%d,%d,%d>, %d,%d,%d' % (fv[i1], fv[i2], fv[i3], ci1, ci2, ci3)) # vert count
-
-
-            file.write('\n  }\n')
-
-            # normal_indices indicies
-            file.write('\tnormal_indices {\n')
-            file.write('\t\t%d' % (len(me.faces) + quadCount)) # faces count
-            for fi, fv in enumerate(faces_verts):
-
-                if len(fv) == 4:
-                    indicies = (0, 1, 2), (0, 2, 3)
-                else:
-                    indicies = ((0, 1, 2),)
-
-                for i1, i2, i3 in indicies:
-                    if f.smooth:
-                        file.write(',\n\t\t<%d,%d,%d>' %\
-                        (uniqueNormals[verts_normals[fv[i1]]][0],\
-                         uniqueNormals[verts_normals[fv[i2]]][0],\
-                         uniqueNormals[verts_normals[fv[i3]]][0])) # vert count
-                    else:
-                        idx = uniqueNormals[faces_normals[fi]][0]
-                        file.write(',\n\t\t<%d,%d,%d>' % (idx, idx, idx)) # vert count
-
-            file.write('\n  }\n')
-
-            if uv_layer:
-                file.write('\tuv_indices {\n')
-                file.write('\t\t%d' % (len(me.faces) + quadCount)) # faces count
-                for fi, fv in enumerate(faces_verts):
-
-                    if len(fv) == 4:
-                        indicies = (0, 1, 2), (0, 2, 3)
-                    else:
-                        indicies = ((0, 1, 2),)
-
-                    uv = uv_layer[fi]
-                    if len(faces_verts[fi]) == 4:
-                        uvs = tuple(uv.uv1), tuple(uv.uv2), tuple(uv.uv3), tuple(uv.uv4)
-                    else:
-                        uvs = tuple(uv.uv1), tuple(uv.uv2), tuple(uv.uv3)
-
-                    for i1, i2, i3 in indicies:
-                        file.write(',\n\t\t<%d,%d,%d>' %\
-                        (uniqueUVs[uvs[i1]][0],\
-                         uniqueUVs[uvs[i2]][0],\
-                         uniqueUVs[uvs[i2]][0])) # vert count
-                file.write('\n  }\n')
-
-            if me.materials:
-                material = me.materials[0] # dodgy
-                writeObjectMaterial(material)
-
-            writeMatrix(matrix)
-            file.write('}\n')
-
-            bpy.data.meshes.remove(me)
-
-    def exportWorld(world):
-        if not world:
-            return
-
-        mist = world.mist
-
-        if mist.use_mist:
-            file.write('fog {\n')
-            file.write('\tdistance %.6f\n' % mist.depth)
-            file.write('\tcolor rgbt<%.3g, %.3g, %.3g, %.3g>\n' % (tuple(world.horizon_color) + (1 - mist.intensity,)))
-            #file.write('\tfog_offset %.6f\n' % mist.start)
-            #file.write('\tfog_alt 5\n')
-            #file.write('\tturbulence 0.2\n')
-            #file.write('\tturb_depth 0.3\n')
-            file.write('\tfog_type 1\n')
-            file.write('}\n')
-
-    def exportGlobalSettings(scene):
-
-        file.write('global_settings {\n')
-
-        if scene.pov_radio_enable:
-            file.write('\tradiosity {\n')
-            file.write("\t\tadc_bailout %.4g\n" % scene.pov_radio_adc_bailout)
-            file.write("\t\talways_sample %d\n" % scene.pov_radio_always_sample)
-            file.write("\t\tbrightness %.4g\n" % scene.pov_radio_brightness)
-            file.write("\t\tcount %d\n" % scene.pov_radio_count)
-            file.write("\t\terror_bound %.4g\n" % scene.pov_radio_error_bound)
-            file.write("\t\tgray_threshold %.4g\n" % scene.pov_radio_gray_threshold)
-            file.write("\t\tlow_error_factor %.4g\n" % scene.pov_radio_low_error_factor)
-            file.write("\t\tmedia %d\n" % scene.pov_radio_media)
-            file.write("\t\tminimum_reuse %.4g\n" % scene.pov_radio_minimum_reuse)
-            file.write("\t\tnearest_count %d\n" % scene.pov_radio_nearest_count)
-            file.write("\t\tnormal %d\n" % scene.pov_radio_normal)
-            file.write("\t\trecursion_limit %d\n" % scene.pov_radio_recursion_limit)
-            file.write('\t}\n')
-
-        if world:
-            file.write("\tambient_light rgb<%.3g, %.3g, %.3g>\n" % tuple(world.ambient_color))
-
-        file.write('}\n')
-
-
-    # Convert all materials to strings we can access directly per vertex.
-    writeMaterial(None) # default material
-
-    for material in bpy.data.materials:
-        writeMaterial(material)
-
-    exportCamera()
-    #exportMaterials()
-    sel = scene.objects
-    exportLamps([l for l in sel if l.type == 'LAMP'])
-    exportMeta([l for l in sel if l.type == 'META'])
-    exportMeshs(scene, sel)
-    exportWorld(scene.world)
-    exportGlobalSettings(scene)
-
-    file.close()
-
-
-def write_pov_ini(filename_ini, filename_pov, filename_image):
-    scene = bpy.data.scenes[0]
-    render = scene.render
-
-    x = int(render.resolution_x * render.resolution_percentage * 0.01)
-    y = int(render.resolution_y * render.resolution_percentage * 0.01)
-
-    file = open(filename_ini, 'w')
-
-    file.write('Input_File_Name="%s"\n' % filename_pov)
-    file.write('Output_File_Name="%s"\n' % filename_image)
-
-    file.write('Width=%d\n' % x)
-    file.write('Height=%d\n' % y)
-
-    # Needed for border render.
-    '''
-    file.write('Start_Column=%d\n' % part.x)
-    file.write('End_Column=%d\n' % (part.x+part.w))
-
-    file.write('Start_Row=%d\n' % (part.y))
-    file.write('End_Row=%d\n' % (part.y+part.h))
-    '''
-
-    file.write('Display=0\n')
-    file.write('Pause_When_Done=0\n')
-    file.write('Output_File_Type=T\n') # TGA, best progressive loading
-    file.write('Output_Alpha=1\n')
-
-    if render.render_antialiasing:
-        aa_mapping = {'5': 2, '8': 3, '11': 4, '16': 5} # method 1 assumed
-        file.write('Antialias=1\n')
-        file.write('Antialias_Depth=%d\n' % aa_mapping[render.antialiasing_samples])
-    else:
-        file.write('Antialias=0\n')
-
-    file.close()
-
-# Radiosity panel, use in the scene for now.
-FloatProperty = bpy.types.Scene.FloatProperty
-IntProperty = bpy.types.Scene.IntProperty
-BoolProperty = bpy.types.Scene.BoolProperty
-
-# Not a real pov option, just to know if we should write
-BoolProperty(attr="pov_radio_enable",
-                name="Enable Radiosity",
-                description="Enable povrays radiosity calculation",
-                default=False)
-BoolProperty(attr="pov_radio_display_advanced",
-                name="Advanced Options",
-                description="Show advanced options",
-                default=False)
-
-# Real pov options
-FloatProperty(attr="pov_radio_adc_bailout",
-                name="ADC Bailout",
-                description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results",
-                min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.01)
-
-BoolProperty(attr="pov_radio_always_sample",
-                name="Always Sample",
-                description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass",
-                default=True)
-
-FloatProperty(attr="pov_radio_brightness",
-                name="Brightness",
-                description="Amount objects are brightened before being returned upwards to the rest of the system",
-                min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default=1.0)
-
-IntProperty(attr="pov_radio_count",
-                name="Ray Count",
-                description="Number of rays that are sent out whenever a new radiosity value has to be calculated",
-                min=1, max=1600, default=35)
-
-FloatProperty(attr="pov_radio_error_bound",
-                name="Error Bound",
-                description="One of the two main speed/quality tuning values, lower values are more accurate",
-                min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=1.8)
-
-FloatProperty(attr="pov_radio_gray_threshold",
-                name="Gray Threshold",
-                description="One of the two main speed/quality tuning values, lower values are more accurate",
-                min=0.0, max=1.0, soft_min=0, soft_max=1, default=0.0)
-
-FloatProperty(attr="pov_radio_low_error_factor",
-                name="Low Error Factor",
-                description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting",
-                min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.5)
-
-# max_sample - not available yet
-BoolProperty(attr="pov_radio_media",
-                name="Media",
-                description="Radiosity estimation can be affected by media",
-                default=False)
-
-FloatProperty(attr="pov_radio_minimum_reuse",
-                name="Minimum Reuse",
-                description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors)",
-                min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default=0.015)
-
-IntProperty(attr="pov_radio_nearest_count",
-                name="Nearest Count",
-                description="Number of old ambient values blended together to create a new interpolated value",
-                min=1, max=20, default=5)
-
-BoolProperty(attr="pov_radio_normal",
-                name="Normals",
-                description="Radiosity estimation can be affected by normals",
-                default=False)
-
-IntProperty(attr="pov_radio_recursion_limit",
-                name="Recursion Limit",
-                description="how many recursion levels are used to calculate the diffuse inter-reflection",
-                min=1, max=20, default=3)
-
-
-class PovrayRender(bpy.types.RenderEngine):
-    bl_idname = 'POVRAY_RENDER'
-    bl_label = "Povray"
-    DELAY = 0.02
-
-    def _export(self, scene):
-        import tempfile
-
-        self._temp_file_in = tempfile.mktemp(suffix='.pov')
-        self._temp_file_out = tempfile.mktemp(suffix='.tga')
-        self._temp_file_ini = tempfile.mktemp(suffix='.ini')
-        '''
-        self._temp_file_in = '/test.pov'
-        self._temp_file_out = '/test.tga'
-        self._temp_file_ini = '/test.ini'
-        '''
-
-        def info_callback(txt):
-            self.update_stats("", "POVRAY: " + txt)
-
-        write_pov(self._temp_file_in, scene, info_callback)
-
-    def _render(self):
-
-        try:
-            os.remove(self._temp_file_out) # so as not to load the old file
-        except:
-            pass
-
-        write_pov_ini(self._temp_file_ini, self._temp_file_in, self._temp_file_out)
-
-        print ("***-STARTING-***")
-
-        pov_binary = "povray"
-
-        if sys.platform == 'win32':
-            import winreg
-            regKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Software\\POV-Ray\\v3.6\\Windows')
-
-            if bitness == 64:
-                pov_binary = winreg.QueryValueEx(regKey, 'Home')[0] + '\\bin\\pvengine64'
-            else:
-                pov_binary = winreg.QueryValueEx(regKey, 'Home')[0] + '\\bin\\pvengine'
-
-        if 1:
-            # TODO, when povray isnt found this gives a cryptic error, would be nice to be able to detect if it exists
-            try:
-                self._process = subprocess.Popen([pov_binary, self._temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
-            except OSError:
-                # TODO, report api
-                print("POVRAY: could not execute '%s', possibly povray isn't installed" % pov_binary)
-                import traceback
-                traceback.print_exc()
-                print ("***-DONE-***")
-                return False
-
-        else:
-            # This works too but means we have to wait until its done
-            os.system('%s %s' % (pov_binary, self._temp_file_ini))
-
-        print ("***-DONE-***")
-        return True
-
-    def _cleanup(self):
-        for f in (self._temp_file_in, self._temp_file_ini, self._temp_file_out):
-            try:
-                os.remove(f)
-            except:
-                pass
-
-        self.update_stats("", "")
-
-    def render(self, scene):
-
-        self.update_stats("", "POVRAY: Exporting data from Blender")
-        self._export(scene)
-        self.update_stats("", "POVRAY: Parsing File")
-
-        if not self._render():
-            self.update_stats("", "POVRAY: Not found")
-            return
-
-        r = scene.render
-
-        # compute resolution
-        x = int(r.resolution_x * r.resolution_percentage * 0.01)
-        y = int(r.resolution_y * r.resolution_percentage * 0.01)
-
-        # Wait for the file to be created
-        while not os.path.exists(self._temp_file_out):
-            if self.test_break():
-                try:
-                    self._process.terminate()
-                except:
-                    pass
-                break
-
-            if self._process.poll() != None:
-                self.update_stats("", "POVRAY: Failed")
-                break
-
-            time.sleep(self.DELAY)
-
-        if os.path.exists(self._temp_file_out):
-
-            self.update_stats("", "POVRAY: Rendering")
-
-            prev_size = -1
-
-            def update_image():
-                result = self.begin_result(0, 0, x, y)
-                lay = result.layers[0]
-                # possible the image wont load early on.
-                try:
-                    lay.load_from_file(self._temp_file_out)
-                except:
-                    pass
-                self.end_result(result)
-
-            # Update while povray renders
-            while True:
-
-                # test if povray exists
-                if self._process.poll() is not None:
-                    update_image()
-                    break
-
-                # user exit
-                if self.test_break():
-                    try:
-                        self._process.terminate()
-                    except:
-                        pass
-
-                    break
-
-                # Would be nice to redirect the output
-                # stdout_value, stderr_value = self._process.communicate() # locks
-
-
-                # check if the file updated
-                new_size = os.path.getsize(self._temp_file_out)
-
-                if new_size != prev_size:
-                    update_image()
-                    prev_size = new_size
-
-                time.sleep(self.DELAY)
-
-        self._cleanup()
-
-
-# Use some of the existing buttons.
-import properties_render
-properties_render.RENDER_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
-properties_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('POVRAY_RENDER')
-properties_render.RENDER_PT_antialiasing.COMPAT_ENGINES.add('POVRAY_RENDER')
-properties_render.RENDER_PT_output.COMPAT_ENGINES.add('POVRAY_RENDER')
-del properties_render
-
-# Use only a subset of the world panels
-import properties_world
-properties_world.WORLD_PT_preview.COMPAT_ENGINES.add('POVRAY_RENDER')
-properties_world.WORLD_PT_context_world.COMPAT_ENGINES.add('POVRAY_RENDER')
-properties_world.WORLD_PT_world.COMPAT_ENGINES.add('POVRAY_RENDER')
-properties_world.WORLD_PT_mist.COMPAT_ENGINES.add('POVRAY_RENDER')
-del properties_world
-
-# Example of wrapping every class 'as is'
-import properties_material
-for member in dir(properties_material):
-    subclass = getattr(properties_material, member)
-    try:
-        subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
-    except:
-        pass
-del properties_material
-import properties_data_mesh
-for member in dir(properties_data_mesh):
-    subclass = getattr(properties_data_mesh, member)
-    try:
-        subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
-    except:
-        pass
-del properties_data_mesh
-import properties_texture
-for member in dir(properties_texture):
-    subclass = getattr(properties_texture, member)
-    try:
-        subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
-    except:
-        pass
-del properties_texture
-import properties_data_camera
-for member in dir(properties_data_camera):
-    subclass = getattr(properties_data_camera, member)
-    try:
-        subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
-    except:
-        pass
-del properties_data_camera
-
-
-class RenderButtonsPanel(bpy.types.Panel):
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = "render"
-    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
-
-    def poll(self, context):
-        rd = context.scene.render
-        return (rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES)
-
-
-class RENDER_PT_povray_radiosity(RenderButtonsPanel):
-    bl_label = "Radiosity"
-    COMPAT_ENGINES = {'POVRAY_RENDER'}
-
-    def draw_header(self, context):
-        scene = context.scene
-
-        self.layout.prop(scene, "pov_radio_enable", text="")
-
-    def draw(self, context):
-        layout = self.layout
-
-        scene = context.scene
-        rd = scene.render
-
-        layout.active = scene.pov_radio_enable
-
-        split = layout.split()
-
-        col = split.column()
-        col.prop(scene, "pov_radio_count", text="Rays")
-        col.prop(scene, "pov_radio_recursion_limit", text="Recursions")
-        col = split.column()
-        col.prop(scene, "pov_radio_error_bound", text="Error")
-
-        layout.prop(scene, "pov_radio_display_advanced")
-
-        if scene.pov_radio_display_advanced:
-            split = layout.split()
-
-            col = split.column()
-            col.prop(scene, "pov_radio_adc_bailout", slider=True)
-            col.prop(scene, "pov_radio_gray_threshold", slider=True)
-            col.prop(scene, "pov_radio_low_error_factor", slider=True)
-
-            col = split.column()
-            col.prop(scene, "pov_radio_brightness")
-            col.prop(scene, "pov_radio_minimum_reuse", text="Min Reuse")
-            col.prop(scene, "pov_radio_nearest_count")
-
-            split = layout.split()
-
-            col = split.column()
-            col.label(text="Estimation Influence:")
-            col.prop(scene, "pov_radio_media")
-            col.prop(scene, "pov_radio_normal")
-
-            col = split.column()
-            col.prop(scene, "pov_radio_always_sample")
-
-
-classes = [
-    PovrayRender,
-    RENDER_PT_povray_radiosity]
-
-
-def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
-
-
-def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
-
-if __name__ == "__main__":
-    register()
index 6b776c77a7a7a8ae1e8e0fd7d0e96986ce287d86..702edc6ae70bad8c8c0b45beb7fb4808fbc4d81b 100644 (file)
@@ -922,7 +922,7 @@ def make_kf_obj_node(obj, name_to_id):
 """
 
 # import BPyMessages
-def save_3ds(filename, context):
+def write(filename, context):
     '''Save the Blender scene to a 3ds file.'''
     # Time the export
 
@@ -941,7 +941,8 @@ def save_3ds(filename, context):
     sce = context.scene
 #      sce= bpy.data.scenes.active
 
-    bpy.ops.object.mode_set(mode='OBJECT')
+    if context.object:
+        bpy.ops.object.mode_set(mode='OBJECT')
 
     # Initialize the main chunk (primary):
     primary = _3ds_chunk(PRIMARY)
@@ -1106,12 +1107,7 @@ def save_3ds(filename, context):
     #primary.dump()
 
 
-# if __name__=='__main__':
-#     if struct:
-#         Blender.Window.FileSelector(save_3ds, "Export 3DS", Blender.sys.makename(ext='.3ds'))
-#     else:
-#         Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
-# # save_3ds('/test_b.3ds')
+# # write('/test_b.3ds')
 from bpy.props import *
 class Export3DS(bpy.types.Operator):
     '''Export to 3DS file format (.3ds)'''
@@ -1126,7 +1122,10 @@ class Export3DS(bpy.types.Operator):
     check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
 
     def execute(self, context):
-        save_3ds(self.properties.filepath, context)
+        filepath = self.properties.filepath
+        filepath = bpy.path.ensure_ext(filepath, ".3ds")
+
+        write(filepath, context)
         return {'FINISHED'}
 
     def invoke(self, context, event):
@@ -1134,10 +1133,10 @@ class Export3DS(bpy.types.Operator):
         wm.add_fileselect(self)
         return {'RUNNING_MODAL'}
 
-    def poll(self, context): # Poll isnt working yet
+    @staticmethod
+    def poll(context): # Poll isnt working yet
         return context.active_object != None
 
-
 # Add to a menu
 def menu_func(self, context):
     default_path = os.path.splitext(bpy.data.filepath)[0] + ".3ds"
@@ -1145,11 +1144,9 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(Export3DS)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(Export3DS)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":
index b68d6fafafa4ac54e5d582423064dcd289bb5efc..14116058f4485e6b7f99d51c41dfa47128a535be 100644 (file)
@@ -75,7 +75,7 @@ def copy_images(dest_dir, textures):
 
     image_paths = set()
     for tex in textures:
-        image_paths.add(bpy.utils.expandpath(tex.filepath))
+        image_paths.add(bpy.path.abspath(tex.filepath))
 
     # Now copy images
     copyCount = 0
@@ -176,7 +176,7 @@ def sane_name(data, dct):
         name = 'unnamed' # blank string, ASKING FOR TROUBLE!
     else:
 
-        name = bpy.utils.clean_name(name) # use our own
+        name = bpy.path.clean_name(name) # use our own
 
     while name in iter(dct.values()):  name = increment_string(name)
 
@@ -200,14 +200,14 @@ def sane_groupname(data): return sane_name(data, sane_name_mapping_group)
 #      FORCE_CWD - dont use the basepath, just add a ./ to the filename.
 #              use when we know the file will be in the basepath.
 #      '''
-#      fname = bpy.utils.expandpath(fname_orig)
+#      fname = bpy.path.abspath(fname_orig)
 # #    fname = Blender.sys.expandpath(fname_orig)
 #      fname_strip = os.path.basename(fname)
 # #    fname_strip = strip_path(fname)
 #      if FORCE_CWD:
 #              fname_rel = '.' + os.sep + fname_strip
 #      else:
-#              fname_rel = bpy.utils.relpath(fname, basepath)
+#              fname_rel = bpy.path.relpath(fname, basepath)
 # #            fname_rel = Blender.sys.relpath(fname, basepath)
 #      if fname_rel.startswith('//'): fname_rel = '.' + os.sep + fname_rel[2:]
 #      return fname, fname_strip, fname_rel
@@ -305,7 +305,8 @@ def write(filename, batch_objects = None, \
         BATCH_OWN_DIR =                                False
     ):
 
-    bpy.ops.object.mode_set(mode='OBJECT')
+    if bpy.context.object:
+        bpy.ops.object.mode_set(mode='OBJECT')
 
     # ----------------- Batch support!
     if BATCH_ENABLE:
@@ -353,8 +354,8 @@ def write(filename, batch_objects = None, \
 
         new_fbxpath = fbxpath # own dir option modifies, we need to keep an original
         for data in data_seq: # scene or group
-            newname = BATCH_FILE_PREFIX + bpy.utils.clean_name(data.name)
-#                      newname = BATCH_FILE_PREFIX + BPySys.bpy.utils.clean_name(data.name)
+            newname = BATCH_FILE_PREFIX + bpy.path.clean_name(data.name)
+#                      newname = BATCH_FILE_PREFIX + BPySys.bpy.path.clean_name(data.name)
 
 
             if BATCH_OWN_DIR:
@@ -1249,7 +1250,7 @@ def write(filename, batch_objects = None, \
         file.write('\n\t}')
 
     def copy_image(image):
-        fn = bpy.utils.expandpath(image.filepath)
+        fn = bpy.path.abspath(image.filepath)
         fn_strip = os.path.basename(fn)
 
         if EXP_IMAGE_COPY:
@@ -3360,20 +3361,24 @@ class ExportFBX(bpy.types.Operator):
     BATCH_FILE_PREFIX = StringProperty(name="Prefix", description="Prefix each file with this name", maxlen=1024, default="")
 
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return context.active_object
 
     def execute(self, context):
         if not self.properties.filepath:
             raise Exception("filepath not set")
 
+        filepath = self.properties.filepath
+        filepath = bpy.path.ensure_ext(filepath, ".fbx")
+
         GLOBAL_MATRIX = mtx4_identity
         GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.properties.TX_SCALE
         if self.properties.TX_XROT90: GLOBAL_MATRIX = mtx4_x90n * GLOBAL_MATRIX
         if self.properties.TX_YROT90: GLOBAL_MATRIX = mtx4_y90n * GLOBAL_MATRIX
         if self.properties.TX_ZROT90: GLOBAL_MATRIX = mtx4_z90n * GLOBAL_MATRIX
 
-        write(self.properties.filepath,
+        write(filepath,
               None, # XXX
               context,
               self.properties.EXP_OBS_SELECTED,
@@ -3393,7 +3398,8 @@ class ExportFBX(bpy.types.Operator):
               self.properties.BATCH_ENABLE,
               self.properties.BATCH_GROUP,
               self.properties.BATCH_FILE_PREFIX,
-              self.properties.BATCH_OWN_DIR)
+              self.properties.BATCH_OWN_DIR,
+              )
 
         return {'FINISHED'}
 
@@ -3411,7 +3417,7 @@ class ExportFBX(bpy.types.Operator):
 
 # NOTES (all line numbers correspond to original export_fbx.py (under release/scripts)
 # - Draw.PupMenu alternative in 2.5?, temporarily replaced PupMenu with print
-# - get rid of bpy.utils.clean_name somehow
+# - get rid of bpy.path.clean_name somehow
 # + fixed: isinstance(inst, bpy.types.*) doesn't work on RNA objects: line 565
 # + get rid of BPyObject_getObjectArmature, move it in RNA?
 # - BATCH_ENABLE and BATCH_GROUP options: line 327
@@ -3426,7 +3432,7 @@ class ExportFBX(bpy.types.Operator):
 # - bpy.data.remove_scene: line 366
 # - bpy.sys.time move to bpy.sys.util?
 # - new scene creation, activation: lines 327-342, 368
-# - uses bpy.utils.expandpath, *.relpath - replace at least relpath
+# - uses bpy.path.abspath, *.relpath - replace at least relpath
 
 # SMALL or COSMETICAL
 # - find a way to get blender version, and put it in bpy.util?, old was Blender.Get('version')
@@ -3438,12 +3444,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportFBX)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(ExportFBX)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":
index d2e53070910b64271198f859fd3967f6bf18275a..46b38c3c9e6c2a567541decf43725ed50d7b115c 100644 (file)
@@ -165,15 +165,23 @@ class ExportMDD(bpy.types.Operator):
     frame_start = IntProperty(name="Start Frame", description="Start frame for baking", min=minframe, max=maxframe, default=1)
     frame_end = IntProperty(name="End Frame", description="End frame for baking", min=minframe, max=maxframe, default=250)
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         ob = context.active_object
         return (ob and ob.type == 'MESH')
 
     def execute(self, context):
-        if not self.properties.filepath:
-            raise Exception("filename not set")
-        write(self.properties.filepath, context.scene, context.active_object,
-            self.properties.frame_start, self.properties.frame_end, self.properties.fps)
+        filepath = self.properties.filepath
+        filepath = bpy.path.ensure_ext(filepath, ".mdd")
+        
+        write(filepath,
+              context.scene,
+              context.active_object,
+              self.properties.frame_start,
+              self.properties.frame_end,
+              self.properties.fps,
+              )
+
         return {'FINISHED'}
 
     def invoke(self, context, event):
@@ -189,12 +197,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportMDD)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(ExportMDD)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":
index 6b47f6ddb54b53e5f63f66defbbd8033e9323bc4..fa378d26878e3c0d88f68bd4c97901bae203cce8 100644 (file)
 
 # <pep8 compliant>
 
-"""
-Name: 'Wavefront (.obj)...'
-Blender: 248
-Group: 'Export'
-Tooltip: 'Save a Wavefront OBJ File'
-"""
-
 __author__ = "Campbell Barton, Jiri Hnidek, Paolo Ciccone"
 __url__ = ['http://wiki.blender.org/index.php/Scripts/Manual/Export/wavefront_obj', 'www.blender.org', 'blenderartists.org']
 __version__ = "1.21"
@@ -73,7 +66,7 @@ def write_mtl(scene, filepath, copy_images, mtl_dict):
     dest_dir = os.path.dirname(filepath)
 
     def copy_image(image):
-        fn = bpy.utils.expandpath(image.filepath)
+        fn = bpy.path.abspath(image.filepath)
         fn_strip = os.path.basename(fn)
         if copy_images:
             rel = fn_strip
@@ -189,7 +182,7 @@ def copy_images(dest_dir):
     copyCount = 0
 
 #      for bImage in uniqueImages.values():
-#              image_path = bpy.utils.expandpath(bImage.filepath)
+#              image_path = bpy.path.abspath(bImage.filepath)
 #              if bpy.sys.exists(image_path):
 #                      # Make a name for the target path.
 #                      dest_image_path = dest_dir + image_path.split('\\')[-1].split('/')[-1]
@@ -634,7 +627,7 @@ def write(filepath, objects, scene,
 #                                      for vIdx, vWeight in me.getVertsFromGroup(vertexGroupName, 1):
                         vgroupsMap[vIdx].append((g.name, vWeight))
 
-            for f_index, f in enumerate(faces):
+            for f, f_index in face_index_pairs:
                 f_v = [{"index": index, "vertex": me.verts[index]} for index in f.verts]
 
                 # if f.verts[3] == 0:
@@ -646,7 +639,7 @@ def write(filepath, objects, scene,
 #                              f_mat = min(f.mat, len(materialNames)-1)
                 if faceuv:
 
-                    tface = me.active_uv_texture.data[face_index_pairs[f_index][1]]
+                    tface = me.active_uv_texture.data[f_index]
 
                     f_image = tface.image
                     f_uv = tface.uv
@@ -797,7 +790,7 @@ def write(filepath, objects, scene,
     print("OBJ Export time: %.2f" % (time.clock() - time1))
 #      print "OBJ Export time: %.2f" % (sys.time() - time1)
 
-def do_export(filepath, context,
+def write(filepath, context,
               EXPORT_APPLY_MODIFIERS = True, # not used
               EXPORT_ROTX90 = True, # wrong
               EXPORT_TRI = False, # ok
@@ -823,7 +816,8 @@ def do_export(filepath, context,
     orig_scene = context.scene
 
     # Exit edit mode before exporting, so current object states are exported properly.
-    bpy.ops.object.mode_set(mode='OBJECT')
+    if context.object:
+        bpy.ops.object.mode_set(mode='OBJECT')
 
 #      if EXPORT_ALL_SCENES:
 #              export_scenes = bpy.data.scenes
@@ -843,7 +837,7 @@ def do_export(filepath, context,
         orig_frame = scn.frame_current
 
         if EXPORT_ALL_SCENES: # Add scene name into the context_name
-            context_name[1] = '_%s' % bpy.utils.clean_name(scn.name) # WARNING, its possible that this could cause a collision. we could fix if were feeling parranoied.
+            context_name[1] = '_%s' % bpy.path.clean_name(scn.name) # WARNING, its possible that this could cause a collision. we could fix if were feeling parranoied.
 
         # Export an animation?
         if EXPORT_ANIMATION:
@@ -933,27 +927,27 @@ class ExportOBJ(bpy.types.Operator):
     def execute(self, context):
 
         filepath = self.properties.filepath
-        if not filepath.lower().endswith(".obj"):
-            filepath += ".obj"
-
-        do_export(filepath, context,
-                  EXPORT_TRI=self.properties.use_triangles,
-                  EXPORT_EDGES=self.properties.use_edges,
-                  EXPORT_NORMALS=self.properties.use_normals,
-                  EXPORT_NORMALS_HQ=self.properties.use_hq_normals,
-                  EXPORT_UV=self.properties.use_uvs,
-                  EXPORT_MTL=self.properties.use_materials,
-                  EXPORT_COPY_IMAGES=self.properties.copy_images,
-                  EXPORT_APPLY_MODIFIERS=self.properties.use_modifiers,
-                  EXPORT_ROTX90=self.properties.use_rotate90,
-                  EXPORT_BLEN_OBS=self.properties.use_blen_objects,
-                  EXPORT_GROUP_BY_OB=self.properties.group_by_object,
-                  EXPORT_GROUP_BY_MAT=self.properties.group_by_material,
-                  EXPORT_KEEP_VERT_ORDER=self.properties.keep_vertex_order,
-                  EXPORT_POLYGROUPS=self.properties.use_vertex_groups,
-                  EXPORT_CURVE_AS_NURBS=self.properties.use_nurbs,
-                  EXPORT_SEL_ONLY=self.properties.use_selection,
-                  EXPORT_ALL_SCENES=self.properties.use_all_scenes)
+        filepath = bpy.path.ensure_ext(filepath, ".obj")
+
+        write(filepath, context,
+              EXPORT_TRI=self.properties.use_triangles,
+              EXPORT_EDGES=self.properties.use_edges,
+              EXPORT_NORMALS=self.properties.use_normals,
+              EXPORT_NORMALS_HQ=self.properties.use_hq_normals,
+              EXPORT_UV=self.properties.use_uvs,
+              EXPORT_MTL=self.properties.use_materials,
+              EXPORT_COPY_IMAGES=self.properties.copy_images,
+              EXPORT_APPLY_MODIFIERS=self.properties.use_modifiers,
+              EXPORT_ROTX90=self.properties.use_rotate90,
+              EXPORT_BLEN_OBS=self.properties.use_blen_objects,
+              EXPORT_GROUP_BY_OB=self.properties.group_by_object,
+              EXPORT_GROUP_BY_MAT=self.properties.group_by_material,
+              EXPORT_KEEP_VERT_ORDER=self.properties.keep_vertex_order,
+              EXPORT_POLYGROUPS=self.properties.use_vertex_groups,
+              EXPORT_CURVE_AS_NURBS=self.properties.use_nurbs,
+              EXPORT_SEL_ONLY=self.properties.use_selection,
+              EXPORT_ALL_SCENES=self.properties.use_all_scenes,
+              )
 
         return {'FINISHED'}
 
@@ -969,11 +963,9 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportOBJ)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(ExportOBJ)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 
index 0b936bdceb2e223dfe36cf024d59d4f3b9b9c9af..aacfa6d07b2e96fc306423fa9cc265104c549c09 100644 (file)
@@ -99,7 +99,8 @@ def write(filename, scene, ob, \
 
     Window.WaitCursor(1)
     """
-    bpy.ops.object.mode_set(mode='OBJECT')
+    if scene.objects.active:
+        bpy.ops.object.mode_set(mode='OBJECT')
 
     #mesh = BPyMesh.getMeshFromObject(ob, None, EXPORT_APPLY_MODIFIERS, False, scn) # XXX
     if EXPORT_APPLY_MODIFIERS:
@@ -274,16 +275,15 @@ class ExportPLY(bpy.types.Operator):
     use_uvs = BoolProperty(name="UVs", description="Exort the active UV layer", default=True)
     use_colors = BoolProperty(name="Vertex Colors", description="Exort the active vertex color layer", default=True)
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return context.active_object != None
 
     def execute(self, context):
-        # print("Selected: " + context.active_object.name)
+        filepath = self.properties.filepath
+        filepath = bpy.path.ensure_ext(filepath, ".ply")
 
-        if not self.properties.filepath:
-            raise Exception("filename not set")
-
-        write(self.properties.filepath, context.scene, context.active_object,\
+        write(filepath, context.scene, context.active_object,\
             EXPORT_APPLY_MODIFIERS=self.properties.use_modifiers,
             EXPORT_NORMALS=self.properties.use_normals,
             EXPORT_UV=self.properties.use_uvs,
@@ -316,12 +316,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportPLY)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(ExportPLY)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":
index 1bad80f6d8e778ecbe33a2caaaf539b3d0bafc61..5fe48a2550a45373ddadeb8908cefc43d3f5677b 100644 (file)
@@ -794,7 +794,7 @@ class x3d_class:
             pic = tex.image
 
             # using .expandpath just in case, os.path may not expect //
-            basename = os.path.basename(bpy.utils.expandpath(pic.filepath))
+            basename = os.path.basename(bpy.path.abspath(pic.filepath))
 
             pic = alltextures[i].image
             # pic = alltextures[i].getImage()
@@ -1140,7 +1140,7 @@ class x3d_class:
 # Callbacks, needed before Main
 ##########################################################
 
-def x3d_export(filename,
+def write(filename,
                context,
                EXPORT_APPLY_MODIFIERS=False,
                EXPORT_TRI=False,
@@ -1156,8 +1156,9 @@ def x3d_export(filename,
 
     scene = context.scene
     world = scene.world
-    
-    bpy.ops.object.mode_set(mode='OBJECT')
+
+    if scene.objects.active:
+        bpy.ops.object.mode_set(mode='OBJECT')
 
     # XXX these are global textures while .Get() returned only scene's?
     alltextures = bpy.data.textures
@@ -1174,47 +1175,6 @@ def x3d_export(filename,
         )
 
 
-def x3d_export_ui(filename):
-    if not filename.endswith(extension):
-        filename += extension
-    #if _safeOverwrite and sys.exists(filename):
-    #  result = Draw.PupMenu("File Already Exists, Overwrite?%t|Yes%x1|No%x0")
-    #if(result != 1):
-    #  return
-
-    # Get user options
-    EXPORT_APPLY_MODIFIERS = Draw.Create(1)
-    EXPORT_TRI = Draw.Create(0)
-    EXPORT_GZIP = Draw.Create( filename.lower().endswith('.x3dz') )
-
-    # Get USER Options
-    pup_block = [\
-    ('Apply Modifiers', EXPORT_APPLY_MODIFIERS, 'Use transformed mesh data from each object.'),\
-    ('Triangulate', EXPORT_TRI, 'Triangulate quads.'),\
-    ('Compress', EXPORT_GZIP, 'GZip the resulting file, requires a full python install'),\
-    ]
-
-    if not Draw.PupBlock('Export...', pup_block):
-        return
-
-    Blender.Window.EditMode(0)
-    Blender.Window.WaitCursor(1)
-
-    x3d_export(filename,\
-        EXPORT_APPLY_MODIFIERS = EXPORT_APPLY_MODIFIERS.val,\
-        EXPORT_TRI = EXPORT_TRI.val,\
-        EXPORT_GZIP = EXPORT_GZIP.val\
-    )
-
-    Blender.Window.WaitCursor(0)
-
-
-
-#########################################################
-# main routine
-#########################################################
-
-
 from bpy.props import *
 
 class ExportX3D(bpy.types.Operator):
@@ -1232,7 +1192,16 @@ class ExportX3D(bpy.types.Operator):
     compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install", default=False)
 
     def execute(self, context):
-        x3d_export(self.properties.filepath, context, self.properties.apply_modifiers, self.properties.triangulate, self.properties.compress)
+        filepath = self.properties.filepath
+        filepath = bpy.path.ensure_ext(filepath, ".x3d")
+
+        write(filepath,
+                   context,
+                   self.properties.apply_modifiers,
+                   self.properties.triangulate,
+                   self.properties.compress,
+                   )
+
         return {'FINISHED'}
 
     def invoke(self, context, event):
@@ -1247,11 +1216,9 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportX3D)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(ExportX3D)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 # NOTES
index 89097fd53f59ecbbc659ac1dbadcc3b82194aee1..ba9b8a1f91d79b159bff2c4d7471158ad47afc19 100644 (file)
@@ -612,12 +612,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(BvhImporter)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(BvhImporter)
     bpy.types.INFO_MT_file_import.remove(menu_func)
 
 if __name__ == "__main__":
index 7b3004d4f52084f8b00de5c419608df0752f6ab0..fe242ca1f292a9c4583f0c0e5b56e3ecbe76219e 100644 (file)
@@ -883,14 +883,12 @@ def load_3ds(filename, context, IMPORT_CONSTRAIN_BOUNDS=10.0, IMAGE_SEARCH=True,
 
     # REMOVE DUMMYVERT, - remove this in the next release when blenders internal are fixed.
 
-
-#      for ob in importedObjects:
-#              if ob.type == 'MESH':
-# #            if ob.type=='Mesh':
-#                      me = ob.getData(mesh=1)
-#                      me.verts.delete([me.verts[0],])
-#                      if not APPLY_MATRIX:
-#                              me.transform(ob.matrix_world.copy().invert())
+    for ob in importedObjects:
+        if ob.type == 'MESH':
+            me = ob.data
+#           me.verts.delete([me.verts[0],]) # XXX, todo
+            if not APPLY_MATRIX:
+                me.transform(ob.matrix_world.copy().invert())
 
     # Done DUMMYVERT
     """
@@ -1009,15 +1007,19 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
 
     # List of operator properties, the attributes will be assigned
     # to the class instance from the operator settings before calling.
-
     filepath = StringProperty(name="File Path", description="Filepath used for importing the 3DS file", maxlen= 1024, default= "")
 
-#      size_constraint = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0),
-#      search_images = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True),
-#      apply_matrix = BoolProperty(name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
+    constrain_size = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0)
+    search_images = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True)
+    apply_transform = BoolProperty(name="Apply Transform", description="Workaround for object transformations importing incorrectly", default=False)
 
     def execute(self, context):
-        load_3ds(self.properties.filepath, context, 0.0, False, False)
+        load_3ds(self.properties.filepath,
+                 context,
+                 IMPORT_CONSTRAIN_BOUNDS=self.properties.constrain_size,
+                 IMAGE_SEARCH=self.properties.search_images,
+                 APPLY_MATRIX=self.properties.apply_transform)
+
         return {'FINISHED'}
 
     def invoke(self, context, event):
@@ -1030,11 +1032,9 @@ def menu_func(self, context):
     self.layout.operator(IMPORT_OT_autodesk_3ds.bl_idname, text="3D Studio (.3ds)")
 
 def register():
-    bpy.types.register(IMPORT_OT_autodesk_3ds)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(IMPORT_OT_autodesk_3ds)
     bpy.types.INFO_MT_file_import.remove(menu_func)
 
 # NOTES:
index 5b29a5ded909ab21e6e34f94a8b174bd965fbef0..e832489a56020f238bbedcc0f496691d893a553d 100644 (file)
@@ -1606,11 +1606,9 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(IMPORT_OT_obj)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(IMPORT_OT_obj)
     bpy.types.INFO_MT_file_import.remove(menu_func)
 
 
index ec0e7696630abd333e9ac07d21160be6e8a1dcfe..3245decc806f045763ce8b022925814c7ba7cb88 100644 (file)
@@ -120,7 +120,8 @@ class importMDD(bpy.types.Operator):
     #fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default=25)
     frame_start = IntProperty(name="Start Frame", description="Start frame for inserting animation", min=minframe, max=maxframe, default=0)
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         ob = context.active_object
         return (ob and ob.type == 'MESH')
 
@@ -143,12 +144,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(importMDD)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(importMDD)
     bpy.types.INFO_MT_file_import.remove(menu_func)
 
 if __name__ == "__main__":
index 43f3094e628e227b25d1ddcdb76fc90348969e42..5a705e95aa82393030a3c00a3b6af3a1339f01d2 100644 (file)
 
 # This directory is a Python package.
 
-from netrender import model
-from netrender import operators
-from netrender import client
-from netrender import slave
-from netrender import master
-from netrender import master_html
-from netrender import utils
-from netrender import balancing
-from netrender import ui
-from netrender import repath
+# To support reload properly, try to access a package var, if it's there, reload everything
+try:
+    init_data
+
+    reload(model)
+    reload(operators)
+    reload(client)
+    reload(slave)
+    reload(master)
+    reload(master_html)
+    reload(utils)
+    reload(balancing)
+    reload(ui)
+    reload(repath)
+except:
+    from netrender import model
+    from netrender import operators
+    from netrender import client
+    from netrender import slave
+    from netrender import master
+    from netrender import master_html
+    from netrender import utils
+    from netrender import balancing
+    from netrender import ui
+    from netrender import repath
 
 jobs = []
 slaves = []
@@ -38,14 +53,10 @@ init_data = True
 init_address = True
 
 def register():
-    pass # TODO
+    ui.addProperties()
+    
 
 def unregister():
     import bpy
-
     bpy.types.Scene.RemoveProperty("network_render")
 
-    bpy.types.unregister(ui.NetRenderJob)
-    bpy.types.unregister(ui.NetRenderSettings)
-    bpy.types.unregister(ui.NetRenderSlave)
-
index 9f6d1a7639e3fe39b3916f7b7ff5792e03acabf9..4a116bb982a478a658deed5f1f36075d1c8effe7 100644 (file)
@@ -49,7 +49,7 @@ def addPointCache(job, ob, point_cache, default_path):
     if name == "":
         name = "".join(["%02X" % ord(c) for c in ob.name])
 
-    cache_path = bpy.utils.expandpath(point_cache.filepath) if point_cache.external else default_path
+    cache_path = bpy.path.abspath(point_cache.filepath) if point_cache.external else default_path
 
     index = "%02i" % point_cache.index
 
@@ -113,7 +113,7 @@ def clientSendJob(conn, scene, anim = False):
     # LIBRARIES
     ###########################
     for lib in bpy.data.libraries:
-        file_path = bpy.utils.expandpath(lib.filepath)
+        file_path = bpy.path.abspath(lib.filepath)
         if os.path.exists(file_path):
             job.addFile(file_path)
 
@@ -122,7 +122,7 @@ def clientSendJob(conn, scene, anim = False):
     ###########################
     for image in bpy.data.images:
         if image.source == "FILE" and not image.packed_file:
-            file_path = bpy.utils.expandpath(image.filepath)
+            file_path = bpy.path.abspath(image.filepath)
             if os.path.exists(file_path):
                 job.addFile(file_path)
                 
@@ -139,7 +139,7 @@ def clientSendJob(conn, scene, anim = False):
     for object in bpy.data.objects:
         for modifier in object.modifiers:
             if modifier.type == 'FLUID_SIMULATION' and modifier.settings.type == "DOMAIN":
-                addFluidFiles(job, bpy.utils.expandpath(modifier.settings.path))
+                addFluidFiles(job, bpy.path.abspath(modifier.settings.path))
             elif modifier.type == "CLOTH":
                 addPointCache(job, object, modifier.point_cache, default_path)
             elif modifier.type == "SOFT_BODY":
@@ -149,7 +149,7 @@ def clientSendJob(conn, scene, anim = False):
                 if modifier.domain_settings.highres:
                     addPointCache(job, object, modifier.domain_settings.point_cache_high, default_path)
             elif modifier.type == "MULTIRES" and modifier.external:
-                file_path = bpy.utils.expandpath(modifier.filepath)
+                file_path = bpy.path.abspath(modifier.filepath)
                 job.addFile(file_path)
 
         # particles modifier are stupid and don't contain data
@@ -189,7 +189,6 @@ def clientSendJob(conn, scene, anim = False):
 def requestResult(conn, job_id, frame):
     conn.request("GET", renderURL(job_id, frame))
 
-@rnaType
 class NetworkRenderEngine(bpy.types.RenderEngine):
     bl_idname = 'NET_RENDER'
     bl_label = "Network Render"
index 858ec800dbcd1729ab1eea65ded48fa32afa026e..35f356e0a6519096c0bc782d6c30893484e6cd54 100644 (file)
@@ -26,13 +26,13 @@ from netrender.utils import *
 import netrender.client as client
 import netrender.model
 
-@rnaType
 class RENDER_OT_netslave_bake(bpy.types.Operator):
     '''NEED DESCRIPTION'''
     bl_idname = "render.netslavebake"
     bl_label = "Bake all in file"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -84,13 +84,13 @@ class RENDER_OT_netslave_bake(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientanim(bpy.types.Operator):
     '''Start rendering an animation on network'''
     bl_idname = "render.netclientanim"
     bl_label = "Animation on network"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -111,13 +111,13 @@ class RENDER_OT_netclientanim(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientrun(bpy.types.Operator):
     '''Start network rendering service'''
     bl_idname = "render.netclientstart"
     bl_label = "Start Service"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -128,13 +128,13 @@ class RENDER_OT_netclientrun(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientsend(bpy.types.Operator):
     '''Send Render Job to the Network'''
     bl_idname = "render.netclientsend"
     bl_label = "Send job"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -158,13 +158,13 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientsendframe(bpy.types.Operator):
     '''Send Render Job with current frame to the Network'''
     bl_idname = "render.netclientsendframe"
     bl_label = "Send current frame job"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -188,13 +188,13 @@ class RENDER_OT_netclientsendframe(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientstatus(bpy.types.Operator):
     '''Refresh the status of the current jobs'''
     bl_idname = "render.netclientstatus"
     bl_label = "Client Status"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -228,13 +228,13 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
     '''Operator documentation text, will be used for the operator tooltip and python docs.'''
     bl_idname = "render.netclientblacklistslave"
     bl_label = "Client Blacklist Slave"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -258,13 +258,13 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
     '''Operator documentation text, will be used for the operator tooltip and python docs.'''
     bl_idname = "render.netclientwhitelistslave"
     bl_label = "Client Whitelist Slave"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -289,13 +289,13 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
         return self.execute(context)
 
 
-@rnaType
 class RENDER_OT_netclientslaves(bpy.types.Operator):
     '''Refresh status about available Render slaves'''
     bl_idname = "render.netclientslaves"
     bl_label = "Client Slaves"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -334,13 +334,13 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientcancel(bpy.types.Operator):
     '''Cancel the selected network rendering job.'''
     bl_idname = "render.netclientcancel"
     bl_label = "Client Cancel"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         netsettings = context.scene.network_render
         return netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0
 
@@ -363,13 +363,13 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientcancelall(bpy.types.Operator):
     '''Cancel all running network rendering jobs.'''
     bl_idname = "render.netclientcancelall"
     bl_label = "Client Cancel All"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -390,13 +390,13 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class netclientdownload(bpy.types.Operator):
     '''Download render results from the network'''
     bl_idname = "render.netclientdownload"
     bl_label = "Client Download"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         netsettings = context.scene.network_render
         return netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0
 
@@ -435,13 +435,13 @@ class netclientdownload(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class netclientscan(bpy.types.Operator):
     '''Listen on network for master server broadcasting its address and port.'''
     bl_idname = "render.netclientscan"
     bl_label = "Client Scan"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         return True
 
     def execute(self, context):
@@ -458,13 +458,13 @@ class netclientscan(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class netclientweb(bpy.types.Operator):
     '''Open new window with information about running rendering jobs'''
     bl_idname = "render.netclientweb"
     bl_label = "Open Master Monitor"
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         netsettings = context.scene.network_render
         return netsettings.server_address != "[default]"
 
old mode 100755 (executable)
new mode 100644 (file)
index d9a13ad..9243505
@@ -92,7 +92,7 @@ def process(paths):
     # LIBRARIES
     ###########################
     for lib in bpy.data.libraries:
-        file_path = bpy.utils.expandpath(lib.filepath)
+        file_path = bpy.path.abspath(lib.filepath)
         new_path = path_map.get(os.path.split(file_path)[1], None)
         if new_path:
             lib.filepath = new_path
@@ -102,7 +102,7 @@ def process(paths):
     ###########################
     for image in bpy.data.images:
         if image.source == "FILE" and not image.packed_file:
-            file_path = bpy.utils.expandpath(image.filepath)
+            file_path = bpy.path.abspath(image.filepath)
             new_path = path_map.get(os.path.split(file_path)[1], None)
             if new_path:
                 image.filepath = new_path
@@ -124,7 +124,7 @@ def process(paths):
                 if modifier.domain_settings.highres:
                     processPointCache(modifier.domain_settings.point_cache_high)
             elif modifier.type == "MULTIRES" and modifier.external:
-                file_path = bpy.utils.expandpath(modifier.filepath)
+                file_path = bpy.path.abspath(modifier.filepath)
                 new_path = path_map.get(file_path, None)
                 if new_path:
                     modifier.filepath = new_path
index c60b10c484a27dd985aba8673ca3975ab76f85aa..d5269803ffda1753f5f85fd000169bc2dc518a83 100644 (file)
@@ -36,6 +36,11 @@ DISPATCHED = 1
 DONE = 2
 ERROR = 3
 
+def base_poll(cls, context):
+    rd = context.scene.render
+    return (rd.use_game_engine==False) and (rd.engine in cls.COMPAT_ENGINES)
+    
+
 def init_file():
     if netrender.init_file != bpy.data.filepath:
         netrender.init_file = bpy.data.filepath
@@ -82,16 +87,16 @@ class RenderButtonsPanel():
     bl_context = "render"
     # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
 
-    def poll(self, context):
-        rd = context.scene.render
-        return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
 
 # Setting panel, use in the scene for now.
-@rnaType
 class RENDER_PT_network_settings(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Network Settings"
     COMPAT_ENGINES = {'NET_RENDER'}
 
+    @staticmethod
+    def poll(context):
+        return base_poll(__class__, context)
+
     def draw(self, context):
         layout = self.layout
 
@@ -122,15 +127,14 @@ class RENDER_PT_network_settings(bpy.types.Panel, RenderButtonsPanel):
 
         layout.operator("render.netclientweb", icon='QUESTION')
 
-@rnaType
 class RENDER_PT_network_slave_settings(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Slave Settings"
     COMPAT_ENGINES = {'NET_RENDER'}
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         scene = context.scene
-        return (super().poll(context)
-                and scene.network_render.mode == "RENDER_SLAVE")
+        return base_poll(__class__, context) and scene.network_render.mode == "RENDER_SLAVE"
 
     def draw(self, context):
         layout = self.layout
@@ -147,15 +151,15 @@ class RENDER_PT_network_slave_settings(bpy.types.Panel, RenderButtonsPanel):
         sub = layout.column()
         sub.enabled = rd.threads_mode == 'FIXED'
         sub.prop(rd, "threads")
-@rnaType
+
 class RENDER_PT_network_master_settings(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Master Settings"
     COMPAT_ENGINES = {'NET_RENDER'}
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         scene = context.scene
-        return (super().poll(context)
-                and scene.network_render.mode == "RENDER_MASTER")
+        return base_poll(__class__, context) and scene.network_render.mode == "RENDER_MASTER"
 
     def draw(self, context):
         layout = self.layout
@@ -166,15 +170,14 @@ class RENDER_PT_network_master_settings(bpy.types.Panel, RenderButtonsPanel):
         layout.prop(netsettings, "master_broadcast")
         layout.prop(netsettings, "master_clear")
 
-@rnaType
 class RENDER_PT_network_job(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Job Settings"
     COMPAT_ENGINES = {'NET_RENDER'}
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         scene = context.scene
-        return (super().poll(context)
-                and scene.network_render.mode == "RENDER_CLIENT")
+        return base_poll(__class__, context) and scene.network_render.mode == "RENDER_CLIENT"
 
     def draw(self, context):
         layout = self.layout
@@ -207,19 +210,18 @@ class RENDER_PT_network_job(bpy.types.Panel, RenderButtonsPanel):
         row.prop(netsettings, "priority")
         row.prop(netsettings, "chunks")
 
-@rnaType
 class RENDER_PT_network_slaves(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Slaves Status"
     COMPAT_ENGINES = {'NET_RENDER'}
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         scene = context.scene
         netsettings = scene.network_render
         if netsettings.mode != "RENDER_CLIENT":
             return False
         verify_address(netsettings)
-        return (super().poll(context)
-                and netsettings.server_address != "[default]")
+        return base_poll(__class__, context) and netsettings.server_address != "[default]"
 
     def draw(self, context):
         layout = self.layout
@@ -246,19 +248,18 @@ class RENDER_PT_network_slaves(bpy.types.Panel, RenderButtonsPanel):
             layout.label(text="Seen: " + time.ctime(slave.last_seen))
             layout.label(text="Stats: " + slave.stats)
 
-@rnaType
 class RENDER_PT_network_slaves_blacklist(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Slaves Blacklist"
     COMPAT_ENGINES = {'NET_RENDER'}
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         scene = context.scene
         netsettings = scene.network_render
         if netsettings.mode != "RENDER_CLIENT":
             return False
         verify_address(netsettings)
-        return (super().poll(context)
-                and netsettings.server_address != "[default]")
+        return base_poll(__class__, context) and netsettings.server_address != "[default]"
 
     def draw(self, context):
         layout = self.layout
@@ -284,19 +285,18 @@ class RENDER_PT_network_slaves_blacklist(bpy.types.Panel, RenderButtonsPanel):
             layout.label(text="Seen: " + time.ctime(slave.last_seen))
             layout.label(text="Stats: " + slave.stats)
 
-@rnaType
 class RENDER_PT_network_jobs(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Jobs"
     COMPAT_ENGINES = {'NET_RENDER'}
 
-    def poll(self, context):
+    @staticmethod
+    def poll(context):
         scene = context.scene
         netsettings = scene.network_render
         if netsettings.mode != "RENDER_CLIENT":
             return False
         verify_address(netsettings)
-        return (super().poll(context)
-                and netsettings.server_address != "[default]")
+        return base_poll(__class__, context) and netsettings.server_address != "[default]"
 
     def draw(self, context):
         layout = self.layout
@@ -325,150 +325,148 @@ class RENDER_PT_network_jobs(bpy.types.Panel, RenderButtonsPanel):
             layout.label(text="Done: %04i" % job.results[DONE])
             layout.label(text="Error: %04i" % job.results[ERROR])
 
-@rnaType
 class NetRenderSettings(bpy.types.IDPropertyGroup):
     pass
 
-@rnaType
 class NetRenderSlave(bpy.types.IDPropertyGroup):
     pass
 
-@rnaType
 class NetRenderJob(bpy.types.IDPropertyGroup):
     pass
 
-bpy.types.Scene.PointerProperty(attr="network_render", type=NetRenderSettings, name="Network Render", description="Network Render Settings")
-
-NetRenderSettings.StringProperty( attr="server_address",
-                name="Server address",
-                description="IP or name of the master render server",
-                maxlen = 128,
-                default = "[default]")
-
-NetRenderSettings.IntProperty( attr="server_port",
-                name="Server port",
-                description="port of the master render server",
-                default = 8000,
-                min=1,
-                max=65535)
-
-NetRenderSettings.BoolProperty( attr="master_broadcast",
-                name="Broadcast",
-                description="broadcast master server address on local network",
-                default = True)
-
-NetRenderSettings.BoolProperty( attr="slave_clear",
-                name="Clear on exit",
-                description="delete downloaded files on exit",
-                default = True)
-
-NetRenderSettings.BoolProperty( attr="slave_thumb",
-                name="Generate thumbnails",
-                description="Generate thumbnails on slaves instead of master",
-                default = False)
-
-NetRenderSettings.BoolProperty( attr="slave_outputlog",
-                name="Output render log on console",
-                description="Output render text log to console as well as sending it to the master",
-                default = True)
-
-NetRenderSettings.BoolProperty( attr="master_clear",
-                name="Clear on exit",
-                description="delete saved files on exit",
-                default = False)
-
-default_path = os.environ.get("TEMP")
-
-if not default_path:
-    if os.name == 'nt':
-        default_path = "c:/tmp/"
-    else:
-        default_path = "/tmp/"
-elif not default_path.endswith(os.sep):
-    default_path += os.sep
-
-NetRenderSettings.StringProperty( attr="path",
-                name="Path",
-                description="Path for temporary files",
-                maxlen = 128,
-                default = default_path,
-                subtype='FILE_PATH')
-
-NetRenderSettings.StringProperty( attr="job_name",
-                name="Job name",
-                description="Name of the job",
-                maxlen = 128,
-                default = "[default]")
-
-NetRenderSettings.StringProperty( attr="job_category",
-                name="Job category",
-                description="Category of the job",
-                maxlen = 128,
-                default = "")
-
-NetRenderSettings.IntProperty( attr="chunks",
-                name="Chunks",
-                description="Number of frame to dispatch to each slave in one chunk",
-                default = 5,
-                min=1,
-                max=65535)
-
-NetRenderSettings.IntProperty( attr="priority",
-                name="Priority",
-                description="Priority of the job",
-                default = 1,
-                min=1,
-                max=10)
-
-NetRenderSettings.StringProperty( attr="job_id",
-                name="Network job id",
-                description="id of the last sent render job",
-                maxlen = 64,
-                default = "")
-
-NetRenderSettings.IntProperty( attr="active_slave_index",
-                name="Index of the active slave",
-                description="",
-                default = -1,
-                min= -1,
-                max=65535)
-
-NetRenderSettings.IntProperty( attr="active_blacklisted_slave_index",
-                name="Index of the active slave",
-                description="",
-                default = -1,
-                min= -1,
-                max=65535)
-
-NetRenderSettings.IntProperty( attr="active_job_index",
-                name="Index of the active job",
-                description="",
-                default = -1,
-                min= -1,
-                max=65535)
-
-NetRenderSettings.EnumProperty(attr="mode",
-                        items=(
-                                        ("RENDER_CLIENT", "Client", "Act as render client"),
-                                        ("RENDER_MASTER", "Master", "Act as render master"),
-                                        ("RENDER_SLAVE", "Slave", "Act as render slave"),
-                                    ),
-                        name="Network mode",
-                        description="Mode of operation of this instance",
-                        default="RENDER_CLIENT")
-
-NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="")
-NetRenderSettings.CollectionProperty(attr="slaves_blacklist", type=NetRenderSlave, name="Slaves Blacklist", description="")
-NetRenderSettings.CollectionProperty(attr="jobs", type=NetRenderJob, name="Job List", description="")
-
-NetRenderSlave.StringProperty( attr="name",
-                name="Name of the slave",
-                description="",
-                maxlen = 64,
-                default = "")
-
-NetRenderJob.StringProperty( attr="name",
-                name="Name of the job",
-                description="",
-                maxlen = 128,
-                default = "")
+def addProperties():
+    bpy.types.Scene.PointerProperty(attr="network_render", type=NetRenderSettings, name="Network Render", description="Network Render Settings")
+    
+    NetRenderSettings.StringProperty( attr="server_address",
+                    name="Server address",
+                    description="IP or name of the master render server",
+                    maxlen = 128,
+                    default = "[default]")
+    
+    NetRenderSettings.IntProperty( attr="server_port",
+                    name="Server port",
+                    description="port of the master render server",
+                    default = 8000,
+                    min=1,
+                    max=65535)
+    
+    NetRenderSettings.BoolProperty( attr="master_broadcast",
+                    name="Broadcast",
+                    description="broadcast master server address on local network",
+                    default = True)
+    
+    NetRenderSettings.BoolProperty( attr="slave_clear",
+                    name="Clear on exit",
+                    description="delete downloaded files on exit",
+                    default = True)
+    
+    NetRenderSettings.BoolProperty( attr="slave_thumb",
+                    name="Generate thumbnails",
+                    description="Generate thumbnails on slaves instead of master",
+                    default = False)
+    
+    NetRenderSettings.BoolProperty( attr="slave_outputlog",
+                    name="Output render log on console",
+                    description="Output render text log to console as well as sending it to the master",
+                    default = True)
+    
+    NetRenderSettings.BoolProperty( attr="master_clear",
+                    name="Clear on exit",
+                    description="delete saved files on exit",
+                    default = False)
+    
+    default_path = os.environ.get("TEMP")
+    
+    if not default_path:
+        if os.name == 'nt':
+            default_path = "c:/tmp/"
+        else:
+            default_path = "/tmp/"
+    elif not default_path.endswith(os.sep):
+        default_path += os.sep
+    
+    NetRenderSettings.StringProperty( attr="path",
+                    name="Path",
+                    description="Path for temporary files",
+                    maxlen = 128,
+                    default = default_path,
+                    subtype='FILE_PATH')
+    
+    NetRenderSettings.StringProperty( attr="job_name",
+                    name="Job name",
+                    description="Name of the job",
+                    maxlen = 128,
+                    default = "[default]")
+    
+    NetRenderSettings.StringProperty( attr="job_category",
+                    name="Job category",
+                    description="Category of the job",
+                    maxlen = 128,
+                    default = "")
+    
+    NetRenderSettings.IntProperty( attr="chunks",
+                    name="Chunks",
+                    description="Number of frame to dispatch to each slave in one chunk",
+                    default = 5,
+                    min=1,
+                    max=65535)
+    
+    NetRenderSettings.IntProperty( attr="priority",
+                    name="Priority",
+                    description="Priority of the job",
+                    default = 1,
+                    min=1,
+                    max=10)
+    
+    NetRenderSettings.StringProperty( attr="job_id",
+                    name="Network job id",
+                    description="id of the last sent render job",
+                    maxlen = 64,
+                    default = "")
+    
+    NetRenderSettings.IntProperty( attr="active_slave_index",
+                    name="Index of the active slave",
+                    description="",
+                    default = -1,
+                    min= -1,
+                    max=65535)
+    
+    NetRenderSettings.IntProperty( attr="active_blacklisted_slave_index",
+                    name="Index of the active slave",
+                    description="",
+                    default = -1,
+                    min= -1,
+                    max=65535)
+    
+    NetRenderSettings.IntProperty( attr="active_job_index",
+                    name="Index of the active job",
+                    description="",
+                    default = -1,
+                    min= -1,
+                    max=65535)
+    
+    NetRenderSettings.EnumProperty(attr="mode",
+                            items=(
+                                            ("RENDER_CLIENT", "Client", "Act as render client"),
+                                            ("RENDER_MASTER", "Master", "Act as render master"),
+                                            ("RENDER_SLAVE", "Slave", "Act as render slave"),
+                                        ),
+                            name="Network mode",
+                            description="Mode of operation of this instance",
+                            default="RENDER_CLIENT")
+    
+    NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="")
+    NetRenderSettings.CollectionProperty(attr="slaves_blacklist", type=NetRenderSlave, name="Slaves Blacklist", description="")
+    NetRenderSettings.CollectionProperty(attr="jobs", type=NetRenderJob, name="Job List", description="")
+    
+    NetRenderSlave.StringProperty( attr="name",
+                    name="Name of the slave",
+                    description="",
+                    maxlen = 64,
+                    default = "")
+    
+    NetRenderJob.StringProperty( attr="name",
+                    name="Name of the job",
+                    description="",
+                    maxlen = 128,
+                    default = "")
index fa2eb6fb5f56f93517c90f302fc927e7f7115ba7..31123ce26da5abedcebb141f33ec562984c66541 100644 (file)
@@ -57,10 +57,6 @@ FRAME_STATUS_TEXT = {
         ERROR: "Error"
         }
 
-def rnaType(rna_type):
-    if bpy: bpy.types.register(rna_type)
-    return rna_type
-
 def reporting(report, message, errorType = None):
     if errorType:
         t = 'ERROR'
index 1e6db441599a461d58e5dcee84457767a8ac586b..3431054413eb07b9160e7169381c6555ae751d7a 100644 (file)
@@ -26,7 +26,7 @@ data = _bpy.data
 context = _bpy.context
 
 # python modules
-from bpy import utils
+from bpy import utils, path
 
 from bpy import ops as _ops_module
 
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
new file mode 100644 (file)
index 0000000..2974615
--- /dev/null
@@ -0,0 +1,174 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+"""
+This module has a similar scope to os.path, containing utility
+functions for dealing with paths in Blender.
+"""
+
+import bpy as _bpy
+import os as _os
+
+def expand(path):
+    """
+    Returns the absolute path relative to the current blend file using the "//" prefix.
+    """
+    if path.startswith("//"):
+        return _os.path.join(_os.path.dirname(_bpy.data.filepath), path[2:])
+
+    return path
+
+
+def relpath(path, start=None):
+    """
+    Returns the path relative to the current blend file using the "//" prefix.
+
+    :arg start: Relative to this path, when not set the current filename is used.
+    :type start: string
+    """
+    if not path.startswith("//"):
+        if start is None:
+            start = _os.path.dirname(_bpy.data.filepath)
+        return "//" + _os.path.relpath(path, start)
+
+    return path
+
+
+def clean_name(name, replace="_"):
+    """
+    Returns a name with characters replaced that may cause problems under various circumstances, such as writing to a file.
+    All characters besides A-Z/a-z, 0-9 are replaced with "_"
+    or the replace argument if defined.
+    """
+
+    unclean_chars = \
+                 "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\
+                  \x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\
+                  \x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\
+                  \x2e\x2f\x3a\x3b\x3c\x3d\x3e\x3f\x40\x5b\x5c\x5d\x5e\x60\x7b\
+                  \x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\
+                  \x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\
+                  \x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\
+                  \xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\
+                  \xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\
+                  \xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\
+                  \xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\
+                  \xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\
+                  \xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe"
+
+    for ch in unclean_chars:
+        name = name.replace(ch, replace)
+    return name
+
+
+def display_name(name):
+    """
+    Creates a display string from name to be used menus and the user interface.
+    Capitalize the first letter in all lowercase names, mixed case names are kept as is.
+    Intended for use with filenames and module names.
+    """
+
+    name_base = _os.path.splitext(name)[0]
+
+    # string replacements
+    name_base = name_base.replace("_colon_", ":")
+
+    name_base = name_base.replace("_", " ")
+
+    if name_base.islower():
+        return name_base.capitalize()
+    else:
+        return name_base
+
+
+def resolve_ncase(path):
+       """
+       Resolve a case insensitive path on a case sensitive system,
+       returning a string with the path if found else return the original path.
+       """
+
+       import os
+
+       def _ncase_path_found(path):
+               if path=='' or os.path.exists(path):
+                       return path, True
+
+               filename = os.path.basename(path) # filename may be a directory or a file
+               dirpath = os.path.dirname(path)
+
+               suffix = ""
+               if not filename: # dir ends with a slash?
+                       if len(dirpath) < len(path):
+                               suffix = path[:len(path)-len(dirpath)]
+
+                       filename = os.path.basename(dirpath)
+                       dirpath = os.path.dirname(dirpath)
+
+               if not os.path.exists(dirpath):
+                       dirpath, found = _ncase_path_found(dirpath)
+
+                       if not found:
+                               return path, False
+
+               # at this point, the directory exists but not the file
+
+               # we are expecting 'dirpath' to be a directory, but it could be a file
+               if os.path.isdir(dirpath):
+                       files = os.listdir(dirpath)
+               else:
+                       return path, False
+
+               filename_low = filename.lower()
+               f_iter_nocase = None
+
+               for f_iter in files:
+                       if f_iter.lower() == filename_low:
+                               f_iter_nocase = f_iter
+                               break
+
+               if f_iter_nocase:
+                       return os.path.join(dirpath, f_iter_nocase) + suffix, True
+               else:
+                       # cant find the right one, just return the path as is.
+                       return path, False
+
+       ncase_path, found = _ncase_path_found(path)
+       return ncase_path if found else path
+
+
+def ensure_ext(filepath, ext, case_sensitive=False):
+    """
+    Return the path with the extension added its its not alredy set.
+
+    :arg ext: The extension to check for.
+    :type ext: string
+    :arg case_sensitive: Check for matching case when comparing extensions.
+    :type case_sensitive: bool
+    """
+    import os
+    fn_base, fn_ext = os.path.splitext(filepath)
+    if fn_base and fn_ext:
+        if (case_sensitive and ext == fn_ext) or (ext.lower() == fn_ext.lower()):
+            return filepath
+        else:
+            return fn_base + ext
+
+    else:
+        return filepath + ext
index 404013fb79a1ae69180c48d01a635802e9a4ac22..6c1c669d1f2d845fb30496d18bcbd427c0754230 100644 (file)
@@ -30,7 +30,6 @@ import sys as _sys
 from _bpy import blend_paths
 from _bpy import script_paths as _bpy_script_paths
 
-
 def _test_import(module_name, loaded_modules):
     import traceback
     import time
@@ -84,9 +83,9 @@ def modules_from_path(path, loaded_modules):
             modules.append(mod)
 
     return modules
-
-_loaded = [] # store loaded modules for reloading.
-_bpy_types = __import__("bpy_types") # keep for comparisons, never ever reload this.
+            
+_global_loaded_modules = [] # store loaded module names for reloading.
+import bpy_types as _bpy_types # keep for comparisons, never ever reload this.
 
 
 def load_scripts(reload_scripts=False, refresh_scripts=False):
@@ -101,12 +100,39 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
     import traceback
     import time
 
+    # must be set back to True on exits
+    _bpy_types._register_immediate = False
+
     t_main = time.time()
 
     loaded_modules = set()
 
     if refresh_scripts:
         original_modules = _sys.modules.values()
+    
+    if reload_scripts:
+        _bpy_types.TypeMap.clear()
+        _bpy_types.PropertiesMap.clear()
+
+    def register_module_call(mod):
+        _bpy_types._register_module(mod.__name__)
+        register = getattr(mod, "register", None)
+        if register:
+            try:
+                register()
+            except:
+                traceback.print_exc()
+        else:
+            print("\nWarning! '%s' has no register function, this is now a requirement for registerable scripts." % mod.__file__)
+
+    def unregister_module_call(mod):
+        _bpy_types._unregister_module(mod.__name__)
+        unregister = getattr(mod, "unregister", None)
+        if unregister:
+            try:
+                unregister()
+            except:
+                traceback.print_exc()
 
     def sys_path_ensure(path):
         if path not in _sys.path: # reloading would add twice
@@ -134,48 +160,23 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
             mod = test_reload(mod)
 
         if mod:
-            register = getattr(mod, "register", None)
-            if register:
-                try:
-                    register()
-                except:
-                    traceback.print_exc()
-            else:
-                print("\nWarning! '%s' has no register function, this is now a requirement for registerable scripts." % mod.__file__)
-            _loaded.append(mod)
+            register_module_call(mod)
+            _global_loaded_modules.append(mod.__name__)
 
     if reload_scripts:
 
-        # TODO, this is broken but should work, needs looking into
-        '''
-        # reload modules that may not be directly included
-        for type_class_name in dir(_bpy.types):
-            type_class = getattr(_bpy.types, type_class_name)
-            module_name = getattr(type_class, "__module__", "")
-
-            if module_name and module_name != "bpy.types": # hard coded for C types
-                loaded_modules.add(module_name)
-
-        # sorting isnt needed but rather it be pradictable
-        for module_name in sorted(loaded_modules):
-            print("Reloading:", module_name)
-            test_reload(_sys.modules[module_name])
-        '''
+        # module names -> modules
+        _global_loaded_modules[:] = [_sys.modules[mod_name] for mod_name in _global_loaded_modules]
 
         # loop over and unload all scripts
-        _loaded.reverse()
-        for mod in _loaded:
-            unregister = getattr(mod, "unregister", None)
-            if unregister:
-                try:
-                    unregister()
-                except:
-                    traceback.print_exc()
+        _global_loaded_modules.reverse()
+        for mod in _global_loaded_modules:
+            unregister_module_call(mod)
 
-        for mod in _loaded:
-            reload(mod)
+        for mod in _global_loaded_modules:
+            test_reload(mod)
 
-        _loaded[:] = []
+        _global_loaded_modules[:] = []
 
     user_path = user_script_path()
 
@@ -197,7 +198,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
 
     # load addons
     used_ext = {ext.module for ext in _bpy.context.user_preferences.addons}
-    paths = script_paths("addons")
+    paths = script_paths("addons") + script_paths("addons_contrib")
     for path in paths:
         sys_path_ensure(path)
 
@@ -210,79 +211,11 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
         print("gc.collect() -> %d" % gc.collect())
 
     if _bpy.app.debug:
-        print("Time %.4f" % (time.time() - t_main))
-
-
-def expandpath(path):
-    """
-    Returns the absolute path relative to the current blend file using the "//" prefix.
-    """
-    if path.startswith("//"):
-        return _os.path.join(_os.path.dirname(_bpy.data.filepath), path[2:])
-
-    return path
-
-
-def relpath(path, start=None):
-    """
-    Returns the path relative to the current blend file using the "//" prefix.
+        print("Python Script Load Time %.4f" % (time.time() - t_main))
+    
+    _bpy_types._register_immediate = True
 
-    :arg start: Relative to this path, when not set the current filename is used.
-    :type start: string
-    """
-    if not path.startswith("//"):
-        if start is None:
-            start = _os.path.dirname(_bpy.data.filepath)
-        return "//" + _os.path.relpath(path, start)
-
-    return path
-
-
-_unclean_chars = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
-    17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, \
-    35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 58, 59, 60, 61, 62, 63, \
-    64, 91, 92, 93, 94, 96, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, \
-    133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, \
-    147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, \
-    161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, \
-    175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, \
-    189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, \
-    203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, \
-    217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, \
-    231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, \
-    245, 246, 247, 248, 249, 250, 251, 252, 253, 254]
-
-_unclean_chars = ''.join([chr(i) for i in _unclean_chars])
-
-
-def clean_name(name, replace="_"):
-    """
-    Returns a name with characters replaced that may cause problems under various circumstances, such as writing to a file.
-    All characters besides A-Z/a-z, 0-9 are replaced with "_"
-    or the replace argument if defined.
-    """
-    for ch in _unclean_chars:
-        name = name.replace(ch, replace)
-    return name
-
-
-def display_name(name):
-    """
-    Creates a display string from name to be used menus and the user interface.
-    Capitalize the first letter in all lowercase names, mixed case names are kept as is.
-    Intended for use with filenames and module names.
-    """
-    name_base = _os.path.splitext(name)[0]
-
-    # string replacements
-    name_base = name_base.replace("_colon_", ":")
 
-    name_base = name_base.replace("_", " ")
-
-    if name_base.islower():
-        return name_base.capitalize()
-    else:
-        return name_base
 
 
 # base scripts
@@ -337,7 +270,7 @@ _presets = _os.path.join(_scripts[0], "presets") # FIXME - multiple paths
 
 def preset_paths(subdir):
     '''
-    Returns a list of paths for a spesific preset.
+    Returns a list of paths for a specific preset.
     '''
 
     return (_os.path.join(_presets, subdir), )
index 8cbb2bf4e80ed8b767ff2b7d7e677a8cf2102f12..0cd0aaaa3f049c43ffdaa1dd787c2c8456fc85f0 100644 (file)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 
 from _bpy import types as bpy_types
+import _bpy
 from mathutils import Vector
 
 StructRNA = bpy_types.Struct.__bases__[0]
@@ -539,8 +540,83 @@ class Text(bpy_types.ID):
 
 import collections
 
+TypeMap = {}
+# Properties (IDPropertyGroup) are different from types because they need to be registered
+# before adding sub properties to them, so they are registered on definition
+# and unregistered on unload
+PropertiesMap = {}
 
-class OrderedMeta(type):
+# Using our own loading function we set this to false
+# so when running a script directly in the text editor
+# registers moduals instantly.
+_register_immediate = True
+
+def _unregister_module(module, free=True):
+    for t in TypeMap.get(module, ()):
+        try:
+            bpy_types.unregister(t)
+        except:
+            import traceback
+            print("bpy.utils._unregister_module(): Module '%s' failed to unregister class '%s.%s'" % (module, t.__module__, t.__name__))
+            traceback.print_exc()
+
+    if free == True and module in TypeMap:
+        del TypeMap[module]
+
+
+    for t in PropertiesMap.get(module, ()):
+        try:
+            bpy_types.unregister(t)
+        except:
+            import traceback
+            print("bpy.utils._unload_module(): Module '%s' failed to unregister class '%s.%s'" % (module, t.__module__, t.__name__))
+            traceback.print_exc()
+
+    if free == True and module in PropertiesMap:
+        del PropertiesMap[module]
+
+
+def _register_module(module):
+    for t in TypeMap.get(module, ()):
+        try:
+            bpy_types.register(t)
+        except:
+            import traceback
+            print("bpy.utils._register_module(): Module '%s' failed to register class '%s.%s'" % (module, t.__module__, t.__name__))
+            traceback.print_exc()
+
+
+class RNAMeta(type):
+    @classmethod
+    def _register_immediate(cls):
+        return _register_immediate
+    
+    def __new__(cls, name, bases, classdict, **args):
+        result = type.__new__(cls, name, bases, classdict)
+        if bases and bases[0] != StructRNA:
+            module = result.__module__
+
+            ClassMap = TypeMap
+
+            # Register right away if needed
+            if cls._register_immediate():
+                bpy_types.register(result)
+                ClassMap = PropertiesMap 
+
+            # first part of packages only
+            if "." in module:
+                module = module[:module.index(".")]
+            
+            ClassMap.setdefault(module, []).append(result)
+
+        return result
+
+class RNAMetaRegister(RNAMeta):
+    @classmethod
+    def _register_immediate(cls):
+        return True
+
+class OrderedMeta(RNAMeta):
 
     def __init__(cls, name, bases, attributes):
         super(OrderedMeta, cls).__init__(name, bases, attributes)
@@ -549,7 +625,6 @@ class OrderedMeta(type):
     def __prepare__(name, bases, **kwargs):
         return collections.OrderedDict()
 
-
 # Only defined so operators members can be used by accessing self.order
 class Operator(StructRNA, metaclass=OrderedMeta):
     __slots__ = ()
@@ -564,7 +639,12 @@ class Macro(StructRNA, metaclass=OrderedMeta):
     def define(self, opname):
         from _bpy import ops
         return ops.macro_define(self, opname)
+    
+class IDPropertyGroup(StructRNA, metaclass=RNAMetaRegister):
+        __slots__ = ()
 
+class RenderEngine(StructRNA, metaclass=RNAMeta):
+    __slots__ = ()
 
 class _GenericUI:
     __slots__ = ()
@@ -606,15 +686,15 @@ class _GenericUI:
             pass
 
 
-class Panel(StructRNA, _GenericUI):
+class Panel(StructRNA, _GenericUI, metaclass=RNAMeta):
     __slots__ = ()
 
 
-class Header(StructRNA, _GenericUI):
+class Header(StructRNA, _GenericUI, metaclass=RNAMeta):
     __slots__ = ()
 
 
-class Menu(StructRNA, _GenericUI):
+class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
     __slots__ = ()
 
     def path_menu(self, searchpaths, operator, props_default={}):
@@ -638,7 +718,7 @@ class Menu(StructRNA, _GenericUI):
             if f.startswith("."):
                 continue
 
-            preset_name = bpy.utils.display_name(f)
+            preset_name = bpy.path.display_name(f)
             props = layout.operator(operator, text=preset_name)
 
             for attr, value in props_default.items():
index 095229016e91898b1d5c09220e2c359ac6947297..f495406e8d84569d3f7c1288f4034ea2dff70d27 100644 (file)
@@ -537,7 +537,7 @@ def generate_test_all(context, GRAPH=False):
         base_name = os.path.splitext(bpy.data.filepath)[0]
         for obj, obj_new in new_objects:
             for obj in (obj, obj_new):
-                fn = base_name + "-" + bpy.utils.clean_name(obj.name)
+                fn = base_name + "-" + bpy.path.clean_name(obj.name)
 
                 path_dot = fn + ".dot"
                 path_png = fn + ".png"
index 3e8662c275f78c53045928594ecf5125b0eaf0c2..eda27240fb5134893654b0810ff6168d93349ee2 100644 (file)
@@ -124,7 +124,7 @@ def draw(layout, context, context_member, use_edit=True):
             assign_props(prop, val_draw, key)
 
 
-class PropertyPanel(bpy.types.Panel):
+class PropertyPanel():
     """
     The subclass should have its own poll function
     and the variable '_context_path' MUST be set.
@@ -135,130 +135,3 @@ class PropertyPanel(bpy.types.Panel):
     def draw(self, context):
         draw(self.layout, context, self._context_path)
 
-
-from bpy.props import *
-
-
-rna_path = StringProperty(name="Property Edit",
-    description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'})
-
-rna_value = StringProperty(name="Property Value",
-    description="Property value edit", maxlen=1024, default="")
-
-rna_property = StringProperty(name="Property Name",
-    description="Property name edit", maxlen=1024, default="")
-
-rna_min = FloatProperty(name="Min", default=0.0, precision=3)
-rna_max = FloatProperty(name="Max", default=1.0, precision=3)
-
-
-class WM_OT_properties_edit(bpy.types.Operator):
-    '''Internal use (edit a property data_path)'''
-    bl_idname = "wm.properties_edit"
-    bl_label = "Edit Property"
-
-    data_path = rna_path
-    property = rna_property
-    value = rna_value
-    min = rna_min
-    max = rna_max
-    description = StringProperty(name="Tip", default="")
-
-    def execute(self, context):
-        data_path = self.properties.data_path
-        value = self.properties.value
-        prop = self.properties.property
-        prop_old = self._last_prop[0]
-
-        try:
-            value_eval = eval(value)
-        except:
-            value_eval = value
-
-        # First remove
-        item = eval("context.%s" % data_path)
-
-        rna_idprop_ui_prop_clear(item, prop_old)
-        exec_str = "del item['%s']" % prop_old
-        # print(exec_str)
-        exec(exec_str)
-
-
-        # Reassign
-        exec_str = "item['%s'] = %s" % (prop, repr(value_eval))
-        # print(exec_str)
-        exec(exec_str)
-        self._last_prop[:] = [prop]
-
-        prop_type = type(item[prop])
-
-        prop_ui = rna_idprop_ui_prop_get(item, prop)
-
-        if prop_type in (float, int):
-
-            prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.properties.min)
-            prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.properties.max)
-
-        prop_ui['description'] = self.properties.description
-
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-
-        self._last_prop = [self.properties.property]
-
-        item = eval("context.%s" % self.properties.data_path)
-
-        # setup defaults
-        prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create
-        if prop_ui:
-            self.properties.min = prop_ui.get("min", -1000000000)
-            self.properties.max = prop_ui.get("max", 1000000000)
-            self.properties.description = prop_ui.get("description", "")
-
-        wm = context.manager
-        # This crashes, TODO - fix
-        #return wm.invoke_props_popup(self, event)
-
-        wm.invoke_props_popup(self, event)
-        return {'RUNNING_MODAL'}
-
-
-class WM_OT_properties_add(bpy.types.Operator):
-    '''Internal use (edit a property data_path)'''
-    bl_idname = "wm.properties_add"
-    bl_label = "Add Property"
-
-    data_path = rna_path
-
-    def execute(self, context):
-        item = eval("context.%s" % self.properties.data_path)
-
-        def unique_name(names):
-            prop = 'prop'
-            prop_new = prop
-            i = 1
-            while prop_new in names:
-                prop_new = prop + str(i)
-                i += 1
-
-            return prop_new
-
-        property = unique_name(item.keys())
-
-        item[property] = 1.0
-        return {'FINISHED'}
-
-
-class WM_OT_properties_remove(bpy.types.Operator):
-    '''Internal use (edit a property data_path)'''
-    bl_idname = "wm.properties_remove"
-    bl_label = "Remove Property"
-
-    data_path = rna_path
-    property = rna_property
-
-    def execute(self, context):
-        item = eval("context.%s" % self.properties.data_path)
-        del item[self.properties.property]
-        return {'FINISHED'}
index 164bbfb100bea7252226bc246a48c3984ea5ba9e..5d6ec1f559fa9a441433eed503534c0f0f4a715e 100644 (file)
@@ -606,12 +606,10 @@ menu_func = (lambda self, context: self.layout.operator(AddHuman.bl_idname,
 
 
 def register():
-    bpy.types.register(AddHuman)
     bpy.types.INFO_MT_armature_add.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(AddHuman)
     bpy.types.INFO_MT_armature_add.remove(menu_func)
 
 if __name__ == "__main__":
index 16bf4e1c92c6f9093dffc6cf8a69fcd9f25fe098..d64b92a8b19322e41759cae4c20b6d731720154c 100644 (file)
@@ -137,12 +137,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(AddTorus)
     bpy.types.INFO_MT_mesh_add.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(AddTorus)
     bpy.types.INFO_MT_mesh_add.remove(menu_func)
 
 if __name__ == "__main__":
index d3a90cb7accdc089a7e98a3d02a13c87856d5463..cc0f3673e5c6fa14546d93493bf893c7db2ed560 100644 (file)
@@ -22,6 +22,9 @@ import bpy
 
 language_id = 'python'
 
+# store our own __main__ module, not 100% needed
+# but python expects this in some places
+_BPY_MAIN_OWN = True
 
 def add_scrollback(text, text_type):
     for l in text.split('\n'):
@@ -41,16 +44,17 @@ def get_console(console_id):
     from code import InteractiveConsole
 
     consoles = getattr(get_console, "consoles", None)
+    hash_next = hash(bpy.cont