[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60856] branches/vgroup_modifiers: svn merge -r 60799:60855 https://svn.blender.org/svnroot/bf-blender/trunk/ blender

Bastien Montagne montagne29 at wanadoo.fr
Sat Oct 19 14:27:39 CEST 2013


Revision: 60856
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60856
Author:   mont29
Date:     2013-10-19 12:27:38 +0000 (Sat, 19 Oct 2013)
Log Message:
-----------
svn merge -r 60799:60855 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/vgroup_modifiers/intern/cycles/blender/blender_curves.cpp
    branches/vgroup_modifiers/intern/cycles/blender/blender_mesh.cpp
    branches/vgroup_modifiers/intern/cycles/blender/blender_object.cpp
    branches/vgroup_modifiers/intern/cycles/blender/blender_sync.h
    branches/vgroup_modifiers/intern/cycles/device/device.cpp
    branches/vgroup_modifiers/intern/cycles/render/buffers.cpp
    branches/vgroup_modifiers/intern/cycles/render/object.cpp
    branches/vgroup_modifiers/release/scripts/modules/bl_i18n_utils/utils.py
    branches/vgroup_modifiers/release/scripts/startup/bl_operators/wm.py
    branches/vgroup_modifiers/release/scripts/startup/bl_ui/properties_particle.py
    branches/vgroup_modifiers/source/blender/blenkernel/BKE_curve.h
    branches/vgroup_modifiers/source/blender/blenkernel/intern/DerivedMesh.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/cdderivedmesh.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/curve.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/editderivedmesh.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/mball.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/object.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/scene.c
    branches/vgroup_modifiers/source/blender/blenkernel/intern/subsurf_ccg.c
    branches/vgroup_modifiers/source/blender/blenlib/BLI_math_matrix.h
    branches/vgroup_modifiers/source/blender/blenlib/BLI_math_vector.h
    branches/vgroup_modifiers/source/blender/blenlib/BLI_sys_types.h
    branches/vgroup_modifiers/source/blender/blenlib/intern/math_matrix.c
    branches/vgroup_modifiers/source/blender/blenlib/intern/math_vector_inline.c
    branches/vgroup_modifiers/source/blender/blenloader/intern/readfile.c
    branches/vgroup_modifiers/source/blender/bmesh/intern/bmesh_polygon.c
    branches/vgroup_modifiers/source/blender/editors/animation/anim_channels_edit.c
    branches/vgroup_modifiers/source/blender/editors/armature/pose_select.c
    branches/vgroup_modifiers/source/blender/editors/curve/editcurve.c
    branches/vgroup_modifiers/source/blender/editors/include/ED_armature.h
    branches/vgroup_modifiers/source/blender/editors/include/ED_view3d.h
    branches/vgroup_modifiers/source/blender/editors/interface/interface.c
    branches/vgroup_modifiers/source/blender/editors/interface/interface_handlers.c
    branches/vgroup_modifiers/source/blender/editors/interface/interface_intern.h
    branches/vgroup_modifiers/source/blender/editors/object/object_bake.c
    branches/vgroup_modifiers/source/blender/editors/render/render_shading.c
    branches/vgroup_modifiers/source/blender/editors/space_clip/clip_editor.c
    branches/vgroup_modifiers/source/blender/editors/space_sequencer/space_sequencer.c
    branches/vgroup_modifiers/source/blender/editors/space_text/space_text.c
    branches/vgroup_modifiers/source/blender/editors/space_text/text_ops.c
    branches/vgroup_modifiers/source/blender/editors/space_view3d/drawmesh.c
    branches/vgroup_modifiers/source/blender/editors/space_view3d/view3d_draw.c
    branches/vgroup_modifiers/source/blender/imbuf/intern/oiio/openimageio_api.cpp
    branches/vgroup_modifiers/source/blender/makesdna/DNA_curve_types.h
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_nodetree.c
    branches/vgroup_modifiers/source/blender/python/generic/idprop_py_api.c
    branches/vgroup_modifiers/source/blender/python/generic/idprop_py_api.h
    branches/vgroup_modifiers/source/blender/python/generic/py_capi_utils.c
    branches/vgroup_modifiers/source/blender/python/generic/py_capi_utils.h
    branches/vgroup_modifiers/source/blender/render/intern/source/bake.c
    branches/vgroup_modifiers/source/blender/render/intern/source/multires_bake.c

Property Changed:
----------------
    branches/vgroup_modifiers/
    branches/vgroup_modifiers/source/blender/editors/interface/interface.c


