Revision: 39011
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39011
Author:   miikah
Date:     2011-08-04 07:31:23 +0000 (Thu, 04 Aug 2011)
Log Message:
-----------
Merged latest commits from soc-2011-carrot into soc-2011-salad.

Modified Paths:
--------------
    
branches/soc-2011-salad/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
    branches/soc-2011-salad/source/blender/blenkernel/BKE_dynamicpaint.h
    branches/soc-2011-salad/source/blender/blenkernel/intern/dynamicpaint.c
    branches/soc-2011-salad/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-salad/source/blender/blenloader/intern/writefile.c
    branches/soc-2011-salad/source/blender/editors/include/ED_mesh.h
    branches/soc-2011-salad/source/blender/editors/mesh/mesh_data.c
    branches/soc-2011-salad/source/blender/editors/physics/physics_intern.h
    branches/soc-2011-salad/source/blender/editors/physics/physics_ops.c
    branches/soc-2011-salad/source/blender/makesdna/DNA_dynamicpaint_types.h
    branches/soc-2011-salad/source/blender/makesrna/intern/rna_dynamicpaint.c
    branches/soc-2011-salad/source/blender/modifiers/intern/MOD_dynamicpaint.c
    branches/soc-2011-salad/source/blender/render/extern/include/RE_shader_ext.h
    branches/soc-2011-salad/source/blender/render/intern/source/render_texture.c
    branches/soc-2011-salad/source/blender/render/intern/source/shadeinput.c
    branches/soc-2011-salad/source/blenderplayer/bad_level_call_stubs/stubs.c

Property Changed:
----------------
    branches/soc-2011-salad/


Property changes on: branches/soc-2011-salad
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36854,37548,37564,37602,37622,37848,38043,38064,38226,38231,38282,38620,38661-38662
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-38934
/branches/soc-2011-tomato:36831-38952
/trunk/blender:36834-38951
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36854,37548,37564,37602,37622,37848,38043,38064,38226,38231,38282,38620,38661-38662,39001,39009
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-38934
/branches/soc-2011-tomato:36831-38952
/trunk/blender:36834-38951

Modified: 
branches/soc-2011-salad/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
===================================================================
--- 
branches/soc-2011-salad/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
    2011-08-04 07:12:03 UTC (rev 39010)
+++ 
branches/soc-2011-salad/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
    2011-08-04 07:31:23 UTC (rev 39011)
@@ -119,6 +119,23 @@
                         if (brush.wave_type != "REFLECT"):
                             split = layout.split(percentage=0.6)
                             split.prop(brush, "wave_factor")
+                    elif (brush.brush_settings_context == "VELOCITY"):
+                        col = layout.row().column()
+                        col.label(text="Velocity Settings:")
+                        split = layout.split()
+                        col = split.column()
+                        col.prop(brush, "velocity_alpha")
+                        col.prop(brush, "velocity_color")
+                        col = split.column()
+                        col.prop(brush, "velocity_depth")
+                        sub = layout.row().column()
+                        sub.active = (brush.velocity_alpha or 
brush.velocity_color or brush.velocity_depth)
+                        sub.prop(brush, "max_velocity")
+                        sub.template_color_ramp(brush, "velocity_ramp", 
expand=True)
+                        layout.separator()
+                        layout.label(text="Smudge:")
+                        layout.prop(brush, "do_smudge")
+                        layout.prop(brush, "smudge_strength")
                     else:
                         layout.label(text="-WIP-")
 
@@ -199,17 +216,31 @@
         # vertex format outputs
         if (surface.surface_format == "VERTEX"):
             if (surface.surface_type == "PAINT"):
