Code Cleanup: style and correct API class ref

This commit is contained in:
Campbell Barton
2014-01-26 22:17:01 +11:00
parent 97aab5acc4
commit 1c29fd77d3
7 changed files with 17 additions and 19 deletions

View File

@@ -720,8 +720,8 @@ base class --- :class:`SCA_IObject`
:rtype: :rtype:
* 3-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz)) * 3-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz))
* or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`) * or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`KX_PolyProxy`)
* or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`PolyProxy`, 2-tuple (u, v)) * or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`KX_PolyProxy`, 2-tuple (u, v))
.. note:: .. note::

View File

@@ -108,7 +108,7 @@ base class --- :class:`SCA_IObject`
:arg index: polygon number :arg index: polygon number
:type index: integer :type index: integer
:return: a polygon object. :return: a polygon object.
:rtype: :class:`PolyProxy` :rtype: :class:`KX_PolyProxy`
.. method:: transform(matid, matrix) .. method:: transform(matid, matrix)

View File

@@ -170,7 +170,7 @@ static DupliObject *make_dupli(const DupliContext *ctx,
* dupli object between frames, which is needed for motion blur. last level * dupli object between frames, which is needed for motion blur. last level
* goes first in the array. */ * goes first in the array. */
dob->persistent_id[0] = index; dob->persistent_id[0] = index;
for (i = 1; i < ctx->level+1; i++) for (i = 1; i < ctx->level + 1; i++)
dob->persistent_id[i] = ctx->persistent_id[ctx->level - i]; dob->persistent_id[i] = ctx->persistent_id[ctx->level - i];
/* fill rest of values with INT_MAX which index will never have as value */ /* fill rest of values with INT_MAX which index will never have as value */
for (; i < MAX_DUPLI_RECUR; i++) for (; i < MAX_DUPLI_RECUR; i++)
@@ -367,8 +367,6 @@ static void make_duplis_frames(const DupliContext *ctx)
} }
if (ok) { if (ok) {
DupliObject *dob;
/* WARNING: doing animation updates in this way is not terribly accurate, as the dependencies /* WARNING: doing animation updates in this way is not terribly accurate, as the dependencies
* and/or other objects which may affect this object's transforms are not updated either. * and/or other objects which may affect this object's transforms are not updated either.
* However, this has always been the way that this worked (i.e. pre 2.5), so I guess that it'll be fine! * However, this has always been the way that this worked (i.e. pre 2.5), so I guess that it'll be fine!
@@ -376,7 +374,7 @@ static void make_duplis_frames(const DupliContext *ctx)
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, (float)scene->r.cfra, ADT_RECALC_ANIM); /* ob-eval will do drivers, so we don't need to do them */ BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, (float)scene->r.cfra, ADT_RECALC_ANIM); /* ob-eval will do drivers, so we don't need to do them */
BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra); BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra);
dob = make_dupli(ctx, ob, ob->obmat, scene->r.cfra, false, false); make_dupli(ctx, ob, ob->obmat, scene->r.cfra, false, false);
} }
} }

View File

@@ -3677,7 +3677,7 @@ static void find_even_superellipse_params(int n, float r, float *r_params)
/* n is odd, so get one corner-cut chord. /* n is odd, so get one corner-cut chord.
* Solve u == sqrt(2*(1-n2*u)^2) where n2 = floor(n/2) */ * Solve u == sqrt(2*(1-n2*u)^2) where n2 = floor(n/2) */
n2 = n / 2; n2 = n / 2;
u = (2.0f * n2 - M_SQRT2) / (2.0f * n2 * n2 - 1); u = (2.0f * n2 - (float)M_SQRT2) / (2.0f * n2 * n2 - 1.0f);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
r_params[i] = i * u; r_params[i] = i * u;
r_params[n] = umax; r_params[n] = umax;

View File

@@ -195,17 +195,17 @@ void ScreenLensDistortionOperation::deinitExecution()
void ScreenLensDistortionOperation::determineUV(float result[6], float x, float y) const void ScreenLensDistortionOperation::determineUV(float result[6], float x, float y) const
{ {
float xy[2] = { x, y }; const float xy[2] = {x, y};
float uv[2]; float uv[2];
get_uv(xy, uv); get_uv(xy, uv);
float uv_dot = len_squared_v2(uv); float uv_dot = len_squared_v2(uv);
copy_v2_v2(result+0, xy); copy_v2_v2(result + 0, xy);
copy_v2_v2(result+2, xy); copy_v2_v2(result + 2, xy);
copy_v2_v2(result+4, xy); copy_v2_v2(result + 4, xy);
get_delta(uv_dot, m_k4[0], uv, result+0); get_delta(uv_dot, m_k4[0], uv, result + 0);
get_delta(uv_dot, m_k4[1], uv, result+2); get_delta(uv_dot, m_k4[1], uv, result + 2);
get_delta(uv_dot, m_k4[2], uv, result+4); get_delta(uv_dot, m_k4[2], uv, result + 4);
} }
bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)

View File

@@ -909,7 +909,7 @@ static bool ed_vgroup_transfer_weight(Object *ob_dst, Object *ob_src, bDeformGro
} }
/* Get meshes.*/ /* Get meshes.*/
dmesh_src = mesh_get_derived_final(scene, ob_src, CD_MASK_BAREMESH|CD_MASK_MDEFORMVERT); dmesh_src = mesh_get_derived_final(scene, ob_src, CD_MASK_BAREMESH | CD_MASK_MDEFORMVERT);
me_dst = ob_dst->data; me_dst = ob_dst->data;
/* Get vertex group array from source mesh */ /* Get vertex group array from source mesh */