[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28648] branches/soc-2010-kwk: merge 28528 :28647

Konrad Kleine konrad at konradwilhelm.de
Fri May 7 13:21:05 CEST 2010


Revision: 28648
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28648
Author:   kwk
Date:     2010-05-07 13:21:05 +0200 (Fri, 07 May 2010)

Log Message:
-----------
merge 28528:28647

Modified Paths:
--------------
    branches/soc-2010-kwk/intern/ghost/intern/GHOST_DropTargetWin32.cpp
    branches/soc-2010-kwk/intern/ghost/intern/GHOST_WindowCocoa.mm
    branches/soc-2010-kwk/intern/guardedalloc/MEM_guardedalloc.h
    branches/soc-2010-kwk/intern/guardedalloc/intern/mallocn.c
    branches/soc-2010-kwk/release/datafiles/blenderbuttons
    branches/soc-2010-kwk/release/scripts/io/netrender/__init__.py
    branches/soc-2010-kwk/release/scripts/io/netrender/model.py
    branches/soc-2010-kwk/release/scripts/io/netrender/operators.py
    branches/soc-2010-kwk/release/scripts/io/netrender/slave.py
    branches/soc-2010-kwk/release/scripts/io/netrender/ui.py
    branches/soc-2010-kwk/release/scripts/io/netrender/utils.py
    branches/soc-2010-kwk/release/scripts/modules/bpy_types.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/arm_biped.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/eye_balls.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/eye_lid.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/finger_curl.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/leg_biped.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/leg_quadruped.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/mouth.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/neck.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/neck_flex.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/palm_curl.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/shape_key_control.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/shape_key_distance.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/shape_key_rotdiff.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/spine_pivot_flex.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/tail_control.py
    branches/soc-2010-kwk/release/scripts/modules/rigify/tongue.py
    branches/soc-2010-kwk/release/scripts/modules/rigify_utils.py
    branches/soc-2010-kwk/release/scripts/modules/rna_info.py
    branches/soc-2010-kwk/release/scripts/op/console_python.py
    branches/soc-2010-kwk/release/scripts/op/image.py
    branches/soc-2010-kwk/release/scripts/op/sequencer.py
    branches/soc-2010-kwk/release/scripts/op/vertexpaint_dirt.py
    branches/soc-2010-kwk/release/scripts/ui/properties_data_mesh.py
    branches/soc-2010-kwk/release/scripts/ui/properties_material.py
    branches/soc-2010-kwk/release/scripts/ui/properties_object.py
    branches/soc-2010-kwk/release/scripts/ui/properties_particle.py
    branches/soc-2010-kwk/release/scripts/ui/properties_physics_common.py
    branches/soc-2010-kwk/release/scripts/ui/properties_render.py
    branches/soc-2010-kwk/release/scripts/ui/properties_texture.py
    branches/soc-2010-kwk/release/scripts/ui/space_image.py
    branches/soc-2010-kwk/release/scripts/ui/space_info.py
    branches/soc-2010-kwk/release/scripts/ui/space_outliner.py
    branches/soc-2010-kwk/release/scripts/ui/space_sequencer.py
    branches/soc-2010-kwk/release/scripts/ui/space_time.py
    branches/soc-2010-kwk/release/scripts/ui/space_userpref_keymap.py
    branches/soc-2010-kwk/release/scripts/ui/space_view3d.py
    branches/soc-2010-kwk/source/blender/blenkernel/intern/BME_tools.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/DerivedMesh.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/action.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/colortools.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/customdata.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/depsgraph.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/group.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/icons.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/multires.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/nla.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/object.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/particle.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/pointcache.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/softbody.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/subsurf_ccg.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/writeffmpeg.c
    branches/soc-2010-kwk/source/blender/blenlib/BLI_ghash.h
    branches/soc-2010-kwk/source/blender/blenlib/intern/BLI_args.c
    branches/soc-2010-kwk/source/blender/blenlib/intern/BLI_ghash.c
    branches/soc-2010-kwk/source/blender/blenlib/intern/pbvh.c
    branches/soc-2010-kwk/source/blender/blenloader/intern/readblenentry.c
    branches/soc-2010-kwk/source/blender/blenloader/intern/readfile.c
    branches/soc-2010-kwk/source/blender/blenloader/intern/writefile.c
    branches/soc-2010-kwk/source/blender/editors/animation/anim_draw.c
    branches/soc-2010-kwk/source/blender/editors/animation/anim_markers.c
    branches/soc-2010-kwk/source/blender/editors/animation/keyframing.c
    branches/soc-2010-kwk/source/blender/editors/armature/editarmature.c
    branches/soc-2010-kwk/source/blender/editors/armature/editarmature_retarget.c
    branches/soc-2010-kwk/source/blender/editors/armature/editarmature_sketch.c
    branches/soc-2010-kwk/source/blender/editors/armature/reeb.c
    branches/soc-2010-kwk/source/blender/editors/datafiles/blenderbuttons.c
    branches/soc-2010-kwk/source/blender/editors/include/UI_icons.h
    branches/soc-2010-kwk/source/blender/editors/interface/interface_draw.c
    branches/soc-2010-kwk/source/blender/editors/interface/view2d.c
    branches/soc-2010-kwk/source/blender/editors/mesh/editmesh_loop.c
    branches/soc-2010-kwk/source/blender/editors/mesh/editmesh_tools.c
    branches/soc-2010-kwk/source/blender/editors/mesh/meshtools.c
    branches/soc-2010-kwk/source/blender/editors/object/object_add.c
    branches/soc-2010-kwk/source/blender/editors/object/object_constraint.c
    branches/soc-2010-kwk/source/blender/editors/object/object_edit.c
    branches/soc-2010-kwk/source/blender/editors/object/object_group.c
    branches/soc-2010-kwk/source/blender/editors/object/object_intern.h
    branches/soc-2010-kwk/source/blender/editors/object/object_modifier.c
    branches/soc-2010-kwk/source/blender/editors/object/object_ops.c
    branches/soc-2010-kwk/source/blender/editors/object/object_relations.c
    branches/soc-2010-kwk/source/blender/editors/object/object_vgroup.c
    branches/soc-2010-kwk/source/blender/editors/render/render_internal.c
    branches/soc-2010-kwk/source/blender/editors/render/render_shading.c
    branches/soc-2010-kwk/source/blender/editors/sculpt_paint/paint_vertex.c
    branches/soc-2010-kwk/source/blender/editors/space_image/image_ops.c
    branches/soc-2010-kwk/source/blender/editors/space_image/space_image.c
    branches/soc-2010-kwk/source/blender/editors/space_logic/logic_ops.c
    branches/soc-2010-kwk/source/blender/editors/space_logic/logic_window.c
    branches/soc-2010-kwk/source/blender/editors/space_logic/space_logic.c
    branches/soc-2010-kwk/source/blender/editors/space_nla/nla_edit.c
    branches/soc-2010-kwk/source/blender/editors/space_node/node_draw.c
    branches/soc-2010-kwk/source/blender/editors/space_outliner/outliner.c
    branches/soc-2010-kwk/source/blender/editors/space_sequencer/sequencer_edit.c
    branches/soc-2010-kwk/source/blender/editors/space_sequencer/sequencer_intern.h
    branches/soc-2010-kwk/source/blender/editors/space_sequencer/sequencer_select.c
    branches/soc-2010-kwk/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2010-kwk/source/blender/editors/space_view3d/view3d_buttons.c
    branches/soc-2010-kwk/source/blender/editors/space_view3d/view3d_edit.c
    branches/soc-2010-kwk/source/blender/editors/transform/transform.c
    branches/soc-2010-kwk/source/blender/editors/transform/transform.h
    branches/soc-2010-kwk/source/blender/editors/transform/transform_constraints.c
    branches/soc-2010-kwk/source/blender/editors/transform/transform_conversions.c
    branches/soc-2010-kwk/source/blender/editors/transform/transform_generics.c
    branches/soc-2010-kwk/source/blender/gpu/intern/gpu_codegen.c
    branches/soc-2010-kwk/source/blender/gpu/intern/gpu_draw.c
    branches/soc-2010-kwk/source/blender/makesdna/DNA_action_types.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_actuator_types.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_controller_types.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_modifier_types.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_object_force.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_object_types.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_sensor_types.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_space_types.h
    branches/soc-2010-kwk/source/blender/makesrna/RNA_enum_types.h
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_access.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_action.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_actuator.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_animation.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_animviz.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_armature.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_boid.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_color.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_controller.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_curve.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_fluidsim.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_lamp.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_main.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_material.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_mesh.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_meta.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_modifier.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_object.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_object_force.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_particle.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_pose.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_property.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_rna.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_sculpt_paint.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_sensor.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_sequencer.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_smoke.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_space.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_texture.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_userdef.c
    branches/soc-2010-kwk/source/blender/modifiers/intern/MOD_boolean_util.c
    branches/soc-2010-kwk/source/blender/modifiers/intern/MOD_build.c
    branches/soc-2010-kwk/source/blender/modifiers/intern/MOD_cloth.c
    branches/soc-2010-kwk/source/blender/modifiers/intern/MOD_mask.c
    branches/soc-2010-kwk/source/blender/python/doc/sphinx_doc_gen.py
    branches/soc-2010-kwk/source/blender/python/doc/sphinx_doc_gen.sh
    branches/soc-2010-kwk/source/blender/python/generic/blf_api.c
    branches/soc-2010-kwk/source/blender/python/intern/bpy_rna.c
    branches/soc-2010-kwk/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
    branches/soc-2010-kwk/source/blender/render/intern/source/convertblender.c
    branches/soc-2010-kwk/source/blender/render/intern/source/pipeline.c
    branches/soc-2010-kwk/source/blender/render/intern/source/sss.c
    branches/soc-2010-kwk/source/blender/render/intern/source/strand.c
    branches/soc-2010-kwk/source/blender/windowmanager/intern/wm_files.c
    branches/soc-2010-kwk/source/blender/windowmanager/intern/wm_init_exit.c
    branches/soc-2010-kwk/source/blender/windowmanager/intern/wm_operators.c
    branches/soc-2010-kwk/source/blender/windowmanager/intern/wm_window.c
    branches/soc-2010-kwk/source/blender/windowmanager/wm_event_types.h
    branches/soc-2010-kwk/source/blenderplayer/bad_level_call_stubs/stubs.c
    branches/soc-2010-kwk/source/gameengine/Converter/BL_ArmatureObject.cpp
    branches/soc-2010-kwk/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/soc-2010-kwk/source/gameengine/Ketsji/KX_ObjectActuator.cpp
    branches/soc-2010-kwk/source/gameengine/Ketsji/KX_PythonInit.cpp
    branches/soc-2010-kwk/source/gameengine/Ketsji/KX_PythonInit.h