Property changes on: branches/vgroup_modifiers
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-depsgraph_mt:57516,57900,57939-57940,57945,57958-57961,58151,58155-58156,58169,58277-58279,58282-58283,58711,58787,58789,58796,59086-59087,59163,59166,59170,59181,59259-59260,59942,60073,60094,60096,60105
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032,59214,59220,59251,59601
/branches/soc-2013-rigid_body_sim:60311
/tags/blender-2.67b-release/blender:57122
/trunk/blender:38694-38739,38741-39198,39200-39651,39653-39988,39990-43541,43543-60799
   + /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-depsgraph_mt:57516,57900,57939-57940,57945,57958-57961,58151,58155-58156,58169,58277-58279,58282-58283,58711,58787,58789,58796,59086-59087,59163,59166,59170,59181,59259-59260,59942,60073,60094,60096,60105
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032,59214,59220,59251,59601
/branches/soc-2013-rigid_body_sim:60311
/tags/blender-2.67b-release/blender:57122
/trunk/blender:38694-38739,38741-39198,39200-39651,39653-39988,39990-43541,43543-60855

Modified: branches/vgroup_modifiers/intern/cycles/blender/blender_curves.cpp
===================================================================
--- branches/vgroup_modifiers/intern/cycles/blender/blender_curves.cpp	2013-10-19 11:09:49 UTC (rev 60855)
+++ branches/vgroup_modifiers/intern/cycles/blender/blender_curves.cpp	2013-10-19 12:27:38 UTC (rev 60856)
@@ -628,6 +628,47 @@
 	}
 }
 
+static void ExportCurveSegmentsMotion(Scene *scene, Mesh *mesh, ParticleCurveData *CData, int motion)
+{
+	/* export motion vectors for curve keys */
+	AttributeStandard std = (motion == -1)? ATTR_STD_MOTION_PRE: ATTR_STD_MOTION_POST;
+	Attribute *attr_motion = mesh->curve_attributes.add(std);
+	float3 *data_motion = attr_motion->data_float3();
+	float3 *current_motion = data_motion;
+	size_t size = mesh->curve_keys.size();
+	size_t i = 0;
+	bool have_motion = false;
+
+	for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
+		if(CData->psys_curvenum[sys] == 0)
+			continue;
+
+		for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
+			if(CData->curve_keynum[curve] <= 1)
+				continue;
+
+			for(int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve]; curvekey++) {
+				if(i < mesh->curve_keys.size()) {
+					*current_motion = CData->curvekey_co[curvekey];
+
+					/* unlike mesh coordinates, these tend to be slightly different
+					 * between frames due to particle transforms into/out of object
+					 * space, so we use an epsilon to detect actual changes */
+					if(len_squared(*current_motion - mesh->curve_keys[i].co) > 1e-5f*1e-5f)
+						have_motion = true;
+
+					current_motion++;
+				}
+
+				i++;
+			}
+		}
+	}
+
+	if(i != size || !have_motion)
+		mesh->curve_attributes.remove(std);
+}
+
 void ExportCurveTriangleUV(Mesh *mesh, ParticleCurveData *CData, int vert_offset, int resol, float3 *uvdata)
 {
 	if(uvdata == NULL)
@@ -778,18 +819,21 @@
 
 }
 
-void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool object_updated)
+void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, int motion)
 {
-	/* Clear stored curve data */
-	mesh->curve_keys.clear();
-	mesh->curves.clear();
-	mesh->curve_attributes.clear();
+	if(!motion) {
+		/* Clear stored curve data */
+		mesh->curve_keys.clear();
+		mesh->curves.clear();
+		mesh->curve_attributes.clear();
+	}
 
 	/* obtain general settings */
 	bool use_curves = scene->curve_system_manager->use_curves;
 
 	if(!(use_curves && b_ob.mode() == b_ob.mode_OBJECT)) {
-		mesh->compute_bounds();
+		if(!motion)
+			mesh->compute_bounds();
 		return;
 	}
 
@@ -829,13 +873,15 @@
 		}
 	}
 	else {
-		ExportCurveSegments(scene, mesh, &CData);
+		if(motion)
+			ExportCurveSegmentsMotion(scene, mesh, &CData, motion);
+		else
+			ExportCurveSegments(scene, mesh, &CData);
 	}
 
-
 	/* generated coordinates from first key. we should ideally get this from
 	 * blender to handle deforming objects */