+                # paintmap output
                 row = layout.row()
                 row.prop_search(surface, "output_name", ob.data, 
"vertex_colors", text="Paintmap layer: ")
-                #col = row.column(align=True)
-                #col.operator("dpaint.output_add", icon='ZOOMIN', text="")
+                ic = 'ZOOMIN'
+                if (surface.output_exists(object=ob, index=0)):
+                    ic = 'ZOOMOUT'
+                col = row.column(align=True)
+                col.operator("dpaint.output_toggle", icon=ic, text="").index = 0
                 
+                # wetmap output
                 row = layout.row()
                 row.prop_search(surface, "output_name2", ob.data, 
"vertex_colors", text="Wetmap layer: ")
-                #col = row.column(align=True)
-                #col.operator("dpaint.output_add", icon='ZOOMIN', text="")
+                ic = 'ZOOMIN'
+                if (surface.output_exists(object=ob, index=1)):
+                    ic = 'ZOOMOUT'
+                col = row.column(align=True)
+                col.operator("dpaint.output_toggle", icon=ic, text="").index = 
1
             if (surface.surface_type == "WEIGHT"):
-                layout.prop_search(surface, "output_name", ob, 
"vertex_groups", text="Vertex Group: ")
+                row = layout.row()
+                row.prop_search(surface, "output_name", ob, "vertex_groups", 
text="Vertex Group: ")
+                ic = 'ZOOMIN'
+                if (surface.output_exists(object=ob, index=0)):
+                    ic = 'ZOOMOUT'
+                col = row.column(align=True)
+                col.operator("dpaint.output_toggle", icon=ic, text="").index = 0
 
         # image format outputs
         if (surface.surface_format == "IMAGE"):
@@ -280,7 +311,15 @@
             col = layout.column()
             col.active = surface.use_drip
             effector_weights_ui(self, context, surface.effector_weights)
+            split = layout.split()
 
+            layout.label(text="Surface Movement:")
+            split = layout.split()
+            col = split.column()
+            col.prop(surface, "drip_velocity", slider=True)
+            col = split.column()
+            col.prop(surface, "drip_acceleration", slider=True)
+
         elif surface.effect_ui == "SHRINK":
             layout.prop(surface, "use_shrink")
             col = layout.column()

Modified: branches/soc-2011-salad/source/blender/blenkernel/BKE_dynamicpaint.h
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/BKE_dynamicpaint.h        
2011-08-04 07:12:03 UTC (rev 39010)
+++ branches/soc-2011-salad/source/blender/blenkernel/BKE_dynamicpaint.h        
2011-08-04 07:31:23 UTC (rev 39011)
@@ -58,8 +58,6 @@
        short state; /* 0 = neutral
                                 *  1 = obstacle
                                 *  2 = reflect only */
-       float foam;
-
 } PaintWavePoint;
 
 struct DerivedMesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData 
*pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
@@ -70,6 +68,7 @@
 void dynamicPaint_clearSurface(DynamicPaintSurface *surface);
 int  dynamicPaint_resetSurface(struct DynamicPaintSurface *surface);
 int  dynamicPaint_surfaceHasColorPreview(DynamicPaintSurface *surface);
+int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, struct 
Object *ob, int index);
 void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface);
 void dynamicPaintSurface_setUniqueName(DynamicPaintSurface *surface, char 
*basename);
 

Modified: 
branches/soc-2011-salad/source/blender/blenkernel/intern/dynamicpaint.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/dynamicpaint.c     
2011-08-04 07:12:03 UTC (rev 39010)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/dynamicpaint.c     
2011-08-04 07:31:23 UTC (rev 39011)
@@ -58,12 +58,14 @@
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h" /* to get temp file path        */
 
+#include "ED_mesh.h"
+#include "ED_screen.h"
+
 #include "RNA_access.h"
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
 /* for bake operator   */
-#include "ED_screen.h"
 #include "WM_types.h"
 #include "WM_api.h"
 