Added Paths:
-----------
    branches/soc-2010-kwk/release/scripts/io/netrender/repath.py

Modified: branches/soc-2010-kwk/intern/ghost/intern/GHOST_DropTargetWin32.cpp
===================================================================
--- branches/soc-2010-kwk/intern/ghost/intern/GHOST_DropTargetWin32.cpp	2010-05-07 10:59:48 UTC (rev 28647)
+++ branches/soc-2010-kwk/intern/ghost/intern/GHOST_DropTargetWin32.cpp	2010-05-07 11:21:05 UTC (rev 28648)
@@ -110,8 +110,8 @@
  */
 HRESULT __stdcall GHOST_DropTargetWin32::DragEnter(IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect)
 {
-	// we don't know yet if we accept the drop.
-	m_window->setAcceptDragOperation(false);
+	// we accept all drop by default
+	m_window->setAcceptDragOperation(true);
 	*pdwEffect = DROPEFFECT_NONE;
 	
 	m_draggedObjectType = getGhostType(pDataObject);

Modified: branches/soc-2010-kwk/intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
--- branches/soc-2010-kwk/intern/ghost/intern/GHOST_WindowCocoa.mm	2010-05-07 10:59:48 UTC (rev 28647)
+++ branches/soc-2010-kwk/intern/ghost/intern/GHOST_WindowCocoa.mm	2010-05-07 11:21:05 UTC (rev 28648)
@@ -167,7 +167,7 @@
 	else if ([[draggingPBoard types] containsObject:NSStringPboardType]) m_draggedObjectType = GHOST_kDragnDropTypeString;
 	else return NSDragOperationNone;
 	
-	associatedWindow->setAcceptDragOperation(FALSE); //Drag operation needs to be accepted explicitly by the event manager
+	associatedWindow->setAcceptDragOperation(TRUE); //Drag operation is accepted by default
 	systemCocoa->handleDraggingEvent(GHOST_kEventDraggingEntered, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, nil);
 	return NSDragOperationCopy;
 }

