[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49133] branches/smoke2/intern/cycles: Start to work on Smoke + Cycles.

Daniel Genrich daniel.genrich at gmx.net
Mon Jul 23 11:18:32 CEST 2012


Revision: 49133
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49133
Author:   genscher
Date:     2012-07-23 09:18:32 +0000 (Mon, 23 Jul 2012)
Log Message:
-----------
Start to work on Smoke + Cycles.

Goal is a proof of concept, then cleaning code up :-)

Modified Paths:
--------------
    branches/smoke2/intern/cycles/blender/blender_object.cpp
    branches/smoke2/intern/cycles/blender/blender_sync.h
    branches/smoke2/intern/cycles/render/object.h

Modified: branches/smoke2/intern/cycles/blender/blender_object.cpp
===================================================================
--- branches/smoke2/intern/cycles/blender/blender_object.cpp	2012-07-23 02:16:26 UTC (rev 49132)
+++ branches/smoke2/intern/cycles/blender/blender_object.cpp	2012-07-23 09:18:32 UTC (rev 49133)
@@ -53,6 +53,26 @@
 	return false;
 }
 
+/* Only looking for Smoke domains */
+// TODO DG: disable rendering of smoke flow??
+bool BlenderSync::BKE_modifiers_isSmokeEnabled(BL::Object b_ob)
+{
+	BL::Object::modifiers_iterator b_modifiers;
+	for(b_ob.modifiers.begin(b_modifiers); b_modifiers != b_ob.modifiers.end(); ++b_modifiers) {
+		BL::Modifier mod = (*b_modifiers);
+
+		if (mod.is_a(&RNA_SmokeModifier)) {
+			BL::SmokeModifier smd(mod);
+
+			if(smd.smoke_type() == BL::SmokeModifier::smoke_type_DOMAIN) {
+				return true;
+			}
+		}
+	}
+
+	return false;
+}
+
 bool BlenderSync::object_is_mesh(BL::Object b_ob)
 {
 	BL::ID b_ob_data = b_ob.data();
@@ -242,6 +262,11 @@
 	/* mesh sync */
 	object->mesh = sync_mesh(b_ob, object_updated);
 
+	if(BKE_modifiers_isSmokeEnabled(b_ob))
+	{
+		// TODO DG sync_volume(b_ob);
+	}
+
 	if(use_holdout != object->use_holdout) {
 		object->use_holdout = use_holdout;
 		scene->object_manager->tag_update(scene);

Modified: branches/smoke2/intern/cycles/blender/blender_sync.h
===================================================================
--- branches/smoke2/intern/cycles/blender/blender_sync.h	2012-07-23 02:16:26 UTC (rev 49132)
+++ branches/smoke2/intern/cycles/blender/blender_sync.h	2012-07-23 09:18:32 UTC (rev 49133)
@@ -90,6 +90,7 @@
 	/* util */
 	void find_shader(BL::ID id, vector<uint>& used_shaders, int default_shader);
 	bool BKE_object_is_modified(BL::Object b_ob);
+	bool BKE_modifiers_isSmokeEnabled(BL::Object b_ob);
 	bool object_is_mesh(BL::Object b_ob);
 	bool object_is_light(BL::Object b_ob);
 	bool object_use_particles(BL::Object b_ob);

Modified: branches/smoke2/intern/cycles/render/object.h
===================================================================
--- branches/smoke2/intern/cycles/render/object.h	2012-07-23 02:16:26 UTC (rev 49132)
+++ branches/smoke2/intern/cycles/render/object.h	2012-07-23 09:18:32 UTC (rev 49133)
@@ -57,6 +57,11 @@
 	int particle_id;
 	vector<Particle> particles;
 
+	/* Voxel / 3D volume data */
+	bool use_volume;
+	int3 resolution;
+	vector<float3> grid;
+
 	Object();
 	~Object();
 




More information about the Bf-blender-cvs mailing list