-	{
+	if(!motion) {
 		if(mesh->need_attribute(scene, ATTR_STD_GENERATED)) {
 			float3 loc, size;
 			mesh_texture_space(b_mesh, loc, size);
@@ -861,7 +907,7 @@
 	}
 
 	/* create vertex color attributes */
-	{
+	if(!motion) {
 		BL::Mesh::tessface_vertex_colors_iterator l;
 		int vcol_num = 0;
 
@@ -895,7 +941,7 @@
 	}
 
 	/* create UV attributes */
-	{
+	if(!motion) {
 		BL::Mesh::tessface_uv_textures_iterator l;
 		int uv_num = 0;
 
@@ -943,6 +989,5 @@
 	mesh->compute_bounds();
 }
 
-
 CCL_NAMESPACE_END
 

Modified: branches/vgroup_modifiers/intern/cycles/blender/blender_mesh.cpp
===================================================================
--- branches/vgroup_modifiers/intern/cycles/blender/blender_mesh.cpp	2013-10-19 11:09:49 UTC (rev 60855)
+++ branches/vgroup_modifiers/intern/cycles/blender/blender_mesh.cpp	2013-10-19 12:27:38 UTC (rev 60856)
@@ -488,7 +488,7 @@
 			}
 
 			if(render_layer.use_hair)
-				sync_curves(mesh, b_mesh, b_ob, object_updated);
+				sync_curves(mesh, b_mesh, b_ob, 0);
 
 			/* free derived mesh */
 			b_data.meshes.remove(b_mesh);
@@ -539,6 +539,12 @@
 	if(!size || !ccl::BKE_object_is_deform_modified(b_ob, b_scene, preview))
 		return;
 
+	/* ensure we only sync instanced meshes once */
+	if(mesh_motion_synced.find(mesh) != mesh_motion_synced.end())
+		return;
+
+	mesh_motion_synced.insert(mesh);
+
 	/* get derived mesh */
 	BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview, false);
 
@@ -556,6 +562,10 @@
 		if(i != size || memcmp(M, &mesh->verts[0], sizeof(float3)*size) == 0)
 			mesh->attributes.remove(std);
 
+		/* hair motion */
+		if(render_layer.use_hair)
+			sync_curves(mesh, b_mesh, b_ob, motion);
+
 		/* free derived mesh */
 		b_data.meshes.remove(b_mesh);
 	}

Modified: branches/vgroup_modifiers/intern/cycles/blender/blender_object.cpp
===================================================================
--- branches/vgroup_modifiers/intern/cycles/blender/blender_object.cpp	2013-10-19 11:09:49 UTC (rev 60855)
+++ branches/vgroup_modifiers/intern/cycles/blender/blender_object.cpp	2013-10-19 12:27:38 UTC (rev 60856)
@@ -405,6 +405,9 @@
 		mesh_synced.clear();
 		particle_system_map.pre_sync();
 	}
+	else {
+		mesh_motion_synced.clear();
+	}
 
 	/* object loop */
 	BL::Scene::objects_iterator b_ob;
@@ -492,6 +495,9 @@
 			scene->particle_system_manager->tag_update(scene);
 		mesh_synced.clear();
 	}
+
+	if(motion)
+		mesh_motion_synced.clear();
 }
 
 void BlenderSync::sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override)

Modified: branches/vgroup_modifiers/intern/cycles/blender/blender_sync.h
===================================================================
--- branches/vgroup_modifiers/intern/cycles/blender/blender_sync.h	2013-10-19 11:09:49 UTC (rev 60855)
+++ branches/vgroup_modifiers/intern/cycles/blender/blender_sync.h	2013-10-19 12:27:38 UTC (rev 60856)
@@ -81,7 +81,7 @@
 
 	void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
 	Mesh *sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tris);
-	void sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool object_updated);
+	void sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, int motion);
 	Object *sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_object, Transform& tfm, uint layer_flag, int motion, bool hide_tris);
 	void sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm);
 	void sync_background_light();
@@ -108,6 +108,7 @@
 	id_map<ObjectKey, Light> light_map;
 	id_map<ParticleSystemKey, ParticleSystem> particle_system_map;
 	set<Mesh*> mesh_synced;
+	set<Mesh*> mesh_motion_synced;
 	void *world_map;
 	bool world_recalc;
 

Modified: branches/vgroup_modifiers/intern/cycles/device/device.cpp
===================================================================
--- branches/vgroup_modifiers/intern/cycles/device/device.cpp	2013-10-19 11:09:49 UTC (rev 60855)
+++ branches/vgroup_modifiers/intern/cycles/device/device.cpp	2013-10-19 12:27:38 UTC (rev 60856)
@@ -64,11 +64,16 @@
 	glColor3f(1.0f, 1.0f, 1.0f);
 
 	if(rgba.data_type == TYPE_HALF) {
+		/* for multi devices, this assumes the ineffecient method that we allocate
+		 * all pixels on the device even though we only render to a subset */
+		GLhalf *data_pointer = (GLhalf*)rgba.data_pointer;
+		data_pointer += 4*y*w;
+
 		/* draw half float texture, GLSL shader for display transform assumed to be bound */
 		GLuint texid;
 		glGenTextures(1, &texid);
 		glBindTexture(GL_TEXTURE_2D, texid);
-		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, w, h, 0, GL_RGBA, GL_HALF_FLOAT, (void*)rgba.data_pointer);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list