@@ -154,17 +156,27 @@
 
 /* Temp surface data used to process a frame */
 typedef struct PaintBakeData {
+       /* point space data */
        PaintBakeNormal *bNormal;
        unsigned int *s_pos;            /* index to start reading point sample 
realCoord */
        unsigned int *s_num;    /* num of samples for each point */
        Vec3f *realCoord;  /* current pixel center world-space coordinates * 
numOfSamples
                                           *  ordered as (s_pos+sample_num)*/
 
+       /* adjacency */
        BakeNeighPoint *bNeighs; /* current frame neighbour distances, if 
required */
+       double average_dist;
+       /* space partitioning */
        VolumeGrid *grid;       /* space partitioning grid to optimize brush 
checks */
 
-       MVert *prev_verts;      /* copy of previous frame vertices. used 
observe surface movement */
+       /* velocity and movement */
+       Vec3f *velocity;  /* speed vector in global space movement per frame, 
if required */
+       Vec3f *prev_velocity;
+       float *brush_velocity; /* special temp data for post-p velocity based 
brushes like smudge
+                                                  *  3 float dir vec + 1 float 
str */
+       MVert *prev_verts;      /* copy of previous frame vertices. used to 
observe surface movement */
        float prev_obmat[4][4]; /* previous frame object matrix */
+       int clear;
 
 } PaintBakeData;
 
@@ -322,6 +334,29 @@
                dynamicPaint_resetPreview(surface->canvas);
 }
 
+int dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, Object 
*ob, int index)
+{
+       char *name;
+
+       if (index == 0)
+               name = surface->output_name;
+       else if (index == 1)
+               name = surface->output_name2;
+       else
+               return 0;
+
+       if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
+               if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
+                       Mesh *me = ob->data;
+                       return (CustomData_get_named_layer_index(&me->fdata, 
CD_MCOL, name) != -1);
+               }
+               else if (surface->type == MOD_DPAINT_SURFACE_T_WEIGHT)
+                       return (defgroup_name_index(ob, surface->output_name) 
!= -1);
+       }
+
+       return 0;
+}
+
 static int surfaceDublicateNameExists(void *arg, const char *name)
 {
        DynamicPaintSurface *t_surface = (DynamicPaintSurface*)arg;
@@ -370,6 +405,108 @@
        t_color[2] = t_color[2]*invFact + s_color[2]*factor;
 }
 
+#define UPDATE_PARENTS (1<<0)
+#define UPDATE_MESH (1<<1)
+#define UPDATE_EVERYTHING (UPDATE_PARENTS|UPDATE_MESH)
+
+static void subframe_updateObject(Scene *scene, Object *ob, int flags, float 
frame)
+{
+       int oflags;
+       DynamicPaintModifierData *pmd = (DynamicPaintModifierData 
*)modifiers_findByType(ob, eModifierType_DynamicPaint);
+
+       /* if other is dynamic paint canvas, dont update */
+       if (pmd && pmd->canvas)
+               return;
+
+       /* if object has parent, update it too */
+       if ((flags & UPDATE_PARENTS) && ob->parent) 
subframe_updateObject(scene, ob->parent, 0, frame);
+       if ((flags & UPDATE_PARENTS) && ob->track) subframe_updateObject(scene, 
ob->track, 0, frame);
+
+       /* for curve */
+       if(ob->type==OB_CURVE) {
+               Curve *cu= ob->data;
+               BKE_animsys_evaluate_animdata(scene, &cu->id, cu->adt, frame, 
ADT_RECALC_ANIM);
+       }
+       
+       /* backup object flags */
+       oflags = ob->recalc;
+
+       ob->recalc |= OB_RECALC_ALL;
+       ob->recalc |= OB_RECALC_DATA;
+       BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, frame, 
ADT_RECALC_ANIM);
+       if (flags & UPDATE_MESH)
+               object_handle_update(scene, ob);
+       else
+               where_is_object_time(scene, ob, frame);
+
+       /* restore object flags */
+       ob->recalc = oflags;
+}
+
+static void scene_setSubframe(Scene *scene, float subframe)

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to