~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/blender/modifiers/intern/MOD_weightvg_util.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
 * vertex index (in case the weight tables do not cover the whole vertices...).
60
60
 * cmap might be NULL, in which case curve mapping mode will return unmodified data.
61
61
 */
62
 
void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cmap)
 
62
void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cmap, RNG *rng)
63
63
{
64
64
        int i;
65
65
 
100
100
                                fac = (float)sqrt(2 * fac - fac * fac);
101
101
                                break;
102
102
                        case MOD_WVG_MAPPING_RANDOM:
103
 
                                BLI_srand(BLI_rand()); /* random seed */
104
 
                                fac = BLI_frand() * fac;
 
103
                                fac = BLI_rng_get_float(rng) * fac;
105
104
                                break;
106
105
                        case MOD_WVG_MAPPING_STEP:
107
106
                                fac = (fac >= 0.5f) ? 1.0f : 0.0f;
159
158
                        int idx = indices ? indices[i] : i;
160
159
                        TexResult texres;
161
160
                        float hsv[3]; /* For HSV color space. */
 
161
                        bool do_color_manage;
 
162
 
 
163
                        do_color_manage = tex_use_channel != MOD_WVG_MASK_TEX_USE_INT;
162
164
 
163
165
                        texres.nor = NULL;
164
 
                        get_texture_value(texture, tex_co[idx], &texres);
 
166
                        get_texture_value(scene, texture, tex_co[idx], &texres, do_color_manage);
165
167
                        /* Get the good channel value... */
166
168
                        switch (tex_use_channel) {
167
169
                                case MOD_WVG_MASK_TEX_USE_INT: