[Bf-blender-cvs] [773efb5] temp_remove_particles: Removed particle sync code from Cycles.

Lukas Tönne noreply at git.blender.org
Wed Apr 20 12:01:30 CEST 2016


Commit: 773efb506a9a60d587df26c5b3e15c59fb53c42c
Author: Lukas Tönne
Date:   Wed Apr 20 11:59:02 2016 +0200
Branches: temp_remove_particles
https://developer.blender.org/rB773efb506a9a60d587df26c5b3e15c59fb53c42c

Removed particle sync code from Cycles.

Note that this only removes the actual dependencies of Cycles on the
particle code in Blender, but not the internal "particle" definition
or the curve type handling inside Cycles. These structures may be in need
of some improvement themselves, but that is out of scope here.

===================================================================

M	intern/cycles/blender/CMakeLists.txt
M	intern/cycles/blender/addon/properties.py
M	intern/cycles/blender/addon/ui.py
M	intern/cycles/blender/blender_curves.cpp
M	intern/cycles/blender/blender_object.cpp
D	intern/cycles/blender/blender_particles.cpp
M	intern/cycles/blender/blender_sync.cpp
M	intern/cycles/blender/blender_sync.h
M	intern/cycles/blender/blender_util.h

===================================================================

diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt
index a8cc490..d139e85 100644
--- a/intern/cycles/blender/CMakeLists.txt
+++ b/intern/cycles/blender/CMakeLists.txt
@@ -24,7 +24,6 @@ set(SRC
 	blender_camera.cpp
 	blender_mesh.cpp
 	blender_object.cpp
-	blender_particles.cpp
 	blender_curves.cpp
 	blender_logging.cpp
 	blender_python.cpp
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 68f5f4b..32cf83a 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -1058,49 +1058,6 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
         del bpy.types.Scene.cycles_curves
 
 
-class CyclesCurveSettings(bpy.types.PropertyGroup):
-    @classmethod
-    def register(cls):
-        bpy.types.ParticleSettings.cycles = PointerProperty(
-                name="Cycles Hair Settings",
-                description="Cycles hair settings",
-                type=cls,
-                )
-        cls.radius_scale = FloatProperty(
-                name="Radius Scaling",
-                description="Multiplier of width properties",
-                min=0.0, max=1000.0,
-                default=0.01,
-                )
-        cls.root_width = FloatProperty(
-                name="Root Size",
-                description="Strand's width at root",
-                min=0.0, max=1000.0,
-                default=1.0,
-                )
-        cls.tip_width = FloatProperty(
-                name="Tip Multiplier",
-                description="Strand's width at tip",
-                min=0.0, max=1000.0,
-                default=0.0,
-                )
-        cls.shape = FloatProperty(
-                name="Strand Shape",
-                description="Strand shape parameter",
-                min=-1.0, max=1.0,
-                default=0.0,
-                )
-        cls.use_closetip = BoolProperty(
-                name="Close tip",
-                description="Set tip radius to zero",
-                default=True,
-                )
-
-    @classmethod
-    def unregister(cls):
-        del bpy.types.ParticleSettings.cycles
-
-
 def register():
     bpy.utils.register_class(CyclesRenderSettings)
     bpy.utils.register_class(CyclesCameraSettings)
@@ -1110,7 +1067,6 @@ def register():
     bpy.utils.register_class(CyclesVisibilitySettings)
     bpy.utils.register_class(CyclesMeshSettings)
     bpy.utils.register_class(CyclesCurveRenderSettings)
-    bpy.utils.register_class(CyclesCurveSettings)
 
 
 def unregister():
@@ -1122,4 +1078,3 @@ def unregister():
     bpy.utils.unregister_class(CyclesMeshSettings)
     bpy.utils.unregister_class(CyclesVisibilitySettings)
     bpy.utils.unregister_class(CyclesCurveRenderSettings)
-    bpy.utils.unregister_class(CyclesCurveSettings)
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index c02e249..ae9b361 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1367,37 +1367,6 @@ class CyclesTexture_PT_colors(CyclesButtonsPanel, Panel):
             layout.template_color_ramp(mapping, "color_ramp", expand=True)
 
 
-class CyclesParticle_PT_textures(CyclesButtonsPanel, Panel):
-    bl_label = "Textures"
-    bl_context = "particle"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(cls, context):
-        psys = context.particle_system
-        return psys and CyclesButtonsPanel.poll(context)
-
-    def draw(self, context):
-        layout = self.layout
-
-        psys = context.particle_system
-        part = psys.settings
-
-        row = layout.row()
-        row.template_list("TEXTURE_UL_texslots", "", part, "texture_slots", part, "active_texture_index", rows=2)
-
-        col = row.column(align=True)
-        col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP'
-        col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN'
-        col.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="")
-
-        if not part.active_texture:
-            layout.template_ID(part, "active_texture", new="texture.new")
-        else:
-            slot = part.texture_slots[part.active_texture_index]
-            layout.template_ID(slot, "texture", new="texture.new")
-
-
 class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel):
     bl_label = "Cycles Hair Rendering"
     bl_context = "particle"
@@ -1542,37 +1511,6 @@ class CyclesRender_PT_debug(CyclesButtonsPanel, Panel):
         col.prop(cscene, "debug_use_opencl_debug", text="Debug")
 
 
-class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel):
-    bl_label = "Cycles Hair Settings"
-    bl_context = "particle"
-
-    @classmethod
-    def poll(cls, context):
-        scene = context.scene
-        ccscene = scene.cycles_curves
-        psys = context.particle_system
-        use_curves = ccscene.use_curves and psys
-        return CyclesButtonsPanel.poll(context) and use_curves and psys.settings.type == 'HAIR'
-
-    def draw(self, context):
-        layout = self.layout
-
-        psys = context.particle_settings
-        cpsys = psys.cycles
-
-        row = layout.row()
-        row.prop(cpsys, "shape", text="Shape")
-
-        layout.label(text="Thickness:")
-        row = layout.row()
-        row.prop(cpsys, "root_width", text="Root")
-        row.prop(cpsys, "tip_width", text="Tip")
-
-        row = layout.row()
-        row.prop(cpsys, "radius_scale", text="Scaling")
-        row.prop(cpsys, "use_closetip", text="Close tip")
-
-
 class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel):
     bl_label = "Simplify"
     bl_context = "scene"
@@ -1595,12 +1533,10 @@ class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel):
         col = split.column()
         col.label(text="Viewport:")
         col.prop(rd, "simplify_subdivision", text="Subdivision")
-        col.prop(rd, "simplify_child_particles", text="Child Particles")
 
         col = split.column()
         col.label(text="Render:")
         col.prop(rd, "simplify_subdivision_render", text="Subdivision")
-        col.prop(rd, "simplify_child_particles_render", text="Child Particles")
 
         col = layout.column()
         col.prop(cscene, "use_camera_cull")
@@ -1714,24 +1650,9 @@ def get_panels():
         "TEXTURE_PT_ocean",
         "TEXTURE_PT_influence",
         "TEXTURE_PT_colors",
-        "PARTICLE_PT_context_particles",
-        "PARTICLE_PT_custom_props",
-        "PARTICLE_PT_emission",
-        "PARTICLE_PT_hair_dynamics",
-        "PARTICLE_PT_cache",
-        "PARTICLE_PT_velocity",
-        "PARTICLE_PT_rotation",
-        "PARTICLE_PT_physics",
         "SCENE_PT_rigid_body_world",
         "SCENE_PT_rigid_body_cache",
         "SCENE_PT_rigid_body_field_weights",
-        "PARTICLE_PT_boidbrain",
-        "PARTICLE_PT_render",
-        "PARTICLE_PT_draw",
-        "PARTICLE_PT_children",
-        "PARTICLE_PT_field_weights",
-        "PARTICLE_PT_force_fields",
-        "PARTICLE_PT_vertexgroups",
         "MATERIAL_PT_custom_props",
         "MATERIAL_PT_freestyle_line",
         "BONE_PT_custom_props",
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 0178bfb..39521c8 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -37,9 +37,6 @@ void curveinterp_v3_v3v3v3v3(float3 *p, float3 *v1, float3 *v2, float3 *v3, floa
 void interp_weights(float t, float data[4]);
 float shaperadius(float shape, float root, float tip, float time);
 void InterpolateKeySegments(int seg, int segno, int key, int curve, float3 *keyloc, float *time, ParticleCurveData *CData);
-bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool background, int uv_num);
-bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool background, int vcol_num);
-bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool background);
 void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CData);
 void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData,
                                float3 RotCam, bool is_ortho);
@@ -119,221 +116,6 @@ void InterpolateKeySegments(int seg, int segno, int key, int curve, float3 *keyl
 		curveinterp_v3_v3v3v3v3(keyloc, &ckey_loc1, &ckey_loc2, &ckey_loc3, &ckey_loc4, t);
 }
 
-bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, ParticleCurveData *CData, bool background)
-{
-	int curvenum = 0;
-	int keyno = 0;
-
-	if(!(mesh && b_mesh && b_ob && CData))
-		return false;
-
-	Transform tfm = get_transform(b_ob->matrix_world());
-	Transform itfm = transform_quick_inverse(tfm);
-
-	BL::Object::modifiers_iterator b_mod;
-	for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
-		if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && (background ? b_mod->show_render() : b_mod->show_viewport())) {
-			BL::ParticleSystemModifier psmd((const PointerRNA)b_mod->ptr);
-			BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr);
-			BL::ParticleSettings b_part((const PointerRNA)b_psys.settings().ptr);
-
-			if((b_part.render_type() == BL::ParticleSettings::render_type_PATH) && (b_part.type() == BL::ParticleSettings::type_HAIR)) {
-				int mi = clamp(b_part.material()-1, 0, mesh->used_shaders.size()-1);
-				int shader = mesh->used_shaders[mi];
-				int draw_step = background ? b_part.render_step() : b_part.draw_step();
-				int totparts = b_psys.particles.length();
-				int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_part.draw_percentage() / 100.0f);
-				int totcurves = totchild;
-				
-				if(b_part.child_type() == 0 || totchild == 0)
-					totcurves += totparts;
-
-				if(totcurves == 0)
-					continue;
-
-				int ren_step = (1 << draw_step) + 1;
-				if(b_part.kink() == BL::ParticleSettings::kink_SPIRAL)
-					ren_step += b_part.kink_extra_steps();
-
-				PointerRNA cpsys = RNA_pointer_get(&b_part.ptr, "cycles");
-
-				CData->psy

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list