Modified: branches/soc-2010-kwk/intern/guardedalloc/MEM_guardedalloc.h
===================================================================
--- branches/soc-2010-kwk/intern/guardedalloc/MEM_guardedalloc.h	2010-05-07 10:59:48 UTC (rev 28647)
+++ branches/soc-2010-kwk/intern/guardedalloc/MEM_guardedalloc.h	2010-05-07 11:21:05 UTC (rev 28648)
@@ -144,6 +144,12 @@
 	uintptr_t MEM_get_mapped_memory_in_use(void);
 	int MEM_get_memory_blocks_in_use(void);
 
+	/*reset the peak memory statistic to zero*/
+	void MEM_reset_peak_memory(void);
+
+	/*get the peak memory usage in bytes, including mmap allocations*/
+	uintptr_t MEM_get_peak_memory(void);
+
 #ifdef __cplusplus
 }
 #endif

Modified: branches/soc-2010-kwk/intern/guardedalloc/intern/mallocn.c
===================================================================
--- branches/soc-2010-kwk/intern/guardedalloc/intern/mallocn.c	2010-05-07 10:59:48 UTC (rev 28647)
+++ branches/soc-2010-kwk/intern/guardedalloc/intern/mallocn.c	2010-05-07 11:21:05 UTC (rev 28648)
@@ -138,7 +138,7 @@
 	
 
 static volatile int totblock= 0;
-static volatile uintptr_t mem_in_use= 0, mmap_in_use= 0;
+static volatile uintptr_t mem_in_use= 0, mmap_in_use= 0, peak_mem = 0;
 
 static volatile struct localListBase _membase;
 static volatile struct localListBase *membase = &_membase;
@@ -293,6 +293,8 @@
 	
 	totblock++;
 	mem_in_use += len;
+
+	peak_mem = mem_in_use > peak_mem ? mem_in_use : peak_mem;
 }
 
 void *MEM_mallocN(size_t len, const char *str)
@@ -377,6 +379,7 @@
 		make_memhead_header(memh, len, str);
 		memh->mmap= 1;
 		mmap_in_use += len;
+		peak_mem = mmap_in_use > peak_mem ? mmap_in_use : peak_mem;
 		mem_unlock_thread();
 #ifdef DEBUG_MEMCOUNTER
 		if(_mallocn_count==DEBUG_MEMCOUNTER_ERROR_VAL)
@@ -802,6 +805,24 @@
 	return(name);
 }
 
+uintptr_t MEM_get_peak_memory(void)
+{
+	uintptr_t _peak_mem;
+
+	mem_lock_thread();
+	_peak_mem = peak_mem;
+	mem_unlock_thread();
+
+	return _peak_mem;
+}
+
+void MEM_reset_peak_memory(void)
+{
+	mem_lock_thread();
+	peak_mem = 0;
+	mem_unlock_thread();
+}
+
 uintptr_t MEM_get_memory_in_use(void)
 {
 	uintptr_t _mem_in_use;

Modified: branches/soc-2010-kwk/release/datafiles/blenderbuttons
===================================================================
(Binary files differ)

Modified: branches/soc-2010-kwk/release/scripts/io/netrender/__init__.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/io/netrender/__init__.py	2010-05-07 10:59:48 UTC (rev 28647)
+++ branches/soc-2010-kwk/release/scripts/io/netrender/__init__.py	2010-05-07 11:21:05 UTC (rev 28648)
@@ -27,6 +27,7 @@
 from netrender import utils
 from netrender import balancing
 from netrender import ui
+from netrender import repath
 
 jobs = []
 slaves = []

Modified: branches/soc-2010-kwk/release/scripts/io/netrender/model.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/io/netrender/model.py	2010-05-07 10:59:48 UTC (rev 28647)
+++ branches/soc-2010-kwk/release/scripts/io/netrender/model.py	2010-05-07 11:21:05 UTC (rev 28648)
@@ -105,6 +105,7 @@
 class RenderFile:
     def __init__(self, filepath = "", index = 0, start = -1, end = -1, signature=0):
         self.filepath = filepath
+        self.original_path = filepath
         self.signature = signature
         self.index = index
         self.start = start
@@ -113,6 +114,7 @@
     def serialize(self):
         return 	{
                     "filepath": self.filepath,
+                    "original_path": self.original_path,
                     "index": self.index,
                     "start": self.start,
                     "end": self.end,
@@ -125,6 +127,7 @@
             return None
 
         rfile = RenderFile(data["filepath"], data["index"], data["start"], data["end"], data["signature"])
+        rfile.original_path = data["original_path"]
 
         return rfile
 

Modified: branches/soc-2010-kwk/release/scripts/io/netrender/operators.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/io/netrender/operators.py	2010-05-07 10:59:48 UTC (rev 28647)
+++ branches/soc-2010-kwk/release/scripts/io/netrender/operators.py	2010-05-07 11:21:05 UTC (rev 28648)
@@ -159,6 +159,36 @@
         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):
+        return True
+
+    def execute(self, context):
+        scene = context.scene
+        netsettings = scene.network_render
+
+        try:
+            conn = clientConnection(netsettings.server_address, netsettings.server_port, self.report)
+
+            if conn:
+                # Sending file
+                scene.network_render.job_id = client.clientSendJob(conn, scene, False)
+                conn.close()
+                self.report('INFO', "Job sent to master")
+        except Exception as err:
+            self.report('ERROR', str(err))
+
+
+        return {'FINISHED'}
+
+    def invoke(self, context, event):
+        return self.execute(context)
+
+ at rnaType
 class RENDER_OT_netclientstatus(bpy.types.Operator):
     '''Refresh the status of the current jobs'''
     bl_idname = "render.netclientstatus"

Copied: branches/soc-2010-kwk/release/scripts/io/netrender/repath.py (from rev 28647, trunk/blender/release/scripts/io/netrender/repath.py)
===================================================================
--- branches/soc-2010-kwk/release/scripts/io/netrender/repath.py	                        (rev 0)
+++ branches/soc-2010-kwk/release/scripts/io/netrender/repath.py	2010-05-07 11:21:05 UTC (rev 28648)
@@ -0,0 +1,145 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+import sys, os
+import subprocess
+
+import bpy
+
+from netrender.utils import *
+import netrender.model
+
+BLENDER_PATH = sys.argv[0]
+
+def reset(job):
+    main_file = job.files[0]
+    
+    job_full_path = main_file.filepath
+
+    if os.path.exists(job_full_path + ".bak"):
+        os.remove(job_full_path) # repathed file
+        os.renames(job_full_path + ".bak", job_full_path)
+
+def update(job):
+    paths = []
+    
+    main_file = job.files[0]
+    
+    job_full_path = main_file.filepath
+
+        
+    path, ext = os.path.splitext(job_full_path)
+    
+    new_path = path + ".remap" + ext 
+    
+    all = main_file.filepath == main_file.original_path 
+    
+    for rfile in job.files[1:]:
+        if all or rfile.original_path != rfile.filepath:
+            paths.append(rfile.original_path)
+            paths.append(rfile.filepath)
+    
+    # Only update if needed
+    if paths:        
+        process = subprocess.Popen([BLENDER_PATH, "-b", "-noaudio", job_full_path, "-P", __file__, "--", new_path] + paths, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+        process.wait()
+        
+        os.renames(job_full_path, job_full_path + ".bak")
+        os.renames(new_path, job_full_path)
+
+def process(paths):
+    def processPointCache(point_cache):
+        point_cache.external = False
+
+    def processFluid(fluid):
+        new_path = path_map.get(fluid.path, None)
+        if new_path:
+            fluid.path = new_path
+    
+    path_map = {}
+    for i in range(0, len(paths), 2):
+        # special case for point cache
+        if paths[i].endswith(".bphys"):
+            pass # Don't need them in the map, they all use the default external path
+            # NOTE: This is probably not correct all the time, need to be fixed.
+        # special case for fluids
+        elif paths[i].endswith(".bobj.gz"):
+            path_map[os.path.split(paths[i])[0]] = os.path.split(paths[i+1])[0]
+        else:
+            path_map[paths[i]] = paths[i+1]
+    
+    ###########################
+    # LIBRARIES
+    ###########################
+    for lib in bpy.data.libraries:

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list