Merge branch 'master' into blender2.8
This commit is contained in:
commit
55e719ec35
|
@ -1,7 +1,4 @@
|
|||
/*
|
||||
* BKE_fluidsim.h
|
||||
*
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -44,5 +41,3 @@ int performElbeemSimulation(char *cfgfilename);
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
* - Determining the effect of the drop on the target application.
|
||||
* - Incorporating any valid dropped data when the drop occurs.
|
||||
* - Communicating target feedback to the source so the source application
|
||||
* can provide appropriate visual feedback such as setting the cursor.
|
||||
* can provide appropriate visual feedback such as setting the cursor.
|
||||
* - Implementing drag scrolling.
|
||||
* - Registering and revoking its application windows as drop targets.
|
||||
*
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): James Deery 11/2009
|
||||
* Damien Plisson 12/2009
|
||||
* Contributor(s): James Deery 11/2009
|
||||
* Damien Plisson 12/2009
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Maarten Gribnau 05/2001
|
||||
* Damien Plisson 09/2009
|
||||
* Contributor(s): Maarten Gribnau 05/2001
|
||||
* Damien Plisson 09/2009
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
|
|
@ -149,16 +149,16 @@ public:
|
|||
* Create a new window.
|
||||
* The new window is added to the list of windows managed.
|
||||
* Never explicitly delete the window, use disposeWindow() instead.
|
||||
* \param title The name of the window (displayed in the title bar of the window if the OS supports it).
|
||||
* \param left The coordinate of the left edge of the window.
|
||||
* \param top The coordinate of the top edge of the window.
|
||||
* \param width The width the window.
|
||||
* \param height The height the window.
|
||||
* \param state The state of the window when opened.
|
||||
* \param type The type of drawing context installed in this window.
|
||||
* \param stereoVisual Create a stereo visual for quad buffered stereo.
|
||||
* \param exclusive Use to show the window ontop and ignore others
|
||||
* (used fullscreen).
|
||||
* \param title The name of the window (displayed in the title bar of the window if the OS supports it).
|
||||
* \param left The coordinate of the left edge of the window.
|
||||
* \param top The coordinate of the top edge of the window.
|
||||
* \param width The width the window.
|
||||
* \param height The height the window.
|
||||
* \param state The state of the window when opened.
|
||||
* \param type The type of drawing context installed in this window.
|
||||
* \param stereoVisual Create a stereo visual for quad buffered stereo.
|
||||
* \param exclusive Use to show the window ontop and ignore others
|
||||
* (used fullscreen).
|
||||
* \param parentWindow Parent (embedder) window
|
||||
* \return The new window (or 0 if creation failed).
|
||||
*/
|
||||
|
|
|
@ -55,14 +55,14 @@ public:
|
|||
* Constructor.
|
||||
* Creates a new window and opens it.
|
||||
* To check if the window was created properly, use the getValid() method.
|
||||
* \param width The width the window.
|
||||
* \param heigh The height the window.
|
||||
* \param state The state the window is initially opened with.
|
||||
* \param type The type of drawing context installed in this window.
|
||||
* \param stereoVisual Stereo visual for quad buffered stereo.
|
||||
* \param exclusive Use to show the window ontop and ignore others
|
||||
* (used fullscreen).
|
||||
* \param numOfAASamples Number of samples used for AA (zero if no AA)
|
||||
* \param width The width the window.
|
||||
* \param heigh The height the window.
|
||||
* \param state The state the window is initially opened with.
|
||||
* \param type The type of drawing context installed in this window.
|
||||
* \param stereoVisual Stereo visual for quad buffered stereo.
|
||||
* \param exclusive Use to show the window ontop and ignore others
|
||||
* (used fullscreen).
|
||||
* \param numOfAASamples Number of samples used for AA (zero if no AA)
|
||||
*/
|
||||
GHOST_Window(
|
||||
GHOST_TUns32 width,
|
||||
|
|
|
@ -225,10 +225,10 @@ public:
|
|||
* capturing).
|
||||
*
|
||||
* \param press
|
||||
* 0 - mouse pressed
|
||||
* 1 - mouse released
|
||||
* 2 - operator grab
|
||||
* 3 - operator ungrab
|
||||
* 0 - mouse pressed
|
||||
* 1 - mouse released
|
||||
* 2 - operator grab
|
||||
* 3 - operator ungrab
|
||||
*/
|
||||
void registerMouseClickEvent(int press);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#if PARALLEL==1
|
||||
#include <omp.h>
|
||||
#endif // PARALLEL
|
||||
#endif // PARALLEL
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
|
@ -51,13 +51,13 @@ FLUID_3D::FLUID_3D(int *res, float dx, float dtdef, int init_heat, int init_fire
|
|||
_dt = dtdef; // just in case. set in step from a RNA factor
|
||||
|
||||
_iterations = 100;
|
||||
_tempAmb = 0;
|
||||
_tempAmb = 0;
|
||||
_heatDiffusion = 1e-3;
|
||||
_totalTime = 0.0f;
|
||||
_totalSteps = 0;
|
||||
_res = Vec3Int(_xRes,_yRes,_zRes);
|
||||
_maxRes = MAX3(_xRes, _yRes, _zRes);
|
||||
|
||||
|
||||
// initialize wavelet turbulence
|
||||
/*
|
||||
if(amplify)
|
||||
|
@ -65,7 +65,7 @@ FLUID_3D::FLUID_3D(int *res, float dx, float dtdef, int init_heat, int init_fire
|
|||
else
|
||||
_wTurbulence = NULL;
|
||||
*/
|
||||
|
||||
|
||||
// scale the constants according to the refinement of the grid
|
||||
if (!dx)
|
||||
_dx = 1.0f / (float)_maxRes;
|
||||
|
@ -218,7 +218,7 @@ void FLUID_3D::initColors(float init_r, float init_g, float init_b)
|
|||
|
||||
void FLUID_3D::setBorderObstacles()
|
||||
{
|
||||
|
||||
|
||||
// set side obstacles
|
||||
unsigned int index;
|
||||
for (int y = 0; y < _yRes; y++)
|
||||
|
@ -331,7 +331,7 @@ void FLUID_3D::step(float dt, float gravity[3])
|
|||
// If border rules have been changed
|
||||
if (_colloPrev != *_borderColli) {
|
||||
printf("Border collisions changed\n");
|
||||
|
||||
|
||||
// DG TODO: Need to check that no animated obstacle flags are overwritten
|
||||
setBorderCollisions();
|
||||
}
|
||||
|
@ -490,7 +490,7 @@ void FLUID_3D::step(float dt, float gravity[3])
|
|||
for (int i=1; i<stepParts; i++)
|
||||
{
|
||||
int zPos=(int)((float)i*partSize + 0.5f);
|
||||
|
||||
|
||||
artificialDampingExactSL(zPos);
|
||||
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ void FLUID_3D::artificialDampingSL(int zBegin, int zEnd) {
|
|||
void FLUID_3D::artificialDampingExactSL(int pos) {
|
||||
const float w = 0.9;
|
||||
int index, x,y,z;
|
||||
|
||||
|
||||
|
||||
size_t posslab;
|
||||
|
||||
|
@ -650,7 +650,7 @@ void FLUID_3D::artificialDampingExactSL(int pos) {
|
|||
_zVelocityTemp[index+1] + _zVelocityTemp[index-1] +
|
||||
_zVelocityTemp[index+_res[0]] + _zVelocityTemp[index-_res[0]] +
|
||||
_zVelocityTemp[index+_slabSize] + _zVelocityTemp[index-_slabSize] );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -677,7 +677,7 @@ void FLUID_3D::artificialDampingExactSL(int pos) {
|
|||
_zVelocityTemp[index+1] + _zVelocityTemp[index-1] +
|
||||
_zVelocityTemp[index+_res[0]] + _zVelocityTemp[index-_res[0]] +
|
||||
_zVelocityTemp[index+_slabSize] + _zVelocityTemp[index-_slabSize] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -759,7 +759,7 @@ void FLUID_3D::wipeBoundaries(int zBegin, int zEnd)
|
|||
|
||||
void FLUID_3D::wipeBoundariesSL(int zBegin, int zEnd)
|
||||
{
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
// setZeroBorder to all:
|
||||
/////////////////////////////////////
|
||||
|
@ -933,16 +933,16 @@ void FLUID_3D::project()
|
|||
|
||||
memset(_pressure, 0, sizeof(float)*_totalCells);
|
||||
memset(_divergence, 0, sizeof(float)*_totalCells);
|
||||
|
||||
|
||||
// set velocity and pressure inside of obstacles to zero
|
||||
setObstacleBoundaries(_pressure, 0, _zRes);
|
||||
|
||||
|
||||
// copy out the boundaries
|
||||
if(!_domainBcLeft) setNeumannX(_xVelocity, _res, 0, _zRes);
|
||||
else setZeroX(_xVelocity, _res, 0, _zRes);
|
||||
else setZeroX(_xVelocity, _res, 0, _zRes);
|
||||
|
||||
if(!_domainBcFront) setNeumannY(_yVelocity, _res, 0, _zRes);
|
||||
else setZeroY(_yVelocity, _res, 0, _zRes);
|
||||
else setZeroY(_yVelocity, _res, 0, _zRes);
|
||||
|
||||
if(!_domainBcTop) setNeumannZ(_zVelocity, _res, 0, _zRes);
|
||||
else setZeroZ(_zVelocity, _res, 0, _zRes);
|
||||
|
@ -953,13 +953,13 @@ void FLUID_3D::project()
|
|||
for (y = 1; y < _yRes - 1; y++, index += 2)
|
||||
for (x = 1; x < _xRes - 1; x++, index++)
|
||||
{
|
||||
|
||||
|
||||
if(_obstacles[index])
|
||||
{
|
||||
_divergence[index] = 0.0f;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
float xright = _xVelocity[index + 1];
|
||||
float xleft = _xVelocity[index - 1];
|
||||
|
@ -1058,7 +1058,7 @@ void FLUID_3D::project()
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
void FLUID_3D::setObstacleVelocity(int zBegin, int zEnd)
|
||||
{
|
||||
|
||||
|
||||
// completely TODO <-- who wrote this and what is here TODO? DG
|
||||
|
||||
const size_t index_ = _slabSize + _xRes + 1;
|
||||
|
@ -1082,7 +1082,7 @@ void FLUID_3D::setObstacleVelocity(int zBegin, int zEnd)
|
|||
{
|
||||
if (!_obstacles[index])
|
||||
{
|
||||
// if(_obstacles[index+1]) xright = - _xVelocityOb[index];
|
||||
// if(_obstacles[index+1]) xright = - _xVelocityOb[index];
|
||||
if((_obstacles[index - 1] & 8) && abs(_xVelocityOb[index - 1]) > FLT_EPSILON )
|
||||
{
|
||||
// printf("velocity x!\n");
|
||||
|
@ -1221,7 +1221,7 @@ void FLUID_3D::setObstaclePressure(float *_pressure, int zBegin, int zEnd)
|
|||
_pressure[index] += _pressure[index + _slabSize];
|
||||
pcnt += 1.0f;
|
||||
}
|
||||
|
||||
|
||||
if(pcnt > 0.000001f)
|
||||
_pressure[index] /= pcnt;
|
||||
|
||||
|
@ -1254,7 +1254,7 @@ void FLUID_3D::setObstacleBoundaries(float *_pressure, int zBegin, int zEnd)
|
|||
for (int z = zBegin + bb; z < zEnd - bt; z++)
|
||||
{
|
||||
size_t index = index_ +(z-1)*_slabSize;
|
||||
|
||||
|
||||
for (int y = 1; y < _yRes - 1; y++, index += 2)
|
||||
{
|
||||
for (int x = 1; x < _xRes - 1; x++, index++)
|
||||
|
@ -1563,7 +1563,7 @@ void FLUID_3D::addVorticity(int zBegin, int zEnd)
|
|||
|
||||
// calculate normalized vorticity vectors
|
||||
float eps = _vorticityEps;
|
||||
|
||||
|
||||
//index = _slabSize + _xRes + 1;
|
||||
vIndex=_slabSize + _xRes + 1;
|
||||
|
||||
|
@ -1618,7 +1618,7 @@ void FLUID_3D::addVorticity(int zBegin, int zEnd)
|
|||
} // y loop
|
||||
//vIndex+=2*_xRes;
|
||||
} // z loop
|
||||
|
||||
|
||||
if (_xVorticity) delete[] _xVorticity;
|
||||
if (_yVorticity) delete[] _yVorticity;
|
||||
if (_zVorticity) delete[] _zVorticity;
|
||||
|
@ -1704,10 +1704,10 @@ void FLUID_3D::advectMacCormackEnd2(int zBegin, int zEnd)
|
|||
|
||||
/* set boundary conditions for velocity */
|
||||
if(!_domainBcLeft) copyBorderX(_xVelocityTemp, res, zBegin, zEnd);
|
||||
else setZeroX(_xVelocityTemp, res, zBegin, zEnd);
|
||||
else setZeroX(_xVelocityTemp, res, zBegin, zEnd);
|
||||
|
||||
if(!_domainBcFront) copyBorderY(_yVelocityTemp, res, zBegin, zEnd);
|
||||
else setZeroY(_yVelocityTemp, res, zBegin, zEnd);
|
||||
else setZeroY(_yVelocityTemp, res, zBegin, zEnd);
|
||||
|
||||
if(!_domainBcTop) copyBorderZ(_zVelocityTemp, res, zBegin, zEnd);
|
||||
else setZeroZ(_zVelocityTemp, res, zBegin, zEnd);
|
||||
|
@ -1778,9 +1778,9 @@ void FLUID_3D::updateFlame(float *react, float *flame, int total_cells)
|
|||
for (int index = 0; index < total_cells; index++)
|
||||
{
|
||||
/* model flame temperature curve from the reaction coordinate (fuel)
|
||||
* TODO: Would probably be best to get rid of whole "flame" data field.
|
||||
* Currently it's just sqrt mirror of reaction coordinate, and therefore
|
||||
* basically just waste of memory and disk space...
|
||||
* TODO: Would probably be best to get rid of whole "flame" data field.
|
||||
* Currently it's just sqrt mirror of reaction coordinate, and therefore
|
||||
* basically just waste of memory and disk space...
|
||||
*/
|
||||
if (react[index]>0.0f) {
|
||||
/* do a smooth falloff for rest of the values */
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Full recode, Ton Roosendaal, Crete 2005
|
||||
* Full recode, Joshua Leung, 2009
|
||||
* Full recode, Joshua Leung, 2009
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
@ -70,7 +70,7 @@ void BKE_action_make_local(struct Main *bmain, struct bAction *act, const bool l
|
|||
/* Action API ----------------- */
|
||||
|
||||
/* types of transforms applied to the given item
|
||||
* - these are the return flags for action_get_item_transforms()
|
||||
* - these are the return flags for action_get_item_transforms()
|
||||
*/
|
||||
typedef enum eAction_TransformFlags {
|
||||
/* location */
|
||||
|
@ -94,8 +94,8 @@ typedef enum eAction_TransformFlags {
|
|||
} eAction_TransformFlags;
|
||||
|
||||
/* Return flags indicating which transforms the given object/posechannel has
|
||||
* - if 'curves' is provided, a list of links to these curves are also returned
|
||||
* whose nodes WILL NEED FREEING
|
||||
* - if 'curves' is provided, a list of links to these curves are also returned
|
||||
* whose nodes WILL NEED FREEING
|
||||
*/
|
||||
short action_get_item_transforms(struct bAction *act, struct Object *ob, struct bPoseChannel *pchan, ListBase *curves);
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ bool BKE_animsys_execute_fcurve(struct PointerRNA *ptr, struct FCurve *fcu, floa
|
|||
* for standard animation evaluation UNDER ANY CIRCUMSTANCES!
|
||||
*
|
||||
* i.e. Pose Library (PoseLib) uses some of these for selectively applying poses, but
|
||||
* Particles/Sequencer performing funky time manipulation is not ok.
|
||||
* Particles/Sequencer performing funky time manipulation is not ok.
|
||||
*/
|
||||
|
||||
/* Evaluate Action (F-Curve Bag) */
|
||||
|
|
|
@ -34,7 +34,7 @@ struct Main;
|
|||
struct Scene;
|
||||
struct ViewLayer;
|
||||
|
||||
/* Actual surface point */
|
||||
/* Actual surface point */
|
||||
typedef struct PaintSurfaceData {
|
||||
void *format_data; /* special data for each surface "format" */
|
||||
void *type_data; /* data used by specific surface type */
|
||||
|
@ -45,7 +45,7 @@ typedef struct PaintSurfaceData {
|
|||
|
||||
} PaintSurfaceData;
|
||||
|
||||
/* Paint type surface point */
|
||||
/* Paint type surface point */
|
||||
typedef struct PaintPoint {
|
||||
|
||||
/* Wet paint is handled at effect layer only
|
||||
|
@ -56,7 +56,7 @@ typedef struct PaintPoint {
|
|||
float color[4];
|
||||
} PaintPoint;
|
||||
|
||||
/* height field waves */
|
||||
/* height field waves */
|
||||
typedef struct PaintWavePoint {
|
||||
|
||||
float height;
|
||||
|
|
|
@ -126,8 +126,8 @@ typedef struct GHash FModifierStackStorage;
|
|||
* as some constraints don't define some of these.
|
||||
*
|
||||
* Warning: it is not too advisable to reorder order of members of this struct,
|
||||
* as you'll have to edit quite a few ($FMODIFIER_NUM_TYPES) of these
|
||||
* structs.
|
||||
* as you'll have to edit quite a few ($FMODIFIER_NUM_TYPES) of these
|
||||
* structs.
|
||||
*/
|
||||
typedef struct FModifierTypeInfo {
|
||||
/* admin/ident */
|
||||
|
@ -234,7 +234,7 @@ struct FCurve *iter_step_fcurve(struct FCurve *fcu_iter, const char rna_path[]);
|
|||
struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, bool *r_driven);
|
||||
|
||||
/* Get list of LinkData's containing pointers to the F-Curves which control the types of data indicated
|
||||
* e.g. numMatches = list_find_data_fcurves(matches, &act->curves, "pose.bones[", "MyFancyBone");
|
||||
* e.g. numMatches = list_find_data_fcurves(matches, &act->curves, "pose.bones[", "MyFancyBone");
|
||||
*/
|
||||
int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix, const char *dataName);
|
||||
|
||||
|
@ -307,8 +307,8 @@ float calculate_fcurve(struct PathResolvedRNA *anim_rna, struct FCurve *fcu, flo
|
|||
/* -------- Defines -------- */
|
||||
|
||||
/* Basic signature for F-Curve sample-creation function
|
||||
* - fcu: the F-Curve being operated on
|
||||
* - data: pointer to some specific data that may be used by one of the callbacks
|
||||
* - fcu: the F-Curve being operated on
|
||||
* - data: pointer to some specific data that may be used by one of the callbacks
|
||||
*/
|
||||
typedef float (*FcuSampleFunc)(struct FCurve *fcu, void *data, float evaltime);
|
||||
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
* Shrinkwrap is composed by a set of functions and options that define the type of shrink.
|
||||
*
|
||||
* 3 modes are available:
|
||||
* - Nearest vertex
|
||||
* - Nearest surface
|
||||
* - Normal projection
|
||||
* - Nearest vertex
|
||||
* - Nearest surface
|
||||
* - Normal projection
|
||||
*
|
||||
* ShrinkwrapCalcData encapsulates all needed data for shrinkwrap functions.
|
||||
* (So that you don't have to pass an enormous amount of arguments to functions)
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Full recode, Ton Roosendaal, Crete 2005
|
||||
* Full recode, Joshua Leung, 2009
|
||||
* Full recode, Joshua Leung, 2009
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
@ -264,8 +264,8 @@ bActionGroup *action_groups_add_new(bAction *act, const char name[])
|
|||
}
|
||||
|
||||
/* Add given channel into (active) group
|
||||
* - assumes that channel is not linked to anything anymore
|
||||
* - always adds at the end of the group
|
||||
* - assumes that channel is not linked to anything anymore
|
||||
* - always adds at the end of the group
|
||||
*/
|
||||
void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve)
|
||||
{
|
||||
|
@ -310,8 +310,8 @@ void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve)
|
|||
for (grp = agrp->prev; grp; grp = grp->prev) {
|
||||
/* if this group has F-Curves, we want weave the given one in right after the last channel there,
|
||||
* but via the Action's list not this group's list
|
||||
* - this is so that the F-Curve is in the right place in the Action,
|
||||
* but won't be included in the previous group
|
||||
* - this is so that the F-Curve is in the right place in the Action,
|
||||
* but won't be included in the previous group
|
||||
*/
|
||||
if (grp->channels.last) {
|
||||
/* once we've added, break here since we don't need to search any further... */
|
||||
|
@ -1039,8 +1039,8 @@ void BKE_pose_remove_group(bPose *pose, bActionGroup *grp, const int index)
|
|||
BLI_assert(idx > 0);
|
||||
|
||||
/* adjust group references (the trouble of using indices!):
|
||||
* - firstly, make sure nothing references it
|
||||
* - also, make sure that those after this item get corrected
|
||||
* - firstly, make sure nothing references it
|
||||
* - also, make sure that those after this item get corrected
|
||||
*/
|
||||
for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
|
||||
if (pchan->agrp_index == idx)
|
||||
|
@ -1123,7 +1123,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
|
|||
}
|
||||
|
||||
/* if incl_modifiers is enabled, need to consider modifiers too
|
||||
* - only really care about the last modifier
|
||||
* - only really care about the last modifier
|
||||
*/
|
||||
if ((incl_modifiers) && (fcu->modifiers.last)) {
|
||||
FModifier *fcm = fcu->modifiers.last;
|
||||
|
@ -1179,7 +1179,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
|
|||
}
|
||||
|
||||
/* Return flags indicating which transforms the given object/posechannel has
|
||||
* - if 'curves' is provided, a list of links to these curves are also returned
|
||||
* - if 'curves' is provided, a list of links to these curves are also returned
|
||||
*/
|
||||
short action_get_item_transforms(bAction *act, Object *ob, bPoseChannel *pchan, ListBase *curves)
|
||||
{
|
||||
|
@ -1202,7 +1202,7 @@ short action_get_item_transforms(bAction *act, Object *ob, bPoseChannel *pchan,
|
|||
return 0;
|
||||
|
||||
/* search F-Curves for the given properties
|
||||
* - we cannot use the groups, since they may not be grouped in that way...
|
||||
* - we cannot use the groups, since they may not be grouped in that way...
|
||||
*/
|
||||
for (fcu = act->curves.first; fcu; fcu = fcu->next) {
|
||||
const char *bPtr = NULL, *pPtr = NULL;
|
||||
|
@ -1225,11 +1225,11 @@ short action_get_item_transforms(bAction *act, Object *ob, bPoseChannel *pchan,
|
|||
bPtr += strlen(basePath);
|
||||
|
||||
/* step 2: check for some property with transforms
|
||||
* - to speed things up, only check for the ones not yet found
|
||||
* unless we're getting the curves too
|
||||
* - if we're getting the curves, the BLI_genericNodeN() creates a LinkData
|
||||
* node wrapping the F-Curve, which then gets added to the list
|
||||
* - once a match has been found, the curve cannot possibly be any other one
|
||||
* - to speed things up, only check for the ones not yet found
|
||||
* unless we're getting the curves too
|
||||
* - if we're getting the curves, the BLI_genericNodeN() creates a LinkData
|
||||
* node wrapping the F-Curve, which then gets added to the list
|
||||
* - once a match has been found, the curve cannot possibly be any other one
|
||||
*/
|
||||
if ((curves) || (flags & ACT_TRANS_LOC) == 0) {
|
||||
pPtr = strstr(bPtr, "location");
|
||||
|
|
|
@ -282,7 +282,7 @@ typedef struct MPathTarget {
|
|||
/* ........ */
|
||||
|
||||
/* get list of motion paths to be baked for the given object
|
||||
* - assumes the given list is ready to be used
|
||||
* - assumes the given list is ready to be used
|
||||
*/
|
||||
/* TODO: it would be nice in future to be able to update objects dependent on these bones too? */
|
||||
void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
|
||||
|
@ -349,7 +349,7 @@ static void motionpaths_calc_bake_targets(ListBase *targets, int cframe)
|
|||
bMotionPath *mpath = mpt->mpath;
|
||||
|
||||
/* current frame must be within the range the cache works for
|
||||
* - is inclusive of the first frame, but not the last otherwise we get buffer overruns
|
||||
* - is inclusive of the first frame, but not the last otherwise we get buffer overruns
|
||||
*/
|
||||
if ((cframe < mpath->start_frame) || (cframe >= mpath->end_frame)) {
|
||||
continue;
|
||||
|
@ -414,9 +414,9 @@ static void motionpaths_calc_bake_targets(ListBase *targets, int cframe)
|
|||
}
|
||||
|
||||
/* Perform baking of the given object's and/or its bones' transforms to motion paths
|
||||
* - scene: current scene
|
||||
* - ob: object whose flagged motionpaths should get calculated
|
||||
* - recalc: whether we need to
|
||||
* - scene: current scene
|
||||
* - ob: object whose flagged motionpaths should get calculated
|
||||
* - recalc: whether we need to
|
||||
*/
|
||||
/* TODO: include reports pointer? */
|
||||
void animviz_calc_motionpaths(Depsgraph *depsgraph,
|
||||
|
@ -557,7 +557,7 @@ void free_path(Path *path)
|
|||
}
|
||||
|
||||
/* calculate a curve-deform path for a curve
|
||||
* - only called from displist.c -> do_makeDispListCurveTypes
|
||||
* - only called from displist.c -> do_makeDispListCurveTypes
|
||||
*/
|
||||
void calc_curvepath(Object *ob, ListBase *nurbs)
|
||||
{
|
||||
|
|
|
@ -438,8 +438,8 @@ static bool animpath_matches_basepath(const char path[], const char basepath[])
|
|||
/* Move F-Curves in src action to dst action, setting up all the necessary groups
|
||||
* for this to happen, but only if the F-Curves being moved have the appropriate
|
||||
* "base path".
|
||||
* - This is used when data moves from one datablock to another, causing the
|
||||
* F-Curves to need to be moved over too
|
||||
* - This is used when data moves from one datablock to another, causing the
|
||||
* F-Curves to need to be moved over too
|
||||
*/
|
||||
void action_move_fcurves_by_basepath(bAction *srcAct, bAction *dstAct, const char basepath[])
|
||||
{
|
||||
|
@ -465,7 +465,7 @@ void action_move_fcurves_by_basepath(bAction *srcAct, bAction *dstAct, const cha
|
|||
fcn = fcu->next;
|
||||
|
||||
/* should F-Curve be moved over?
|
||||
* - we only need the start of the path to match basepath
|
||||
* - we only need the start of the path to match basepath
|
||||
*/
|
||||
if (animpath_matches_basepath(fcu->rna_path, basepath)) {
|
||||
bActionGroup *agrp = NULL;
|
||||
|
@ -1179,8 +1179,8 @@ void BKE_animdata_fix_paths_rename_all(ID *ref_id, const char *prefix, const cha
|
|||
ID *id;
|
||||
|
||||
/* macro for less typing
|
||||
* - whether animdata exists is checked for by the main renaming callback, though taking
|
||||
* this outside of the function may make things slightly faster?
|
||||
* - whether animdata exists is checked for by the main renaming callback, though taking
|
||||
* this outside of the function may make things slightly faster?
|
||||
*/
|
||||
#define RENAMEFIX_ANIM_IDS(first) \
|
||||
for (id = first; id; id = id->next) { \
|
||||
|
@ -1456,7 +1456,7 @@ void BKE_keyingsets_free(ListBase *list)
|
|||
return;
|
||||
|
||||
/* loop over KeyingSets freeing them
|
||||
* - BKE_keyingset_free() doesn't free the set itself, but it frees its sub-data
|
||||
* - BKE_keyingset_free() doesn't free the set itself, but it frees its sub-data
|
||||
*/
|
||||
for (ks = list->first; ks; ks = ksn) {
|
||||
ksn = ks->next;
|
||||
|
@ -1779,8 +1779,8 @@ static void action_idcode_patch_check(ID *id, bAction *act)
|
|||
/* the actual checks... hopefully not too much of a performance hit in the long run... */
|
||||
if (act->idroot == 0) {
|
||||
/* use the current root if not set already (i.e. newly created actions and actions from 2.50-2.57 builds)
|
||||
* - this has problems if there are 2 users, and the first one encountered is the invalid one
|
||||
* in which case, the user will need to manually fix this (?)
|
||||
* - this has problems if there are 2 users, and the first one encountered is the invalid one
|
||||
* in which case, the user will need to manually fix this (?)
|
||||
*/
|
||||
act->idroot = idcode;
|
||||
}
|
||||
|
@ -1880,8 +1880,8 @@ static void nlastrip_evaluate_controls(Depsgraph *depsgraph, NlaStrip *strip, fl
|
|||
}
|
||||
|
||||
/* analytically generate values for influence and time (if applicable)
|
||||
* - we do this after the F-Curves have been evaluated to override the effects of those
|
||||
* in case the override has been turned off.
|
||||
* - we do this after the F-Curves have been evaluated to override the effects of those
|
||||
* in case the override has been turned off.
|
||||
*/
|
||||
if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0)
|
||||
strip->strip_time = nlastrip_get_frame(strip, ctime, NLATIME_CONVERT_EVAL);
|
||||
|
@ -1927,8 +1927,8 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li
|
|||
else {
|
||||
/* before next strip - previous strip has ended, but next hasn't begun,
|
||||
* so blending mode depends on whether strip is being held or not...
|
||||
* - only occurs when no transition strip added, otherwise the transition would have
|
||||
* been picked up above...
|
||||
* - only occurs when no transition strip added, otherwise the transition would have
|
||||
* been picked up above...
|
||||
*/
|
||||
strip = strip->prev;
|
||||
|
||||
|
@ -1955,7 +1955,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li
|
|||
}
|
||||
|
||||
/* check if a valid strip was found
|
||||
* - must not be muted (i.e. will have contribution
|
||||
* - must not be muted (i.e. will have contribution
|
||||
*/
|
||||
if ((estrip == NULL) || (estrip->flag & NLASTRIP_FLAG_MUTED))
|
||||
return NULL;
|
||||
|
@ -1971,8 +1971,8 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li
|
|||
}
|
||||
|
||||
/* evaluate strip's evaluation controls
|
||||
* - skip if no influence (i.e. same effect as muting the strip)
|
||||
* - negative influence is not supported yet... how would that be defined?
|
||||
* - skip if no influence (i.e. same effect as muting the strip)
|
||||
* - negative influence is not supported yet... how would that be defined?
|
||||
*/
|
||||
/* TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... */
|
||||
nlastrip_evaluate_controls(depsgraph, estrip, ctime);
|
||||
|
@ -2016,7 +2016,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li
|
|||
/* ---------------------- */
|
||||
|
||||
/* find an NlaEvalChannel that matches the given criteria
|
||||
* - ptr and prop are the RNA data to find a match for
|
||||
* - ptr and prop are the RNA data to find a match for
|
||||
*/
|
||||
static NlaEvalChannel *nlaevalchan_find_match(ListBase *channels, const PathResolvedRNA *prna)
|
||||
{
|
||||
|
@ -2031,7 +2031,7 @@ static NlaEvalChannel *nlaevalchan_find_match(ListBase *channels, const PathReso
|
|||
/* - comparing the PointerRNA's is done by comparing the pointers
|
||||
* to the actual struct the property resides in, since that all the
|
||||
* other data stored in PointerRNA cannot allow us to definitively
|
||||
* identify the data
|
||||
* identify the data
|
||||
*/
|
||||
if ((nec->rna.ptr.data == prna->ptr.data) && (nec->rna.prop == prna->prop) && ELEM(nec->rna.prop_index, -1, prna->prop_index))
|
||||
return nec;
|
||||
|
@ -2161,8 +2161,8 @@ static void nlaevalchan_accumulate(NlaEvalChannel *nec, NlaEvalStrip *nes, float
|
|||
case NLASTRIP_MODE_REPLACE:
|
||||
default: /* TODO: do we really want to blend by default? it seems more uses might prefer add... */
|
||||
/* do linear interpolation
|
||||
* - the influence of the accumulated data (elsewhere, that is called dstweight)
|
||||
* is 1 - influence, since the strip's influence is srcweight
|
||||
* - the influence of the accumulated data (elsewhere, that is called dstweight)
|
||||
* is 1 - influence, since the strip's influence is srcweight
|
||||
*/
|
||||
nec->value = nec->value * (1.0f - inf) + (value * inf);
|
||||
break;
|
||||
|
@ -2223,7 +2223,7 @@ static void nlaeval_fmodifiers_join_stacks(ListBase *result, ListBase *list1, Li
|
|||
}
|
||||
else {
|
||||
/* list1 should be added first, and list2 second, with the endpoints of these being the endpoints for result
|
||||
* - the original lists must be left unchanged though, as we need that fact for restoring
|
||||
* - the original lists must be left unchanged though, as we need that fact for restoring
|
||||
*/
|
||||
result->first = list1->first;
|
||||
result->last = list2->last;
|
||||
|
@ -2336,11 +2336,11 @@ static void nlastrip_evaluate_transition(
|
|||
nlaeval_fmodifiers_join_stacks(&tmp_modifiers, &nes->strip->modifiers, modifiers);
|
||||
|
||||
/* get the two strips to operate on
|
||||
* - we use the endpoints of the strips directly flanking our strip
|
||||
* using these as the endpoints of the transition (destination and source)
|
||||
* - these should have already been determined to be valid...
|
||||
* - if this strip is being played in reverse, we need to swap these endpoints
|
||||
* otherwise they will be interpolated wrong
|
||||
* - we use the endpoints of the strips directly flanking our strip
|
||||
* using these as the endpoints of the transition (destination and source)
|
||||
* - these should have already been determined to be valid...
|
||||
* - if this strip is being played in reverse, we need to swap these endpoints
|
||||
* otherwise they will be interpolated wrong
|
||||
*/
|
||||
if (nes->strip->flag & NLASTRIP_FLAG_REVERSE) {
|
||||
s1 = nes->strip->next;
|
||||
|
@ -2352,11 +2352,11 @@ static void nlastrip_evaluate_transition(
|
|||
}
|
||||
|
||||
/* prepare template for 'evaluation strip'
|
||||
* - based on the transition strip's evaluation strip data
|
||||
* - strip_mode is NES_TIME_TRANSITION_* based on which endpoint
|
||||
* - strip_time is the 'normalized' (i.e. in-strip) time for evaluation,
|
||||
* which doubles up as an additional weighting factor for the strip influences
|
||||
* which allows us to appear to be 'interpolating' between the two extremes
|
||||
* - based on the transition strip's evaluation strip data
|
||||
* - strip_mode is NES_TIME_TRANSITION_* based on which endpoint
|
||||
* - strip_time is the 'normalized' (i.e. in-strip) time for evaluation,
|
||||
* which doubles up as an additional weighting factor for the strip influences
|
||||
* which allows us to appear to be 'interpolating' between the two extremes
|
||||
*/
|
||||
tmp_nes = *nes;
|
||||
|
||||
|
@ -2512,7 +2512,7 @@ static void animsys_evaluate_nla(Depsgraph *depsgraph, ListBase *echannels, Poin
|
|||
}
|
||||
|
||||
/* if this track has strips (but maybe they won't be suitable), set has_strips
|
||||
* - used for mainly for still allowing normal action evaluation...
|
||||
* - used for mainly for still allowing normal action evaluation...
|
||||
*/
|
||||
if (nlt->strips.first)
|
||||
has_strips = true;
|
||||
|
@ -2523,9 +2523,9 @@ static void animsys_evaluate_nla(Depsgraph *depsgraph, ListBase *echannels, Poin
|
|||
}
|
||||
|
||||
/* add 'active' Action (may be tweaking track) as last strip to evaluate in NLA stack
|
||||
* - only do this if we're not exclusively evaluating the 'solo' NLA-track
|
||||
* - however, if the 'solo' track houses the current 'tweaking' strip,
|
||||
* then we should allow this to play, otherwise nothing happens
|
||||
* - only do this if we're not exclusively evaluating the 'solo' NLA-track
|
||||
* - however, if the 'solo' track houses the current 'tweaking' strip,
|
||||
* then we should allow this to play, otherwise nothing happens
|
||||
*/
|
||||
if ((adt->action) && ((adt->flag & ADT_NLA_SOLO_TRACK) == 0 || (adt->flag & ADT_NLA_EDIT_ON))) {
|
||||
/* if there are strips, evaluate action as per NLA rules */
|
||||
|
@ -2585,8 +2585,8 @@ static void animsys_evaluate_nla(Depsgraph *depsgraph, ListBase *echannels, Poin
|
|||
}
|
||||
|
||||
/* NLA Evaluation function (mostly for use through do_animdata)
|
||||
* - All channels that will be affected are not cleared anymore. Instead, we just evaluate into
|
||||
* some temp channels, where values can be accumulated in one go.
|
||||
* - All channels that will be affected are not cleared anymore. Instead, we just evaluate into
|
||||
* some temp channels, where values can be accumulated in one go.
|
||||
*/
|
||||
static void animsys_calculate_nla(Depsgraph *depsgraph, PointerRNA *ptr, AnimData *adt, float ctime)
|
||||
{
|
||||
|
@ -2626,34 +2626,34 @@ static void animsys_evaluate_overrides(PointerRNA *ptr, AnimData *adt)
|
|||
/* Evaluation System - Public API */
|
||||
|
||||
/* Overview of how this system works:
|
||||
* 1) Depsgraph sorts data as necessary, so that data is in an order that means
|
||||
* that all dependencies are resolved before dependents.
|
||||
* 2) All normal animation is evaluated, so that drivers have some basis values to
|
||||
* work with
|
||||
* a. NLA stacks are done first, as the Active Actions act as 'tweaking' tracks
|
||||
* which modify the effects of the NLA-stacks
|
||||
* b. Active Action is evaluated as per normal, on top of the results of the NLA tracks
|
||||
* 1) Depsgraph sorts data as necessary, so that data is in an order that means
|
||||
* that all dependencies are resolved before dependents.
|
||||
* 2) All normal animation is evaluated, so that drivers have some basis values to
|
||||
* work with
|
||||
* a. NLA stacks are done first, as the Active Actions act as 'tweaking' tracks
|
||||
* which modify the effects of the NLA-stacks
|
||||
* b. Active Action is evaluated as per normal, on top of the results of the NLA tracks
|
||||
*
|
||||
* --------------< often in a separate phase... >------------------
|
||||
*
|
||||
* 3) Drivers/expressions are evaluated on top of this, in an order where dependencies are
|
||||
* resolved nicely.
|
||||
* Note: it may be necessary to have some tools to handle the cases where some higher-level
|
||||
* drivers are added and cause some problematic dependencies that didn't exist in the local levels...
|
||||
* 3) Drivers/expressions are evaluated on top of this, in an order where dependencies are
|
||||
* resolved nicely.
|
||||
* Note: it may be necessary to have some tools to handle the cases where some higher-level
|
||||
* drivers are added and cause some problematic dependencies that didn't exist in the local levels...
|
||||
*
|
||||
* --------------< always executed >------------------
|
||||
*
|
||||
* Maintenance of editability of settings (XXX):
|
||||
* In order to ensure that settings that are animated can still be manipulated in the UI without requiring
|
||||
* that keyframes are added to prevent these values from being overwritten, we use 'overrides'.
|
||||
* In order to ensure that settings that are animated can still be manipulated in the UI without requiring
|
||||
* that keyframes are added to prevent these values from being overwritten, we use 'overrides'.
|
||||
*
|
||||
* Unresolved things:
|
||||
* - Handling of multi-user settings (i.e. time-offset, group-instancing) -> big cache grids or nodal system? but stored where?
|
||||
* - Multiple-block dependencies (i.e. drivers for settings are in both local and higher levels) -> split into separate lists?
|
||||
* - Handling of multi-user settings (i.e. time-offset, group-instancing) -> big cache grids or nodal system? but stored where?
|
||||
* - Multiple-block dependencies (i.e. drivers for settings are in both local and higher levels) -> split into separate lists?
|
||||
*
|
||||
* Current Status:
|
||||
* - Currently (as of September 2009), overrides we haven't needed to (fully) implement overrides.
|
||||
* However, the code for this is relatively harmless, so is left in the code for now.
|
||||
* - Currently (as of September 2009), overrides we haven't needed to (fully) implement overrides.
|
||||
* However, the code for this is relatively harmless, so is left in the code for now.
|
||||
*/
|
||||
|
||||
/* Evaluation loop for evaluation animation data
|
||||
|
@ -2674,15 +2674,15 @@ void BKE_animsys_evaluate_animdata(Depsgraph *depsgraph, Scene *scene, ID *id, A
|
|||
RNA_id_pointer_create(id, &id_ptr);
|
||||
|
||||
/* recalculate keyframe data:
|
||||
* - NLA before Active Action, as Active Action behaves as 'tweaking track'
|
||||
* that overrides 'rough' work in NLA
|
||||
* - NLA before Active Action, as Active Action behaves as 'tweaking track'
|
||||
* that overrides 'rough' work in NLA
|
||||
*/
|
||||
/* TODO: need to double check that this all works correctly */
|
||||
if ((recalc & ADT_RECALC_ANIM) || (adt->recalc & ADT_RECALC_ANIM)) {
|
||||
/* evaluate NLA data */
|
||||
if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF)) {
|
||||
/* evaluate NLA-stack
|
||||
* - active action is evaluated as part of the NLA stack as the last item
|
||||
* - active action is evaluated as part of the NLA stack as the last item
|
||||
*/
|
||||
animsys_calculate_nla(depsgraph, &id_ptr, adt, ctime);
|
||||
}
|
||||
|
@ -2695,9 +2695,9 @@ void BKE_animsys_evaluate_animdata(Depsgraph *depsgraph, Scene *scene, ID *id, A
|
|||
}
|
||||
|
||||
/* recalculate drivers
|
||||
* - Drivers need to be evaluated afterwards, as they can either override
|
||||
* or be layered on top of existing animation data.
|
||||
* - Drivers should be in the appropriate order to be evaluated without problems...
|
||||
* - Drivers need to be evaluated afterwards, as they can either override
|
||||
* or be layered on top of existing animation data.
|
||||
* - Drivers should be in the appropriate order to be evaluated without problems...
|
||||
*/
|
||||
if ((recalc & ADT_RECALC_DRIVERS)
|
||||
/* XXX for now, don't check yet, as depsgraph hasn't been updated */
|
||||
|
@ -2707,10 +2707,10 @@ void BKE_animsys_evaluate_animdata(Depsgraph *depsgraph, Scene *scene, ID *id, A
|
|||
}
|
||||
|
||||
/* always execute 'overrides'
|
||||
* - Overrides allow editing, by overwriting the value(s) set from animation-data, with the
|
||||
* value last set by the user (and not keyframed yet).
|
||||
* - Overrides are cleared upon frame change and/or keyframing
|
||||
* - It is best that we execute this every time, so that no errors are likely to occur.
|
||||
* - Overrides allow editing, by overwriting the value(s) set from animation-data, with the
|
||||
* value last set by the user (and not keyframed yet).
|
||||
* - Overrides are cleared upon frame change and/or keyframing
|
||||
* - It is best that we execute this every time, so that no errors are likely to occur.
|
||||
*/
|
||||
animsys_evaluate_overrides(&id_ptr, adt);
|
||||
|
||||
|
@ -2740,9 +2740,9 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene
|
|||
printf("Evaluate all animation - %f\n", ctime);
|
||||
|
||||
/* macros for less typing
|
||||
* - only evaluate animation data for id if it has users (and not just fake ones)
|
||||
* - whether animdata exists is checked for by the evaluation function, though taking
|
||||
* this outside of the function may make things slightly faster?
|
||||
* - only evaluate animation data for id if it has users (and not just fake ones)
|
||||
* - whether animdata exists is checked for by the evaluation function, though taking
|
||||
* this outside of the function may make things slightly faster?
|
||||
*/
|
||||
#define EVAL_ANIM_IDS(first, aflag) \
|
||||
for (id = first; id; id = id->next) { \
|
||||
|
@ -2753,10 +2753,10 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene
|
|||
} (void)0
|
||||
|
||||
/* another macro for the "embedded" nodetree cases
|
||||
* - this is like EVAL_ANIM_IDS, but this handles the case "embedded nodetrees"
|
||||
* (i.e. scene/material/texture->nodetree) which we need a special exception
|
||||
* for, otherwise they'd get skipped
|
||||
* - ntp = "node tree parent" = datablock where node tree stuff resides
|
||||
* - this is like EVAL_ANIM_IDS, but this handles the case "embedded nodetrees"
|
||||
* (i.e. scene/material/texture->nodetree) which we need a special exception
|
||||
* for, otherwise they'd get skipped
|
||||
* - ntp = "node tree parent" = datablock where node tree stuff resides
|
||||
*/
|
||||
#define EVAL_ANIM_NODETREE_IDS(first, NtId_Type, aflag) \
|
||||
for (id = first; id; id = id->next) { \
|
||||
|
|
|
@ -287,12 +287,12 @@ int bone_autoside_name(char name[MAXBONENAME], int UNUSED(strip_number), short a
|
|||
BLI_strncpy(basename, name, sizeof(basename));
|
||||
|
||||
/* Figure out extension to append:
|
||||
* - The extension to append is based upon the axis that we are working on.
|
||||
* - If head happens to be on 0, then we must consider the tail position as well to decide
|
||||
* which side the bone is on
|
||||
* -> If tail is 0, then it's bone is considered to be on axis, so no extension should be added
|
||||
* -> Otherwise, extension is added from perspective of object based on which side tail goes to
|
||||
* - If head is non-zero, extension is added from perspective of object based on side head is on
|
||||
* - The extension to append is based upon the axis that we are working on.
|
||||
* - If head happens to be on 0, then we must consider the tail position as well to decide
|
||||
* which side the bone is on
|
||||
* -> If tail is 0, then it's bone is considered to be on axis, so no extension should be added
|
||||
* -> Otherwise, extension is added from perspective of object based on which side tail goes to
|
||||
* - If head is non-zero, extension is added from perspective of object based on side head is on
|
||||
*/
|
||||
if (axis == 2) {
|
||||
/* z-axis - vertical (top/bottom) */
|
||||
|
@ -342,8 +342,8 @@ int bone_autoside_name(char name[MAXBONENAME], int UNUSED(strip_number), short a
|
|||
}
|
||||
|
||||
/* Simple name truncation
|
||||
* - truncate if there is an extension and it wouldn't be able to fit
|
||||
* - otherwise, just append to end
|
||||
* - truncate if there is an extension and it wouldn't be able to fit
|
||||
* - otherwise, just append to end
|
||||
*/
|
||||
if (extension[0]) {
|
||||
bool changed = true;
|
||||
|
@ -2333,8 +2333,8 @@ void BKE_pose_where_is(struct Depsgraph *depsgraph, Scene *scene, Object *ob)
|
|||
BIK_initialize_tree(depsgraph, scene, ob, ctime);
|
||||
|
||||
/* 2b. construct the Spline IK trees
|
||||
* - this is not integrated as an IK plugin, since it should be able
|
||||
* to function in conjunction with standard IK
|
||||
* - this is not integrated as an IK plugin, since it should be able
|
||||
* to function in conjunction with standard IK
|
||||
*/
|
||||
BKE_pose_splineik_init_tree(scene, ob, ctime);
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos
|
|||
*/
|
||||
for (i = 0; i < segcount; i++) {
|
||||
/* 'head' joints, traveling towards the root of the chain
|
||||
* - 2 methods; the one chosen depends on whether we've got usable lengths
|
||||
* - 2 methods; the one chosen depends on whether we've got usable lengths
|
||||
*/
|
||||
if ((ikData->flag & CONSTRAINT_SPLINEIK_EVENSPLITS) || (totLength == 0.0f)) {
|
||||
/* 1) equi-spaced joints */
|
||||
|
@ -372,7 +372,7 @@ static void splineik_evaluate_bone(
|
|||
rangle *= tree->con->enforce;
|
||||
|
||||
/* construct rotation matrix from the axis-angle rotation found above
|
||||
* - this call takes care to make sure that the axis provided is a unit vector first
|
||||
* - this call takes care to make sure that the axis provided is a unit vector first
|
||||
*/
|
||||
axis_angle_to_mat3(dmat, raxis, rangle);
|
||||
|
||||
|
@ -495,8 +495,8 @@ static void splineik_evaluate_bone(
|
|||
}
|
||||
else if (tree->con->enforce < 1.0f) {
|
||||
/* when the influence is too low
|
||||
* - blend the positions for the 'root' bone
|
||||
* - stick to the parent for any other
|
||||
* - blend the positions for the 'root' bone
|
||||
* - stick to the parent for any other
|
||||
*/
|
||||
if (pchan->parent) {
|
||||
copy_v3_v3(poseHead, pchan->pose_head);
|
||||
|
@ -623,8 +623,8 @@ void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph,
|
|||
/* construct the IK tree (standard IK) */
|
||||
BIK_initialize_tree(depsgraph, scene, ob, ctime);
|
||||
/* construct the Spline IK trees
|
||||
* - this is not integrated as an IK plugin, since it should be able
|
||||
* to function in conjunction with standard IK
|
||||
* - this is not integrated as an IK plugin, since it should be able
|
||||
* to function in conjunction with standard IK
|
||||
*/
|
||||
BKE_pose_splineik_init_tree(scene, ob, ctime);
|
||||
}
|
||||
|
|
|
@ -1283,8 +1283,8 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
|
|||
|
||||
/* integrate new location & velocity */
|
||||
|
||||
/* by regarding the acceleration as a force at this stage we*/
|
||||
/* can get better control although it's a bit unphysical */
|
||||
/* by regarding the acceleration as a force at this stage we
|
||||
* can get better control although it's a bit unphysical */
|
||||
mul_v3_fl(acc, 1.0f/pa_mass);
|
||||
|
||||
copy_v3_v3(dvec, acc);
|
||||
|
|
|
@ -1576,13 +1576,13 @@ static int cloth_build_springs ( ClothModifierData *clmd, Mesh *mesh )
|
|||
}
|
||||
}
|
||||
else {
|
||||
/* bending springs for hair strands */
|
||||
/* The current algorithm only goes through the edges in order of the mesh edges list */
|
||||
/* and makes springs between the outer vert of edges sharing a vertice. This works just */
|
||||
/* fine for hair, but not for user generated string meshes. This could/should be later */
|
||||
/* extended to work with non-ordered edges so that it can be used for general "rope */
|
||||
/* dynamics" without the need for the vertices or edges to be ordered through the length*/
|
||||
/* of the strands. -jahka */
|
||||
/* bending springs for hair strands
|
||||
* The current algorithm only goes through the edges in order of the mesh edges list
|
||||
* and makes springs between the outer vert of edges sharing a vertice. This works just
|
||||
* fine for hair, but not for user generated string meshes. This could/should be later
|
||||
* extended to work with non-ordered edges so that it can be used for general "rope
|
||||
* dynamics" without the need for the vertices or edges to be ordered through the length
|
||||
* of the strands. -jahka */
|
||||
search = cloth->springs;
|
||||
search2 = search->next;
|
||||
while (search && search2) {
|
||||
|
|
|
@ -465,8 +465,8 @@ static void contarget_get_mesh_mat(Object *ob, const char *substring, float mat[
|
|||
}
|
||||
|
||||
/* derive the rotation from the average normal:
|
||||
* - code taken from transform_gizmo.c,
|
||||
* calc_gizmo_stats, V3D_MANIP_NORMAL case
|
||||
* - code taken from transform_gizmo.c,
|
||||
* calc_gizmo_stats, V3D_MANIP_NORMAL case
|
||||
*/
|
||||
/* we need the transpose of the inverse for a normal... */
|
||||
copy_m3_m4(imat, ob->obmat);
|
||||
|
@ -549,7 +549,7 @@ static void contarget_get_lattice_mat(Object *ob, const char *substring, float m
|
|||
/* The cases where the target can be object data have not been implemented */
|
||||
static void constraint_target_to_mat4(Object *ob, const char *substring, float mat[4][4], short from, short to, short flag, float headtail)
|
||||
{
|
||||
/* Case OBJECT */
|
||||
/* Case OBJECT */
|
||||
if (substring[0] == '\0') {
|
||||
copy_m4_m4(mat, ob->obmat);
|
||||
BKE_constraint_mat_convertspace(ob, NULL, mat, from, to, false);
|
||||
|
@ -561,7 +561,7 @@ static void constraint_target_to_mat4(Object *ob, const char *substring, float m
|
|||
* 'average' vertex normal, and deriving the rotation from that.
|
||||
*
|
||||
* NOTE: EditMode is not currently supported, and will most likely remain that
|
||||
* way as constraints can only really affect things on object/bone level.
|
||||
* way as constraints can only really affect things on object/bone level.
|
||||
*/
|
||||
else if (ob->type == OB_MESH) {
|
||||
contarget_get_mesh_mat(ob, substring, mat);
|
||||
|
@ -571,7 +571,7 @@ static void constraint_target_to_mat4(Object *ob, const char *substring, float m
|
|||
contarget_get_lattice_mat(ob, substring, mat);
|
||||
BKE_constraint_mat_convertspace(ob, NULL, mat, from, to, false);
|
||||
}
|
||||
/* Case BONE */
|
||||
/* Case BONE */
|
||||
else {
|
||||
bPoseChannel *pchan;
|
||||
|
||||
|
@ -678,15 +678,15 @@ static void constraint_target_to_mat4(Object *ob, const char *substring, float m
|
|||
*/
|
||||
|
||||
/* Template for type-info data:
|
||||
* - make a copy of this when creating new constraints, and just change the functions
|
||||
* pointed to as necessary
|
||||
* - although the naming of functions doesn't matter, it would help for code
|
||||
* readability, to follow the same naming convention as is presented here
|
||||
* - any functions that a constraint doesn't need to define, don't define
|
||||
* for such cases, just use NULL
|
||||
* - these should be defined after all the functions have been defined, so that
|
||||
* forward-definitions/prototypes don't need to be used!
|
||||
* - keep this copy #if-def'd so that future constraints can get based off this
|
||||
* - make a copy of this when creating new constraints, and just change the functions
|
||||
* pointed to as necessary
|
||||
* - although the naming of functions doesn't matter, it would help for code
|
||||
* readability, to follow the same naming convention as is presented here
|
||||
* - any functions that a constraint doesn't need to define, don't define
|
||||
* for such cases, just use NULL
|
||||
* - these should be defined after all the functions have been defined, so that
|
||||
* forward-definitions/prototypes don't need to be used!
|
||||
* - keep this copy #if-def'd so that future constraints can get based off this
|
||||
*/
|
||||
#if 0
|
||||
static bConstraintTypeInfo CTI_CONSTRNAME = {
|
||||
|
@ -1288,7 +1288,7 @@ static void followpath_get_tarmat(struct Depsgraph *UNUSED(depsgraph),
|
|||
unit_m4(ct->matrix);
|
||||
|
||||
/* note: when creating constraints that follow path, the curve gets the CU_PATH set now,
|
||||
* currently for paths to work it needs to go through the bevlist/displist system (ton)
|
||||
* currently for paths to work it needs to go through the bevlist/displist system (ton)
|
||||
*/
|
||||
|
||||
if (ct->tar->runtime.curve_cache && ct->tar->runtime.curve_cache->path && ct->tar->runtime.curve_cache->path->data) {
|
||||
|
@ -2362,9 +2362,9 @@ static void actcon_get_tarmat(struct Depsgraph *UNUSED(depsgraph), bConstraint *
|
|||
|
||||
/* determine where in transform range target is */
|
||||
/* data->type is mapped as follows for backwards compatibility:
|
||||
* 00,01,02 - rotation (it used to be like this)
|
||||
* 10,11,12 - scaling
|
||||
* 20,21,22 - location
|
||||
* 00,01,02 - rotation (it used to be like this)
|
||||
* 10,11,12 - scaling
|
||||
* 20,21,22 - location
|
||||
*/
|
||||
if (data->type < 10) {
|
||||
/* extract rotation (is in whatever space target should be in) */
|
||||
|
@ -2408,7 +2408,7 @@ static void actcon_get_tarmat(struct Depsgraph *UNUSED(depsgraph), bConstraint *
|
|||
bPoseChannel *pchan, *tchan;
|
||||
|
||||
/* make a copy of the bone of interest in the temp pose before evaluating action, so that it can get set
|
||||
* - we need to manually copy over a few settings, including rotation order, otherwise this fails
|
||||
* - we need to manually copy over a few settings, including rotation order, otherwise this fails
|
||||
*/
|
||||
pchan = cob->pchan;
|
||||
|
||||
|
@ -2963,12 +2963,14 @@ static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
|
|||
normalize_v3_v3(zz, cob->matrix[2]);
|
||||
|
||||
/* XXX That makes the constraint buggy with asymmetrically scaled objects, see #29940. */
|
||||
/* sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);*/
|
||||
/* vec[0] /= size[0];*/
|
||||
/* vec[1] /= size[1];*/
|
||||
/* vec[2] /= size[2];*/
|
||||
#if 0
|
||||
sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
|
||||
vec[0] /= size[0];
|
||||
vec[1] /= size[1];
|
||||
vec[2] /= size[2];
|
||||
|
||||
/* dist = normalize_v3(vec);*/
|
||||
dist = normalize_v3(vec);
|
||||
#endif
|
||||
|
||||
dist = len_v3v3(cob->matrix[3], ct->matrix[3]);
|
||||
/* Only Y constrained object axis scale should be used, to keep same length when scaling it. */
|
||||
|
@ -3855,9 +3857,9 @@ static void damptrack_do_transform(float matrix[4][4], const float tarvec_in[3],
|
|||
float rmat[3][3], tmat[4][4];
|
||||
|
||||
/* find the (unit) direction that the axis we're interested in currently points
|
||||
* - mul_mat3_m4_v3() only takes the 3x3 (rotation+scaling) components of the 4x4 matrix
|
||||
* - the normalization step at the end should take care of any unwanted scaling
|
||||
* left over in the 3x3 matrix we used
|
||||
* - mul_mat3_m4_v3() only takes the 3x3 (rotation+scaling) components of the 4x4 matrix
|
||||
* - the normalization step at the end should take care of any unwanted scaling
|
||||
* left over in the 3x3 matrix we used
|
||||
*/
|
||||
copy_v3_v3(obvec, track_dir_vecs[track_axis]);
|
||||
mul_mat3_m4_v3(matrix, obvec);
|
||||
|
@ -3871,11 +3873,11 @@ static void damptrack_do_transform(float matrix[4][4], const float tarvec_in[3],
|
|||
|
||||
/* determine the axis-angle rotation, which represents the smallest possible rotation
|
||||
* between the two rotation vectors (i.e. the 'damping' referred to in the name)
|
||||
* - we take this to be the rotation around the normal axis/vector to the plane defined
|
||||
* by the current and destination vectors, which will 'map' the current axis to the
|
||||
* destination vector
|
||||
* - the min/max wrappers around (obvec . tarvec) result (stored temporarily in rangle)
|
||||
* are used to ensure that the smallest angle is chosen
|
||||
* - we take this to be the rotation around the normal axis/vector to the plane defined
|
||||
* by the current and destination vectors, which will 'map' the current axis to the
|
||||
* destination vector
|
||||
* - the min/max wrappers around (obvec . tarvec) result (stored temporarily in rangle)
|
||||
* are used to ensure that the smallest angle is chosen
|
||||
*/
|
||||
cross_v3_v3v3_hi_prec(raxis, obvec, tarvec);
|
||||
|
||||
|
@ -3883,15 +3885,15 @@ static void damptrack_do_transform(float matrix[4][4], const float tarvec_in[3],
|
|||
rangle = acosf(max_ff(-1.0f, min_ff(1.0f, rangle)));
|
||||
|
||||
/* construct rotation matrix from the axis-angle rotation found above
|
||||
* - this call takes care to make sure that the axis provided is a unit vector first
|
||||
* - this call takes care to make sure that the axis provided is a unit vector first
|
||||
*/
|
||||
float norm = normalize_v3(raxis);
|
||||
|
||||
if (norm < FLT_EPSILON) {
|
||||
/* if dot product is nonzero, while cross is zero, we have two opposite vectors!
|
||||
* - this is an ambiguity in the math that needs to be resolved arbitrarily,
|
||||
* or there will be a case where damped track strangely does nothing
|
||||
* - to do that, rotate around a different local axis
|
||||
* - this is an ambiguity in the math that needs to be resolved arbitrarily,
|
||||
* or there will be a case where damped track strangely does nothing
|
||||
* - to do that, rotate around a different local axis
|
||||
*/
|
||||
float tmpvec[3];
|
||||
|
||||
|
@ -5202,13 +5204,13 @@ void BKE_constraint_targets_for_solving_get(struct Depsgraph *depsgraph, bConstr
|
|||
bConstraintTarget *ct;
|
||||
|
||||
/* get targets
|
||||
* - constraints should use ct->matrix, not directly accessing values
|
||||
* - ct->matrix members have not yet been calculated here!
|
||||
* - constraints should use ct->matrix, not directly accessing values
|
||||
* - ct->matrix members have not yet been calculated here!
|
||||
*/
|
||||
cti->get_constraint_targets(con, targets);
|
||||
|
||||
/* set matrices
|
||||
* - calculate if possible, otherwise just initialize as identity matrix
|
||||
* - calculate if possible, otherwise just initialize as identity matrix
|
||||
*/
|
||||
if (cti->get_target_matrix) {
|
||||
for (ct = targets->first; ct; ct = ct->next)
|
||||
|
@ -5253,7 +5255,7 @@ void BKE_constraints_solve(struct Depsgraph *depsgraph, ListBase *conlist, bCons
|
|||
if (con->enforce == 0.0f) continue;
|
||||
|
||||
/* influence of constraint
|
||||
* - value should have been set from animation data already
|
||||
* - value should have been set from animation data already
|
||||
*/
|
||||
enf = con->enforce;
|
||||
|
||||
|
@ -5270,8 +5272,8 @@ void BKE_constraints_solve(struct Depsgraph *depsgraph, ListBase *conlist, bCons
|
|||
cti->evaluate_constraint(con, cob, &targets);
|
||||
|
||||
/* clear targets after use
|
||||
* - this should free temp targets but no data should be copied back
|
||||
* as constraints may have done some nasty things to it...
|
||||
* - this should free temp targets but no data should be copied back
|
||||
* as constraints may have done some nasty things to it...
|
||||
*/
|
||||
if (cti->flush_constraint_targets) {
|
||||
cti->flush_constraint_targets(con, &targets, 1);
|
||||
|
@ -5282,9 +5284,9 @@ void BKE_constraints_solve(struct Depsgraph *depsgraph, ListBase *conlist, bCons
|
|||
BKE_constraint_mat_convertspace(cob->ob, cob->pchan, cob->matrix, con->ownspace, CONSTRAINT_SPACE_WORLD, false);
|
||||
|
||||
/* Interpolate the enforcement, to blend result of constraint into final owner transform
|
||||
* - all this happens in worldspace to prevent any weirdness creeping in ([#26014] and [#25725]),
|
||||
* since some constraints may not convert the solution back to the input space before blending
|
||||
* but all are guaranteed to end up in good "worldspace" result
|
||||
* - all this happens in worldspace to prevent any weirdness creeping in ([#26014] and [#25725]),
|
||||
* since some constraints may not convert the solution back to the input space before blending
|
||||
* but all are guaranteed to end up in good "worldspace" result
|
||||
*/
|
||||
/* Note: all kind of stuff here before (caused trouble), much easier to just interpolate,
|
||||
* or did I miss something? -jahka (r.32105) */
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
#include "IMB_imbuf_types.h"
|
||||
#include "IMB_imbuf.h"
|
||||
|
||||
/* to read material/texture color */
|
||||
/* to read material/texture color */
|
||||
#include "RE_render_ext.h"
|
||||
#include "RE_shader_ext.h"
|
||||
|
||||
|
@ -95,7 +95,7 @@
|
|||
//# pragma GCC diagnostic ignored "-Wdouble-promotion"
|
||||
#endif
|
||||
|
||||
/* precalculated gaussian factors for 5x super sampling */
|
||||
/* precalculated gaussian factors for 5x super sampling */
|
||||
static const float gaussianFactors[5] = {
|
||||
0.996849f,
|
||||
0.596145f,
|
||||
|
@ -174,7 +174,7 @@ typedef struct BakeAdjPoint {
|
|||
float dist; /* distance to */
|
||||
} BakeAdjPoint;
|
||||
|
||||
/* Surface data used while processing a frame */
|
||||
/* Surface data used while processing a frame */
|
||||
typedef struct PaintBakeNormal {
|
||||
float invNorm[3]; /* current pixel world-space inverted normal */
|
||||
float normal_scale; /* normal directional scale for displace mapping */
|
||||
|
@ -206,7 +206,7 @@ typedef struct PaintBakeData {
|
|||
int clear; /* flag to check if surface was cleared/reset -> have to redo velocity etc. */
|
||||
} PaintBakeData;
|
||||
|
||||
/* UV Image sequence format point */
|
||||
/* UV Image sequence format point */
|
||||
typedef struct PaintUVPoint {
|
||||
/* Pixel / mesh data */
|
||||
unsigned int tri_index, pixel_index; /* tri index on domain derived mesh */
|
||||
|
@ -1110,7 +1110,7 @@ bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, str
|
|||
if (!brush->paint_ramp)
|
||||
return false;
|
||||
ramp = brush->paint_ramp->data;
|
||||
/* Add default smooth-falloff ramp. */
|
||||
/* Add default smooth-falloff ramp. */
|
||||
ramp[0].r = ramp[0].g = ramp[0].b = ramp[0].a = 1.0f;
|
||||
ramp[0].pos = 0.0f;
|
||||
ramp[1].r = ramp[1].g = ramp[1].b = ramp[1].pos = 1.0f;
|
||||
|
@ -1141,14 +1141,14 @@ bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, str
|
|||
|
||||
void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tpmd)
|
||||
{
|
||||
/* Init modifier */
|
||||
/* Init modifier */
|
||||
tpmd->type = pmd->type;
|
||||
if (pmd->canvas)
|
||||
dynamicPaint_createType(tpmd, MOD_DYNAMICPAINT_TYPE_CANVAS, NULL);
|
||||
if (pmd->brush)
|
||||
dynamicPaint_createType(tpmd, MOD_DYNAMICPAINT_TYPE_BRUSH, NULL);
|
||||
|
||||
/* Copy data */
|
||||
/* Copy data */
|
||||
if (tpmd->canvas) {
|
||||
DynamicPaintSurface *surface;
|
||||
tpmd->canvas->pmd = tpmd;
|
||||
|
@ -1857,7 +1857,7 @@ static void dynamic_paint_apply_surface_wave_cb(
|
|||
}
|
||||
|
||||
/*
|
||||
* Apply canvas data to the object derived mesh
|
||||
* Apply canvas data to the object derived mesh
|
||||
*/
|
||||
static Mesh *dynamicPaint_Modifier_apply(
|
||||
DynamicPaintModifierData *pmd, Object *ob, Mesh *mesh)
|
||||
|
@ -2049,7 +2049,7 @@ static void canvas_copyMesh(DynamicPaintCanvasSettings *canvas, Mesh *mesh)
|
|||
}
|
||||
|
||||
/*
|
||||
* Updates derived mesh copy and processes dynamic paint step / caches.
|
||||
* Updates derived mesh copy and processes dynamic paint step / caches.
|
||||
*/
|
||||
static void dynamicPaint_frameUpdate(
|
||||
DynamicPaintModifierData *pmd, struct Depsgraph *depsgraph, Scene *scene,
|
||||
|
@ -2163,7 +2163,7 @@ Mesh *dynamicPaint_Modifier_do(
|
|||
/***************************** Image Sequence / UV Image Surface Calls ******************************/
|
||||
|
||||
/*
|
||||
* Create a surface for uv image sequence format
|
||||
* Create a surface for uv image sequence format
|
||||
*/
|
||||
#define JITTER_SAMPLES { \
|
||||
0.0f, 0.0f, \
|
||||
|
@ -2221,7 +2221,7 @@ static void dynamic_paint_create_uv_surface_direct_cb(
|
|||
tPoint->neighbour_pixel = -1;
|
||||
tPoint->pixel_index = index;
|
||||
|
||||
/* Actual pixel center, used when collision is found */
|
||||
/* Actual pixel center, used when collision is found */
|
||||
point[0][0] = ((float)tx + 0.5f) / w;
|
||||
point[0][1] = ((float)ty + 0.5f) / h;
|
||||
|
||||
|
@ -2242,12 +2242,12 @@ static void dynamic_paint_create_uv_surface_direct_cb(
|
|||
point[4][1] = ((float)ty + 1) / h;
|
||||
|
||||
|
||||
/* Loop through samples, starting from middle point */
|
||||
/* Loop through samples, starting from middle point */
|
||||
for (int sample = 0; sample < 5; sample++) {
|
||||
/* Loop through every face in the mesh */
|
||||
/* Loop through every face in the mesh */
|
||||
/* XXX TODO This is *horrible* with big meshes, should use a 2D BVHTree over UV tris here! */
|
||||
for (int i = 0; i < tottri; i++) {
|
||||
/* Check uv bb */
|
||||
/* Check uv bb */
|
||||
if ((faceBB[i].min[0] > point[sample][0]) ||
|
||||
(faceBB[i].min[1] > point[sample][1]) ||
|
||||
(faceBB[i].max[0] < point[sample][0]) ||
|
||||
|
@ -2264,7 +2264,7 @@ static void dynamic_paint_create_uv_surface_direct_cb(
|
|||
if (isect_point_tri_v2(point[sample], uv1, uv2, uv3) != 0) {
|
||||
float uv[2];
|
||||
|
||||
/* Add b-weights per anti-aliasing sample */
|
||||
/* Add b-weights per anti-aliasing sample */
|
||||
for (int j = 0; j < aa_samples; j++) {
|
||||
uv[0] = point[0][0] + jitter5sample[j * 2] / w;
|
||||
uv[1] = point[0][1] + jitter5sample[j * 2 + 1] / h;
|
||||
|
@ -2272,10 +2272,10 @@ static void dynamic_paint_create_uv_surface_direct_cb(
|
|||
barycentric_weights_v2(uv1, uv2, uv3, uv, tempWeights[index * aa_samples + j].v);
|
||||
}
|
||||
|
||||
/* Set surface point face values */
|
||||
/* Set surface point face values */
|
||||
tPoint->tri_index = i;
|
||||
|
||||
/* save vertex indexes */
|
||||
/* save vertex indexes */
|
||||
tPoint->v1 = mloop[mlooptri[i].tri[0]].v;
|
||||
tPoint->v2 = mloop[mlooptri[i].tri[1]].v;
|
||||
tPoint->v3 = mloop[mlooptri[i].tri[2]].v;
|
||||
|
@ -2314,11 +2314,11 @@ static void dynamic_paint_create_uv_surface_neighbor_cb(
|
|||
const int index = tx + w * ty;
|
||||
PaintUVPoint *tPoint = &tempPoints[index];
|
||||
|
||||
/* If point isn't on canvas mesh */
|
||||
/* If point isn't on canvas mesh */
|
||||
if (tPoint->tri_index == -1) {
|
||||
float point[2];
|
||||
|
||||
/* get loop area */
|
||||
/* get loop area */
|
||||
const int u_min = (tx > 0) ? -1 : 0;
|
||||
const int u_max = (tx < (w - 1)) ? 1 : 0;
|
||||
const int v_min = (ty > 0) ? -1 : 0;
|
||||
|
@ -2333,7 +2333,7 @@ static void dynamic_paint_create_uv_surface_neighbor_cb(
|
|||
int v = neighStraightY[ni];
|
||||
|
||||
if (u >= u_min && u <= u_max && v >= v_min && v <= v_max) {
|
||||
/* if not this pixel itself */
|
||||
/* if not this pixel itself */
|
||||
if (u != 0 || v != 0) {
|
||||
const int ind = (tx + u) + w * (ty + v);
|
||||
|
||||
|
@ -2358,14 +2358,14 @@ static void dynamic_paint_create_uv_surface_neighbor_cb(
|
|||
tPoint->tri_index = i;
|
||||
|
||||
/* Now calculate pixel data for this pixel as it was on polygon surface */
|
||||
/* Add b-weights per anti-aliasing sample */
|
||||
/* Add b-weights per anti-aliasing sample */
|
||||
for (int j = 0; j < aa_samples; j++) {
|
||||
uv[0] = point[0] + jitter5sample[j * 2] / w;
|
||||
uv[1] = point[1] + jitter5sample[j * 2 + 1] / h;
|
||||
barycentric_weights_v2(uv1, uv2, uv3, uv, tempWeights[index * aa_samples + j].v);
|
||||
}
|
||||
|
||||
/* save vertex indexes */
|
||||
/* save vertex indexes */
|
||||
tPoint->v1 = mloop[mlooptri[i].tri[0]].v;
|
||||
tPoint->v2 = mloop[mlooptri[i].tri[1]].v;
|
||||
tPoint->v3 = mloop[mlooptri[i].tri[2]].v;
|
||||
|
@ -2590,8 +2590,8 @@ static void dynamic_paint_find_island_border(
|
|||
continue;
|
||||
|
||||
/*
|
||||
* Find a point that is relatively at same edge position
|
||||
* on this other face UV
|
||||
* Find a point that is relatively at same edge position
|
||||
* on this other face UV
|
||||
*/
|
||||
float closest_point[2], dir_vec[2], tgt_pixel[2];
|
||||
|
||||
|
@ -2605,7 +2605,7 @@ static void dynamic_paint_find_island_border(
|
|||
|
||||
int final_pixel[2] = { (int)floorf(tgt_pixel[0] * w), (int)floorf(tgt_pixel[1] * h) };
|
||||
|
||||
/* If current pixel uv is outside of texture */
|
||||
/* If current pixel uv is outside of texture */
|
||||
if (final_pixel[0] < 0 || final_pixel[0] >= w || final_pixel[1] < 0 || final_pixel[1] >= h) {
|
||||
if (bdata->best_index == NOT_FOUND)
|
||||
bdata->best_index = OUT_OF_TEXTURE;
|
||||
|
@ -2616,7 +2616,7 @@ static void dynamic_paint_find_island_border(
|
|||
const PaintUVPoint *tempPoints = data->tempPoints;
|
||||
int final_index = final_pixel[0] + w * final_pixel[1];
|
||||
|
||||
/* If we ended up to our origin point ( mesh has smaller than pixel sized faces) */
|
||||
/* If we ended up to our origin point ( mesh has smaller than pixel sized faces) */
|
||||
if (final_index == (px + w * py))
|
||||
continue;
|
||||
|
||||
|
@ -2629,7 +2629,7 @@ static void dynamic_paint_find_island_border(
|
|||
continue;
|
||||
}
|
||||
|
||||
/* If found pixel still lies on wrong face ( mesh has smaller than pixel sized faces) */
|
||||
/* If found pixel still lies on wrong face ( mesh has smaller than pixel sized faces) */
|
||||
if (tempPoints[final_index].tri_index != target_tri) {
|
||||
/* Check if it's close enough to likely touch the intended triangle. Any triangle
|
||||
* becomes thinner than a pixel at its vertices, so robustness requires some margin. */
|
||||
|
@ -2749,7 +2749,7 @@ static bool dynamicPaint_symmetrizeAdjData(PaintAdjData *ed, int active_points)
|
|||
|
||||
int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, float *progress, short *do_update)
|
||||
{
|
||||
/* Antialias jitter point relative coords */
|
||||
/* Antialias jitter point relative coords */
|
||||
const int aa_samples = (surface->flags & MOD_DPAINT_ANTIALIAS) ? 5 : 1;
|
||||
char uvname[MAX_CUSTOMDATA_LAYER_NAME];
|
||||
uint32_t active_points = 0;
|
||||
|
@ -2786,7 +2786,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
|
|||
mloopuv = CustomData_get_layer_named(&mesh->ldata, CD_MLOOPUV, uvname);
|
||||
}
|
||||
|
||||
/* Check for validity */
|
||||
/* Check for validity */
|
||||
if (!mloopuv)
|
||||
return setError(canvas, N_("No UV data on canvas"));
|
||||
if (surface->image_resolution < 16 || surface->image_resolution > 8192)
|
||||
|
@ -2796,7 +2796,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
|
|||
const int h = w;
|
||||
|
||||
/*
|
||||
* Start generating the surface
|
||||
* Start generating the surface
|
||||
*/
|
||||
printf("DynamicPaint: Preparing UV surface of %ix%i pixels and %i tris.\n", w, h, tottri);
|
||||
|
||||
|
@ -2820,8 +2820,8 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
|
|||
error = true;
|
||||
|
||||
/*
|
||||
* Generate a temporary bounding box array for UV faces to optimize
|
||||
* the pixel-inside-a-face search.
|
||||
* Generate a temporary bounding box array for UV faces to optimize
|
||||
* the pixel-inside-a-face search.
|
||||
*/
|
||||
if (!error) {
|
||||
faceBB = MEM_mallocN(tottri * sizeof(*faceBB), "MPCanvasFaceBB");
|
||||
|
@ -2865,10 +2865,10 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
|
|||
*do_update = true;
|
||||
|
||||
/*
|
||||
* Now loop through every pixel that was left without index
|
||||
* and find if they have neighboring pixels that have an index.
|
||||
* If so use that polygon as pixel surface.
|
||||
* (To avoid seams on uv island edges)
|
||||
* Now loop through every pixel that was left without index
|
||||
* and find if they have neighboring pixels that have an index.
|
||||
* If so use that polygon as pixel surface.
|
||||
* (To avoid seams on uv island edges)
|
||||
*/
|
||||
data.active_points = &active_points;
|
||||
{
|
||||
|
@ -2884,7 +2884,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
|
|||
*progress = 0.06f;
|
||||
*do_update = true;
|
||||
|
||||
/* Generate surface adjacency data. */
|
||||
/* Generate surface adjacency data. */
|
||||
{
|
||||
int cursor = 0;
|
||||
|
||||
|
@ -2968,9 +2968,9 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
|
|||
}
|
||||
|
||||
#if 0
|
||||
/* -----------------------------------------------------------------
|
||||
* For debug, write a dump of adjacency data to a file.
|
||||
* -----------------------------------------------------------------*/
|
||||
/* -----------------------------------------------------------------
|
||||
* For debug, write a dump of adjacency data to a file.
|
||||
* -----------------------------------------------------------------*/
|
||||
FILE *dump_file = fopen("dynpaint-adj-data.txt", "w");
|
||||
int *tmp = MEM_callocN(sizeof(int) * active_points, "tmp");
|
||||
for (int ty = 0; ty < h; ty++) {
|
||||
|
@ -3061,20 +3061,20 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
|
|||
dynamicPaint_allocateSurfaceType(surface);
|
||||
|
||||
#if 0
|
||||
/* -----------------------------------------------------------------
|
||||
* For debug, output pixel statuses to the color map
|
||||
* -----------------------------------------------------------------*/
|
||||
/* -----------------------------------------------------------------
|
||||
* For debug, output pixel statuses to the color map
|
||||
* -----------------------------------------------------------------*/
|
||||
for (index = 0; index < sData->total_points; index++) {
|
||||
ImgSeqFormatData *f_data = (ImgSeqFormatData *)sData->format_data;
|
||||
PaintUVPoint *uvPoint = &((PaintUVPoint *)f_data->uv_p)[index];
|
||||
PaintPoint *pPoint = &((PaintPoint *)sData->type_data)[index];
|
||||
pPoint->alpha = 1.0f;
|
||||
|
||||
/* Every pixel that is assigned as "edge pixel" gets blue color */
|
||||
/* Every pixel that is assigned as "edge pixel" gets blue color */
|
||||
if (uvPoint->neighbour_pixel != -1)
|
||||
pPoint->color[2] = 1.0f;
|
||||
/* and every pixel that finally got an polygon gets red color */
|
||||
/* green color shows pixel face index hash */
|
||||
/* and every pixel that finally got an polygon gets red color */
|
||||
/* green color shows pixel face index hash */
|
||||
if (uvPoint->tri_index != -1) {
|
||||
pPoint->color[0] = 1.0f;
|
||||
pPoint->color[1] = (float)(uvPoint->tri_index % 255) / 256.0f;
|
||||
|
@ -3092,7 +3092,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
|
|||
}
|
||||
|
||||
/*
|
||||
* Outputs an image file from uv surface data.
|
||||
* Outputs an image file from uv surface data.
|
||||
*/
|
||||
typedef struct DynamicPaintOutputSurfaceImageData {
|
||||
const DynamicPaintSurface *surface;
|
||||
|
@ -3116,7 +3116,7 @@ static void dynamic_paint_output_surface_image_paint_cb(
|
|||
/* blend wet and dry layers */
|
||||
blendColors(point->color, point->color[3], point->e_color, point->e_color[3], &ibuf->rect_float[pos]);
|
||||
|
||||
/* Multiply color by alpha if enabled */
|
||||
/* Multiply color by alpha if enabled */
|
||||
if (surface->flags & MOD_DPAINT_MULALPHA) {
|
||||
mul_v3_fl(&ibuf->rect_float[pos], ibuf->rect_float[pos + 3]);
|
||||
}
|
||||
|
@ -3196,7 +3196,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam
|
|||
{
|
||||
ImBuf *ibuf = NULL;
|
||||
PaintSurfaceData *sData = surface->data;
|
||||
/* OpenEXR or PNG */
|
||||
/* OpenEXR or PNG */
|
||||
int format = (surface->image_fileformat & MOD_DPAINT_IMGFORMAT_OPENEXR) ? R_IMF_IMTYPE_OPENEXR : R_IMF_IMTYPE_PNG;
|
||||
char output_file[FILE_MAX];
|
||||
|
||||
|
@ -3212,11 +3212,11 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam
|
|||
BLI_strncpy(output_file, filename, sizeof(output_file));
|
||||
BKE_image_path_ensure_ext_from_imtype(output_file, format);
|
||||
|
||||
/* Validate output file path */
|
||||
/* Validate output file path */
|
||||
BLI_path_abs(output_file, BKE_main_blendfile_path_from_global());
|
||||
BLI_make_existing_file(output_file);
|
||||
|
||||
/* Init image buffer */
|
||||
/* Init image buffer */
|
||||
ibuf = IMB_allocImBuf(surface->image_resolution, surface->image_resolution, 32, IB_rectfloat);
|
||||
if (ibuf == NULL) {
|
||||
setError(surface->canvas, N_("Image save failed: not enough free memory"));
|
||||
|
@ -3328,7 +3328,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam
|
|||
/* A modified callback to bvh tree raycast. The tree must have been built using bvhtree_from_mesh_looptri.
|
||||
* userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree.
|
||||
*
|
||||
* To optimize brush detection speed this doesn't calculate hit coordinates or normal.
|
||||
* To optimize brush detection speed this doesn't calculate hit coordinates or normal.
|
||||
*/
|
||||
static void mesh_tris_spherecast_dp(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
|
||||
{
|
||||
|
@ -3401,7 +3401,7 @@ static void dynamicPaint_mixPaintColors(
|
|||
{
|
||||
PaintPoint *pPoint = &((PaintPoint *)surface->data->type_data)[index];
|
||||
|
||||
/* Add paint */
|
||||
/* Add paint */
|
||||
if (!(paintFlags & MOD_DPAINT_ERASE)) {
|
||||
float mix[4];
|
||||
float temp_alpha = paintAlpha * ((paintFlags & MOD_DPAINT_ABS_ALPHA) ? 1.0f : timescale);
|
||||
|
@ -3427,15 +3427,15 @@ static void dynamicPaint_mixPaintColors(
|
|||
|
||||
pPoint->state = DPAINT_PAINT_NEW;
|
||||
}
|
||||
/* Erase paint */
|
||||
/* Erase paint */
|
||||
else {
|
||||
float a_ratio, a_highest;
|
||||
float wetness;
|
||||
float invFact = 1.0f - paintAlpha;
|
||||
|
||||
/*
|
||||
* Make highest alpha to match erased value
|
||||
* but maintain alpha ratio
|
||||
* Make highest alpha to match erased value
|
||||
* but maintain alpha ratio
|
||||
*/
|
||||
if (paintFlags & MOD_DPAINT_ABS_ALPHA) {
|
||||
a_highest = max_ff(pPoint->color[3], pPoint->e_color[3]);
|
||||
|
@ -3503,7 +3503,7 @@ static void dynamicPaint_mixWaveHeight(
|
|||
}
|
||||
|
||||
/*
|
||||
* add brush results to the surface data depending on surface type
|
||||
* add brush results to the surface data depending on surface type
|
||||
*/
|
||||
static void dynamicPaint_updatePointData(
|
||||
const DynamicPaintSurface *surface, const int index, const DynamicPaintBrushSettings *brush,
|
||||
|
@ -3769,7 +3769,7 @@ typedef struct DynamicPaintPaintData {
|
|||
} DynamicPaintPaintData;
|
||||
|
||||
/*
|
||||
* Paint a brush object mesh to the surface
|
||||
* Paint a brush object mesh to the surface
|
||||
*/
|
||||
static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
||||
void *__restrict userdata,
|
||||
|
@ -3812,7 +3812,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
if (samples > 1 && surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ)
|
||||
total_sample = gaussianTotal;
|
||||
|
||||
/* Supersampling */
|
||||
/* Supersampling */
|
||||
for (ss = 0; ss < samples; ss++) {
|
||||
float ray_start[3], ray_dir[3];
|
||||
float sample_factor = 0.0f;
|
||||
|
@ -3829,17 +3829,17 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
const bool inner_proximity = (brush->flags & MOD_DPAINT_INVERSE_PROX &&
|
||||
brush->collision == MOD_DPAINT_COL_VOLDIST);
|
||||
|
||||
/* hit data */
|
||||
/* hit data */
|
||||
float hitCoord[3];
|
||||
int hitTri = -1;
|
||||
|
||||
/* Supersampling factor */
|
||||
/* Supersampling factor */
|
||||
if (samples > 1 && surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ)
|
||||
sample_factor = gaussianFactors[ss];
|
||||
else
|
||||
sample_factor = 1.0f;
|
||||
|
||||
/* Get current sample position in world coordinates */
|
||||
/* Get current sample position in world coordinates */
|
||||
copy_v3_v3(ray_start, bData->realCoord[bData->s_pos[index] + ss].v);
|
||||
copy_v3_v3(ray_dir, bData->bNormal[index].invNorm);
|
||||
|
||||
|
@ -3851,13 +3851,13 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
nearest.index = -1;
|
||||
nearest.dist_sq = brush_radius * brush_radius; /* find_nearest uses squared distance */
|
||||
|
||||
/* Check volume collision */
|
||||
/* Check volume collision */
|
||||
if (ELEM(brush->collision, MOD_DPAINT_COL_VOLUME, MOD_DPAINT_COL_VOLDIST)) {
|
||||
BLI_bvhtree_ray_cast(treeData->tree, ray_start, ray_dir, 0.0f, &hit, mesh_tris_spherecast_dp, treeData);
|
||||
if (hit.index != -1) {
|
||||
/* We hit a triangle, now check if collision point normal is facing the point */
|
||||
/* We hit a triangle, now check if collision point normal is facing the point */
|
||||
|
||||
/* For optimization sake, hit point normal isn't calculated in ray cast loop */
|
||||
/* For optimization sake, hit point normal isn't calculated in ray cast loop */
|
||||
const int vtri[3] = {
|
||||
mloop[mlooptri[hit.index].tri[0]].v,
|
||||
mloop[mlooptri[hit.index].tri[1]].v,
|
||||
|
@ -3868,8 +3868,8 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
normal_tri_v3(hit.no, mvert[vtri[0]].co, mvert[vtri[1]].co, mvert[vtri[2]].co);
|
||||
dot = dot_v3v3(ray_dir, hit.no);
|
||||
|
||||
/* If ray and hit face normal are facing same direction
|
||||
* hit point is inside a closed mesh. */
|
||||
/* If ray and hit face normal are facing same direction
|
||||
* hit point is inside a closed mesh. */
|
||||
if (dot >= 0.0f) {
|
||||
const float dist = hit.dist;
|
||||
const int f_index = hit.index;
|
||||
|
@ -3884,7 +3884,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
treeData->tree, ray_start, ray_dir, 0.0f, &hit, mesh_tris_spherecast_dp, treeData);
|
||||
|
||||
if (hit.index != -1) {
|
||||
/* Add factor on supersample filter */
|
||||
/* Add factor on supersample filter */
|
||||
volume_factor = 1.0f;
|
||||
hit_found = HIT_VOLUME;
|
||||
|
||||
|
@ -3897,7 +3897,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
}
|
||||
}
|
||||
|
||||
/* Check proximity collision */
|
||||
/* Check proximity collision */
|
||||
if (ELEM(brush->collision, MOD_DPAINT_COL_DIST, MOD_DPAINT_COL_VOLDIST) &&
|
||||
(!hit_found || (brush->flags & MOD_DPAINT_INVERSE_PROX)))
|
||||
{
|
||||
|
@ -3934,7 +3934,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
hit.index = -1;
|
||||
hit.dist = brush_radius;
|
||||
|
||||
/* Do a face normal directional raycast, and use that distance */
|
||||
/* Do a face normal directional raycast, and use that distance */
|
||||
BLI_bvhtree_ray_cast(
|
||||
treeData->tree, ray_start, proj_ray, 0.0f, &hit, mesh_tris_spherecast_dp, treeData);
|
||||
if (hit.index != -1) {
|
||||
|
@ -3944,7 +3944,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
}
|
||||
}
|
||||
|
||||
/* If a hit was found, calculate required values */
|
||||
/* If a hit was found, calculate required values */
|
||||
if (proxDist >= 0.0f && proxDist <= brush_radius) {
|
||||
proximity_factor = proxDist / brush_radius;
|
||||
CLAMP(proximity_factor, 0.0f, 1.0f);
|
||||
|
@ -4037,7 +4037,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
}
|
||||
|
||||
/*
|
||||
* Process hit color and alpha
|
||||
* Process hit color and alpha
|
||||
*/
|
||||
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
|
||||
float sampleColor[3];
|
||||
|
@ -4047,7 +4047,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
sampleColor[1] = brush->g;
|
||||
sampleColor[2] = brush->b;
|
||||
|
||||
/* Sample proximity colorband if required */
|
||||
/* Sample proximity colorband if required */
|
||||
if ((hit_found == HIT_PROXIMITY) &&
|
||||
(brush->proximity_falloff == MOD_DPAINT_PRFALL_RAMP))
|
||||
{
|
||||
|
@ -4071,16 +4071,16 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
|
|||
} // end supersampling
|
||||
|
||||
|
||||
/* if any sample was inside paint range */
|
||||
/* if any sample was inside paint range */
|
||||
if (brushStrength > 0.0f || depth > 0.0f) {
|
||||
/* apply supersampling results */
|
||||
/* apply supersampling results */
|
||||
if (samples > 1) {
|
||||
brushStrength /= total_sample;
|
||||
}
|
||||
CLAMP(brushStrength, 0.0f, 1.0f);
|
||||
|
||||
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
|
||||
/* Get final pixel color and alpha */
|
||||
/* Get final pixel color and alpha */
|
||||
paintColor[0] /= numOfHits;
|
||||
paintColor[1] /= numOfHits;
|
||||
paintColor[2] /= numOfHits;
|
||||
|
@ -4129,9 +4129,9 @@ static int dynamicPaint_paintMesh(Depsgraph *depsgraph, DynamicPaintSurface *sur
|
|||
mloop = mesh->mloop;
|
||||
numOfVerts = mesh->totvert;
|
||||
|
||||
/* Transform collider vertices to global space
|
||||
* (Faster than transforming per surface point
|
||||
* coordinates and normals to object space) */
|
||||
/* Transform collider vertices to global space
|
||||
* (Faster than transforming per surface point
|
||||
* coordinates and normals to object space) */
|
||||
for (ii = 0; ii < numOfVerts; ii++) {
|
||||
mul_m4_v3(brushOb->obmat, mvert[ii].co);
|
||||
boundInsert(&mesh_bb, mvert[ii].co);
|
||||
|
@ -4157,7 +4157,7 @@ static int dynamicPaint_paintMesh(Depsgraph *depsgraph, DynamicPaintSurface *sur
|
|||
|
||||
/* check bounding box collision */
|
||||
if (grid && meshBrush_boundsIntersect(&grid->grid_bounds, &mesh_bb, brush, brush_radius)) {
|
||||
/* Build a bvh tree from transformed vertices */
|
||||
/* Build a bvh tree from transformed vertices */
|
||||
if (BKE_bvhtree_from_mesh_get(&treeData, mesh, BVHTREE_FROM_LOOPTRI, 4)) {
|
||||
int c_index;
|
||||
int total_cells = grid->dim[0] * grid->dim[1] * grid->dim[2];
|
||||
|
@ -4204,7 +4204,7 @@ static int dynamicPaint_paintMesh(Depsgraph *depsgraph, DynamicPaintSurface *sur
|
|||
}
|
||||
|
||||
/*
|
||||
* Paint a particle system to the surface
|
||||
* Paint a particle system to the surface
|
||||
*/
|
||||
static void dynamic_paint_paint_particle_cell_point_cb_ex(
|
||||
void *__restrict userdata,
|
||||
|
@ -4239,14 +4239,14 @@ static void dynamic_paint_paint_particle_cell_point_cb_ex(
|
|||
int part_index = -1;
|
||||
|
||||
/*
|
||||
* With predefined radius, there is no variation between particles.
|
||||
* It's enough to just find the nearest one.
|
||||
* With predefined radius, there is no variation between particles.
|
||||
* It's enough to just find the nearest one.
|
||||
*/
|
||||
{
|
||||
KDTreeNearest nearest;
|
||||
float smooth_range, part_solidradius;
|
||||
|
||||
/* Find nearest particle and get distance to it */
|
||||
/* Find nearest particle and get distance to it */
|
||||
BLI_kdtree_find_nearest(tree, bData->realCoord[bData->s_pos[index]].v, &nearest);
|
||||
/* if outside maximum range, no other particle can influence either */
|
||||
if (nearest.dist > range)
|
||||
|
@ -4262,9 +4262,9 @@ static void dynamic_paint_paint_particle_cell_point_cb_ex(
|
|||
}
|
||||
radius = part_solidradius + smooth;
|
||||
if (nearest.dist < radius) {
|
||||
/* distances inside solid radius has maximum influence -> dist = 0 */
|
||||
/* distances inside solid radius has maximum influence -> dist = 0 */
|
||||
smooth_range = max_ff(0.0f, (nearest.dist - part_solidradius));
|
||||
/* do smoothness if enabled */
|
||||
/* do smoothness if enabled */
|
||||
if (smooth)
|
||||
smooth_range /= smooth;
|
||||
|
||||
|
@ -4273,11 +4273,11 @@ static void dynamic_paint_paint_particle_cell_point_cb_ex(
|
|||
part_index = nearest.index;
|
||||
}
|
||||
}
|
||||
/* If using random per particle radius and closest particle didn't give max influence */
|
||||
/* If using random per particle radius and closest particle didn't give max influence */
|
||||
if (brush->flags & MOD_DPAINT_PART_RAD && strength < 1.0f && psys->part->randsize > 0.0f) {
|
||||
/*
|
||||
* If we use per particle radius, we have to sample all particles
|
||||
* within max radius range
|
||||
* If we use per particle radius, we have to sample all particles
|
||||
* within max radius range
|
||||
*/
|
||||
KDTreeNearest *nearest;
|
||||
|
||||
|
@ -4325,13 +4325,13 @@ static void dynamic_paint_paint_particle_cell_point_cb_ex(
|
|||
radius = rad;
|
||||
}
|
||||
|
||||
/* do smoothness if enabled */
|
||||
/* do smoothness if enabled */
|
||||
CLAMP_MIN(smooth_range, 0.0f);
|
||||
if (smooth)
|
||||
smooth_range /= smooth;
|
||||
|
||||
const float str = 1.0f - smooth_range;
|
||||
/* if influence is greater, use this one */
|
||||
/* if influence is greater, use this one */
|
||||
if (str > strength)
|
||||
strength = str;
|
||||
}
|
||||
|
@ -4366,7 +4366,7 @@ static void dynamic_paint_paint_particle_cell_point_cb_ex(
|
|||
copy_v3_v3(paintColor, &brush->r);
|
||||
}
|
||||
else if (ELEM(surface->type, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_WAVE)) {
|
||||
/* get displace depth */
|
||||
/* get displace depth */
|
||||
disp_intersect = (1.0f - sqrtf(disp_intersect / radius)) * radius;
|
||||
depth = max_ff(0.0f, (radius - disp_intersect) / bData->bNormal[index].normal_scale);
|
||||
}
|
||||
|
@ -4402,14 +4402,14 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
|
|||
return 1;
|
||||
|
||||
/*
|
||||
* Build a kd-tree to optimize distance search
|
||||
* Build a kd-tree to optimize distance search
|
||||
*/
|
||||
tree = BLI_kdtree_new(psys->totpart);
|
||||
|
||||
/* loop through particles and insert valid ones to the tree */
|
||||
p = 0;
|
||||
for (ParticleData *pa = psys->particles; p < psys->totpart; p++, pa++) {
|
||||
/* Proceed only if particle is active */
|
||||
/* Proceed only if particle is active */
|
||||
if ((pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN) == 0) ||
|
||||
(pa->alive == PARS_DEAD && (part->flag & PART_DIED) == 0) ||
|
||||
(pa->flag & PARS_UNEXIST))
|
||||
|
@ -4417,8 +4417,8 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
|
|||
continue;
|
||||
}
|
||||
|
||||
/* for debug purposes check if any NAN particle proceeds
|
||||
* For some reason they get past activity check, this should rule most of them out */
|
||||
/* for debug purposes check if any NAN particle proceeds
|
||||
* For some reason they get past activity check, this should rule most of them out */
|
||||
if (isnan(pa->state.co[0]) || isnan(pa->state.co[1]) || isnan(pa->state.co[2])) {
|
||||
invalidParticles++;
|
||||
continue;
|
||||
|
@ -4438,7 +4438,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
|
|||
if (invalidParticles)
|
||||
printf("Warning: Invalid particle(s) found!\n");
|
||||
|
||||
/* If no suitable particles were found, exit */
|
||||
/* If no suitable particles were found, exit */
|
||||
if (particlesAdded < 1) {
|
||||
BLI_kdtree_free(tree);
|
||||
return 1;
|
||||
|
@ -4452,7 +4452,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
|
|||
int c_index;
|
||||
int total_cells = grid->dim[0] * grid->dim[1] * grid->dim[2];
|
||||
|
||||
/* balance tree */
|
||||
/* balance tree */
|
||||
BLI_kdtree_balance(tree);
|
||||
|
||||
/* loop through space partitioning grid */
|
||||
|
@ -4514,7 +4514,7 @@ static void dynamic_paint_paint_single_point_cb_ex(
|
|||
if (distance > brush_radius)
|
||||
return;
|
||||
|
||||
/* Smooth range or color ramp */
|
||||
/* Smooth range or color ramp */
|
||||
if (brush->proximity_falloff == MOD_DPAINT_PRFALL_SMOOTH ||
|
||||
brush->proximity_falloff == MOD_DPAINT_PRFALL_RAMP)
|
||||
{
|
||||
|
@ -4573,7 +4573,7 @@ static void dynamic_paint_paint_single_point_cb_ex(
|
|||
}
|
||||
}
|
||||
else if (ELEM(surface->type, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_WAVE)) {
|
||||
/* get displace depth */
|
||||
/* get displace depth */
|
||||
const float disp_intersect = (1.0f - sqrtf((brush_radius - distance) / brush_radius)) * brush_radius;
|
||||
depth = max_ff(0.0f, (brush_radius - disp_intersect) / bData->bNormal[index].normal_scale);
|
||||
}
|
||||
|
@ -4595,7 +4595,7 @@ static int dynamicPaint_paintSinglePoint(
|
|||
const MVert *mvert = brush->mesh->mvert;
|
||||
|
||||
/*
|
||||
* Loop through every surface point
|
||||
* Loop through every surface point
|
||||
*/
|
||||
DynamicPaintPaintData data = {
|
||||
.surface = surface,
|
||||
|
@ -4620,7 +4620,7 @@ static int dynamicPaint_paintSinglePoint(
|
|||
/***************************** Dynamic Paint Step / Baking ******************************/
|
||||
|
||||
/*
|
||||
* Calculate current frame distances and directions for adjacency data
|
||||
* Calculate current frame distances and directions for adjacency data
|
||||
*/
|
||||
|
||||
static void dynamic_paint_prepare_adjacency_cb(
|
||||
|
@ -4855,8 +4855,8 @@ typedef struct DynamicPaintEffectData {
|
|||
} DynamicPaintEffectData;
|
||||
|
||||
/*
|
||||
* Prepare data required by effects for current frame.
|
||||
* Returns number of steps required
|
||||
* Prepare data required by effects for current frame.
|
||||
* Returns number of steps required
|
||||
*/
|
||||
static void dynamic_paint_prepare_effect_cb(
|
||||
void *__restrict userdata,
|
||||
|
@ -4969,7 +4969,7 @@ static int dynamicPaint_prepareEffectStep(
|
|||
}
|
||||
|
||||
/**
|
||||
* Processes active effect step.
|
||||
* Processes active effect step.
|
||||
*/
|
||||
static void dynamic_paint_effect_spread_cb(
|
||||
void *__restrict userdata,
|
||||
|
@ -4993,7 +4993,7 @@ static void dynamic_paint_effect_spread_cb(
|
|||
const int *n_index = sData->adj_data->n_index;
|
||||
const int *n_target = sData->adj_data->n_target;
|
||||
|
||||
/* Loop through neighboring points */
|
||||
/* Loop through neighboring points */
|
||||
for (int i = 0; i < numOfNeighs; i++) {
|
||||
const int n_idx = n_index[index] + i;
|
||||
float w_factor;
|
||||
|
@ -5042,7 +5042,7 @@ static void dynamic_paint_effect_shrink_cb(
|
|||
const int *n_index = sData->adj_data->n_index;
|
||||
const int *n_target = sData->adj_data->n_target;
|
||||
|
||||
/* Loop through neighboring points */
|
||||
/* Loop through neighboring points */
|
||||
for (int i = 0; i < numOfNeighs; i++) {
|
||||
const int n_idx = n_index[index] + i;
|
||||
const float speed_scale = (bNeighs[n_idx].dist < eff_scale) ? 1.0f : eff_scale / bNeighs[n_idx].dist;
|
||||
|
@ -5197,12 +5197,12 @@ static void dynamicPaint_doEffectStep(
|
|||
return;
|
||||
|
||||
/*
|
||||
* Spread Effect
|
||||
* Spread Effect
|
||||
*/
|
||||
if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) {
|
||||
const float eff_scale = distance_scale * EFF_MOVEMENT_PER_FRAME * surface->spread_speed * timescale;
|
||||
|
||||
/* Copy current surface to the previous points array to read unmodified values */
|
||||
/* Copy current surface to the previous points array to read unmodified values */
|
||||
memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(struct PaintPoint));
|
||||
|
||||
DynamicPaintEffectData data = {
|
||||
|
@ -5218,12 +5218,12 @@ static void dynamicPaint_doEffectStep(
|
|||
}
|
||||
|
||||
/*
|
||||
* Shrink Effect
|
||||
* Shrink Effect
|
||||
*/
|
||||
if (surface->effect & MOD_DPAINT_EFFECT_DO_SHRINK) {
|
||||
const float eff_scale = distance_scale * EFF_MOVEMENT_PER_FRAME * surface->shrink_speed * timescale;
|
||||
|
||||
/* Copy current surface to the previous points array to read unmodified values */
|
||||
/* Copy current surface to the previous points array to read unmodified values */
|
||||
memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(struct PaintPoint));
|
||||
|
||||
DynamicPaintEffectData data = {
|
||||
|
@ -5239,7 +5239,7 @@ static void dynamicPaint_doEffectStep(
|
|||
}
|
||||
|
||||
/*
|
||||
* Drip Effect
|
||||
* Drip Effect
|
||||
*/
|
||||
if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP && force) {
|
||||
const float eff_scale = distance_scale * EFF_MOVEMENT_PER_FRAME * timescale / 2.0f;
|
||||
|
@ -5248,7 +5248,7 @@ static void dynamicPaint_doEffectStep(
|
|||
const size_t point_locks_size = (sData->total_points / 8) + 1;
|
||||
uint8_t *point_locks = MEM_callocN(sizeof(*point_locks) * point_locks_size, __func__);
|
||||
|
||||
/* Copy current surface to the previous points array to read unmodified values */
|
||||
/* Copy current surface to the previous points array to read unmodified values */
|
||||
memcpy(prevPoint, sData->type_data, sData->total_points * sizeof(struct PaintPoint));
|
||||
|
||||
DynamicPaintEffectData data = {
|
||||
|
@ -5549,7 +5549,7 @@ static void dynamic_paint_surface_pre_step_cb(
|
|||
dry_ratio = pPoint->wetness / p_wetness;
|
||||
|
||||
/*
|
||||
* Slowly "shift" paint from wet layer to dry layer as it drys:
|
||||
* Slowly "shift" paint from wet layer to dry layer as it drys:
|
||||
*/
|
||||
/* make sure alpha values are within proper range */
|
||||
CLAMP(pPoint->color[3], 0.0f, 1.0f);
|
||||
|
@ -5674,7 +5674,7 @@ static void dynamic_paint_generate_bake_data_cb(
|
|||
}
|
||||
|
||||
/*
|
||||
* Calculate current 3D-position and normal of each surface point
|
||||
* Calculate current 3D-position and normal of each surface point
|
||||
*/
|
||||
if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
|
||||
float n1[3], n2[3], n3[3];
|
||||
|
@ -5693,7 +5693,7 @@ static void dynamic_paint_generate_bake_data_cb(
|
|||
f_data->barycentricWeights[index * bData->s_num[index] + ss].v);
|
||||
}
|
||||
|
||||
/* Calculate current pixel surface normal */
|
||||
/* Calculate current pixel surface normal */
|
||||
normal_short_to_float_v3(n1, mvert[tPoint->v1].no);
|
||||
normal_short_to_float_v3(n2, mvert[tPoint->v2].no);
|
||||
normal_short_to_float_v3(n3, mvert[tPoint->v3].no);
|
||||
|
@ -5836,7 +5836,7 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Depsgraph
|
|||
}
|
||||
|
||||
/*
|
||||
* Make a transformed copy of canvas derived mesh vertices to avoid recalculation.
|
||||
* Make a transformed copy of canvas derived mesh vertices to avoid recalculation.
|
||||
*/
|
||||
bData->mesh_bounds.valid = false;
|
||||
for (index = 0; index < canvasNumOfVerts; index++) {
|
||||
|
@ -5846,7 +5846,7 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Depsgraph
|
|||
}
|
||||
|
||||
/*
|
||||
* Prepare each surface point for a new step
|
||||
* Prepare each surface point for a new step
|
||||
*/
|
||||
DynamicPaintGenerateBakeData data = {
|
||||
.surface = surface, .ob = ob,
|
||||
|
@ -5918,11 +5918,11 @@ static int dynamicPaint_doStep(
|
|||
for (int i = 0; i < numobjects; i++) {
|
||||
Object *brushObj = objects[i];
|
||||
|
||||
/* check if target has an active dp modifier */
|
||||
/* check if target has an active dp modifier */
|
||||
ModifierData *md = modifiers_findByType(brushObj, eModifierType_DynamicPaint);
|
||||
if (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render)) {
|
||||
DynamicPaintModifierData *pmd2 = (DynamicPaintModifierData *)md;
|
||||
/* make sure we're dealing with a brush */
|
||||
/* make sure we're dealing with a brush */
|
||||
if (pmd2->brush) {
|
||||
DynamicPaintBrushSettings *brush = pmd2->brush;
|
||||
|
||||
|
@ -5998,7 +5998,7 @@ static int dynamicPaint_doStep(
|
|||
PaintPoint *prevPoint;
|
||||
float *force = NULL;
|
||||
|
||||
/* Allocate memory for surface previous points to read unchanged values from */
|
||||
/* Allocate memory for surface previous points to read unchanged values from */
|
||||
prevPoint = MEM_mallocN(sData->total_points * sizeof(struct PaintPoint), "PaintSurfaceDataCopy");
|
||||
if (!prevPoint)
|
||||
return setError(canvas, N_("Not enough free memory"));
|
||||
|
@ -6009,7 +6009,7 @@ static int dynamicPaint_doStep(
|
|||
dynamicPaint_doEffectStep(surface, force, prevPoint, timescale, (float)steps);
|
||||
}
|
||||
|
||||
/* Free temporary effect data */
|
||||
/* Free temporary effect data */
|
||||
if (prevPoint)
|
||||
MEM_freeN(prevPoint);
|
||||
if (force)
|
||||
|
|
|
@ -274,12 +274,12 @@ FCurve *iter_step_fcurve(FCurve *fcu_iter, const char rna_path[])
|
|||
|
||||
/* Get list of LinkData's containing pointers to the F-Curves which control the types of data indicated
|
||||
* Lists...
|
||||
* - dst: list of LinkData's matching the criteria returned.
|
||||
* List must be freed after use, and is assumed to be empty when passed.
|
||||
* - src: list of F-Curves to search through
|
||||
* - dst: list of LinkData's matching the criteria returned.
|
||||
* List must be freed after use, and is assumed to be empty when passed.
|
||||
* - src: list of F-Curves to search through
|
||||
* Filters...
|
||||
* - dataPrefix: i.e. 'pose.bones[' or 'nodes['
|
||||
* - dataName: name of entity within "" immediately following the prefix
|
||||
* - dataPrefix: i.e. 'pose.bones[' or 'nodes['
|
||||
* - dataName: name of entity within "" immediately following the prefix
|
||||
*/
|
||||
int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix, const char *dataName)
|
||||
{
|
||||
|
@ -432,8 +432,8 @@ static int binarysearch_bezt_index_ex(BezTriple array[], float frame, int arrayl
|
|||
*r_replace = false;
|
||||
|
||||
/* sneaky optimizations (don't go through searching process if...):
|
||||
* - keyframe to be added is to be added out of current bounds
|
||||
* - keyframe to be added would replace one of the existing ones on bounds
|
||||
* - keyframe to be added is to be added out of current bounds
|
||||
* - keyframe to be added would replace one of the existing ones on bounds
|
||||
*/
|
||||
if ((arraylen <= 0) || (array == NULL)) {
|
||||
printf("Warning: binarysearch_bezt_index() encountered invalid array\n");
|
||||
|
@ -833,7 +833,7 @@ void bezt_add_to_cfra_elem(ListBase *lb, BezTriple *bezt)
|
|||
|
||||
|
||||
/* Basic sampling callback which acts as a wrapper for evaluate_fcurve()
|
||||
* 'data' arg here is unneeded here...
|
||||
* 'data' arg here is unneeded here...
|
||||
*/
|
||||
float fcurve_samplingcb_evalcurve(FCurve *fcu, void *UNUSED(data), float evaltime)
|
||||
{
|
||||
|
@ -954,9 +954,9 @@ void calchandles_fcurve(FCurve *fcu)
|
|||
int a = fcu->totvert;
|
||||
|
||||
/* Error checking:
|
||||
* - need at least two points
|
||||
* - need bezier keys
|
||||
* - only bezier-interpolation has handles (for now)
|
||||
* - need at least two points
|
||||
* - need bezier keys
|
||||
* - only bezier-interpolation has handles (for now)
|
||||
*/
|
||||
if (ELEM(NULL, fcu, fcu->bezt) || (a < 2) /*|| ELEM(fcu->ipo, BEZT_IPO_CONST, BEZT_IPO_LIN)*/)
|
||||
return;
|
||||
|
@ -1525,10 +1525,10 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar)
|
|||
pchan = BKE_pose_channel_find_name(ob->pose, dtar->pchan_name);
|
||||
|
||||
/* check if object or bone, and get transform matrix accordingly
|
||||
* - "useEulers" code is used to prevent the problems associated with non-uniqueness
|
||||
* of euler decomposition from matrices [#20870]
|
||||
* - localspace is for [#21384], where parent results are not wanted
|
||||
* but local-consts is for all the common "corrective-shapes-for-limbs" situations
|
||||
* - "useEulers" code is used to prevent the problems associated with non-uniqueness
|
||||
* of euler decomposition from matrices [#20870]
|
||||
* - localspace is for [#21384], where parent results are not wanted
|
||||
* but local-consts is for all the common "corrective-shapes-for-limbs" situations
|
||||
*/
|
||||
if (pchan) {
|
||||
/* bone */
|
||||
|
@ -1594,12 +1594,12 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar)
|
|||
}
|
||||
else if (dtar->transChan >= DTAR_TRANSCHAN_ROTX) {
|
||||
/* extract rotation as eulers (if needed)
|
||||
* - definitely if rotation order isn't eulers already
|
||||
* - if eulers, then we have 2 options:
|
||||
* a) decompose transform matrix as required, then try to make eulers from
|
||||
* there compatible with original values
|
||||
* b) [NOT USED] directly use the original values (no decomposition)
|
||||
* - only an option for "transform space", if quality is really bad with a)
|
||||
* - definitely if rotation order isn't eulers already
|
||||
* - if eulers, then we have 2 options:
|
||||
* a) decompose transform matrix as required, then try to make eulers from
|
||||
* there compatible with original values
|
||||
* b) [NOT USED] directly use the original values (no decomposition)
|
||||
* - only an option for "transform space", if quality is really bad with a)
|
||||
*/
|
||||
float eul[3];
|
||||
|
||||
|
@ -1670,9 +1670,9 @@ void driver_free_variable(ListBase *variables, DriverVar *dvar)
|
|||
return;
|
||||
|
||||
/* free target vars
|
||||
* - need to go over all of them, not just up to the ones that are used
|
||||
* currently, since there may be some lingering RNA paths from
|
||||
* previous users needing freeing
|
||||
* - need to go over all of them, not just up to the ones that are used
|
||||
* currently, since there may be some lingering RNA paths from
|
||||
* previous users needing freeing
|
||||
*/
|
||||
DRIVER_TARGETS_LOOPER(dvar)
|
||||
{
|
||||
|
@ -2033,9 +2033,9 @@ float driver_get_variable_value(ChannelDriver *driver, DriverVar *dvar)
|
|||
}
|
||||
|
||||
/* Evaluate an Channel-Driver to get a 'time' value to use instead of "evaltime"
|
||||
* - "evaltime" is the frame at which F-Curve is being evaluated
|
||||
* - has to return a float value
|
||||
* - driver_orig is where we cache Python expressions, in case of COW
|
||||
* - "evaltime" is the frame at which F-Curve is being evaluated
|
||||
* - has to return a float value
|
||||
* - driver_orig is where we cache Python expressions, in case of COW
|
||||
*/
|
||||
float evaluate_driver(PathResolvedRNA *anim_rna, ChannelDriver *driver, ChannelDriver *driver_orig, const float evaltime)
|
||||
{
|
||||
|
@ -2119,7 +2119,7 @@ float evaluate_driver(PathResolvedRNA *anim_rna, ChannelDriver *driver, ChannelD
|
|||
else if (!driver_try_evaluate_simple_expr(driver, driver_orig, &driver->curval, evaltime)) {
|
||||
#ifdef WITH_PYTHON
|
||||
/* this evaluates the expression using Python, and returns its result:
|
||||
* - on errors it reports, then returns 0.0f
|
||||
* - on errors it reports, then returns 0.0f
|
||||
*/
|
||||
BLI_mutex_lock(&python_driver_lock);
|
||||
|
||||
|
@ -2164,9 +2164,9 @@ void correct_bezpart(float v1[2], float v2[2], float v3[2], float v4[2])
|
|||
h2[1] = v4[1] - v3[1];
|
||||
|
||||
/* calculate distances:
|
||||
* - len = span of time between keyframes
|
||||
* - len1 = length of handle of start key
|
||||
* - len2 = length of handle of end key
|
||||
* - len = span of time between keyframes
|
||||
* - len1 = length of handle of start key
|
||||
* - len2 = length of handle of end key
|
||||
*/
|
||||
len = v4[0] - v1[0];
|
||||
len1 = fabsf(h1[0]);
|
||||
|
@ -2771,8 +2771,8 @@ static float evaluate_fcurve_ex(FCurve *fcu, float evaltime, float cvalue)
|
|||
devaltime = evaluate_time_fmodifiers(storage, &fcu->modifiers, fcu, cvalue, evaltime);
|
||||
|
||||
/* evaluate curve-data
|
||||
* - 'devaltime' instead of 'evaltime', as this is the time that the last time-modifying
|
||||
* F-Curve modifier on the stack requested the curve to be evaluated at
|
||||
* - 'devaltime' instead of 'evaltime', as this is the time that the last time-modifying
|
||||
* F-Curve modifier on the stack requested the curve to be evaluated at
|
||||
*/
|
||||
if (fcu->bezt)
|
||||
cvalue = fcurve_eval_keyframes(fcu, fcu->bezt, devaltime);
|
||||
|
|
|
@ -69,15 +69,15 @@ void *fmodifiers_storage_get(FModifierStackStorage *storage, FModifier *fcm);
|
|||
*/
|
||||
|
||||
/* Template for type-info data:
|
||||
* - make a copy of this when creating new modifiers, and just change the functions
|
||||
* pointed to as necessary
|
||||
* - although the naming of functions doesn't matter, it would help for code
|
||||
* readability, to follow the same naming convention as is presented here
|
||||
* - any functions that a constraint doesn't need to define, don't define
|
||||
* for such cases, just use NULL
|
||||
* - these should be defined after all the functions have been defined, so that
|
||||
* forward-definitions/prototypes don't need to be used!
|
||||
* - keep this copy #if-def'd so that future constraints can get based off this
|
||||
* - make a copy of this when creating new modifiers, and just change the functions
|
||||
* pointed to as necessary
|
||||
* - although the naming of functions doesn't matter, it would help for code
|
||||
* readability, to follow the same naming convention as is presented here
|
||||
* - any functions that a constraint doesn't need to define, don't define
|
||||
* for such cases, just use NULL
|
||||
* - these should be defined after all the functions have been defined, so that
|
||||
* forward-definitions/prototypes don't need to be used!
|
||||
* - keep this copy #if-def'd so that future constraints can get based off this
|
||||
*/
|
||||
#if 0
|
||||
static FModifierTypeInfo FMI_MODNAME = {
|
||||
|
@ -260,7 +260,7 @@ static FModifierTypeInfo FMI_GENERATOR = {
|
|||
* x is the evaluation 'time', and 'y' is the resultant value
|
||||
*
|
||||
* Functions available are
|
||||
* sin, cos, tan, sinc (normalized sin), natural log, square root
|
||||
* sin, cos, tan, sinc (normalized sin), natural log, square root
|
||||
*/
|
||||
|
||||
static void fcm_fn_generator_new_data(void *mdata)
|
||||
|
@ -460,8 +460,8 @@ static void fcm_envelope_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *cv
|
|||
}
|
||||
|
||||
/* adjust *cvalue
|
||||
* - fac is the ratio of how the current y-value corresponds to the reference range
|
||||
* - thus, the new value is found by mapping the old range to the new!
|
||||
* - fac is the ratio of how the current y-value corresponds to the reference range
|
||||
* - thus, the new value is found by mapping the old range to the new!
|
||||
*/
|
||||
fac = (*cvalue - (env->midval + env->min)) / (env->max - env->min);
|
||||
*cvalue = min + fac * (max - min);
|
||||
|
@ -638,8 +638,8 @@ static float fcm_cycles_time(FModifierStackStorage *storage, FCurve *fcu, FModif
|
|||
return evaltime;
|
||||
|
||||
/* check if modifier will do anything
|
||||
* 1) if in data range, definitely don't do anything
|
||||
* 2) if before first frame or after last frame, make sure some cycling is in use
|
||||
* 1) if in data range, definitely don't do anything
|
||||
* 2) if before first frame or after last frame, make sure some cycling is in use
|
||||
*/
|
||||
if (evaltime < prevkey[0]) {
|
||||
if (data->before_mode) {
|
||||
|
@ -711,8 +711,8 @@ static float fcm_cycles_time(FModifierStackStorage *storage, FCurve *fcu, FModif
|
|||
/* calculate where in the cycle we are (overwrite evaltime to reflect this) */
|
||||
else if ((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)(cycle + 1) % 2)) {
|
||||
/* when 'mirror' option is used and cycle number is odd, this cycle is played in reverse
|
||||
* - for 'before' extrapolation, we need to flip in a different way, otherwise values past
|
||||
* then end of the curve get referenced (result of fmod will be negative, and with different phase)
|
||||
* - for 'before' extrapolation, we need to flip in a different way, otherwise values past
|
||||
* then end of the curve get referenced (result of fmod will be negative, and with different phase)
|
||||
*/
|
||||
if (side < 0)
|
||||
evaltime = prevkey[0] - cyct;
|
||||
|
@ -795,8 +795,8 @@ static void fcm_noise_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *cvalu
|
|||
float noise;
|
||||
|
||||
/* generate noise using good ol' Blender Noise
|
||||
* - 0.1 is passed as the 'z' value, otherwise evaluation fails for size = phase = 1
|
||||
* with evaltime being an integer (which happens when evaluating on frame by frame basis)
|
||||
* - 0.1 is passed as the 'z' value, otherwise evaluation fails for size = phase = 1
|
||||
* with evaltime being an integer (which happens when evaluating on frame by frame basis)
|
||||
*/
|
||||
noise = BLI_turbulence(data->size, evaltime - data->offset, data->phase, 0.1f, data->depth);
|
||||
|
||||
|
@ -870,7 +870,7 @@ static void fcm_python_evaluate(FCurve *UNUSED(fcu), FModifier *UNUSED(fcm), flo
|
|||
//FMod_Python *data = (FMod_Python *)fcm->data;
|
||||
|
||||
/* FIXME... need to implement this modifier...
|
||||
* It will need it execute a script using the custom properties
|
||||
* It will need it execute a script using the custom properties
|
||||
*/
|
||||
#endif /* WITH_PYTHON */
|
||||
}
|
||||
|
@ -965,7 +965,7 @@ static float fcm_stepped_time(FCurve *UNUSED(fcu), FModifier *fcm, float UNUSED(
|
|||
|
||||
/* we snap to the start of the previous closest block of 'step_size' frames
|
||||
* after the start offset has been discarded
|
||||
* - i.e. round down
|
||||
* - i.e. round down
|
||||
*/
|
||||
snapblock = (int)((evaltime - data->offset) / data->step_size);
|
||||
|
||||
|
@ -1243,8 +1243,8 @@ void set_active_fmodifier(ListBase *modifiers, FModifier *fcm)
|
|||
}
|
||||
|
||||
/* Do we have any modifiers which match certain criteria
|
||||
* - mtype - type of modifier (if 0, doesn't matter)
|
||||
* - acttype - type of action to perform (if -1, doesn't matter)
|
||||
* - mtype - type of modifier (if 0, doesn't matter)
|
||||
* - acttype - type of action to perform (if -1, doesn't matter)
|
||||
*/
|
||||
bool list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype)
|
||||
{
|
||||
|
@ -1376,13 +1376,13 @@ static float eval_fmodifier_influence(FModifier *fcm, float evaltime)
|
|||
}
|
||||
|
||||
/* evaluate time modifications imposed by some F-Curve Modifiers
|
||||
* - this step acts as an optimization to prevent the F-Curve stack being evaluated
|
||||
* several times by modifiers requesting the time be modified, as the final result
|
||||
* would have required using the modified time
|
||||
* - modifiers only ever receive the unmodified time, as subsequent modifiers should be
|
||||
* working on the 'global' result of the modified curve, not some localised segment,
|
||||
* so nevaltime gets set to whatever the last time-modifying modifier likes...
|
||||
* - we start from the end of the stack, as only the last one matters for now
|
||||
* - this step acts as an optimization to prevent the F-Curve stack being evaluated
|
||||
* several times by modifiers requesting the time be modified, as the final result
|
||||
* would have required using the modified time
|
||||
* - modifiers only ever receive the unmodified time, as subsequent modifiers should be
|
||||
* working on the 'global' result of the modified curve, not some localised segment,
|
||||
* so nevaltime gets set to whatever the last time-modifying modifier likes...
|
||||
* - we start from the end of the stack, as only the last one matters for now
|
||||
*
|
||||
* Note: *fcu might be NULL
|
||||
*/
|
||||
|
|
|
@ -826,8 +826,8 @@ bGPDframe *BKE_gpencil_layer_find_frame(bGPDlayer *gpl, int cframe)
|
|||
}
|
||||
|
||||
/* get the appropriate gp-frame from a given layer
|
||||
* - this sets the layer's actframe var (if allowed to)
|
||||
* - extension beyond range (if first gp-frame is after all frame in interest and cannot add)
|
||||
* - this sets the layer's actframe var (if allowed to)
|
||||
* - extension beyond range (if first gp-frame is after all frame in interest and cannot add)
|
||||
*/
|
||||
bGPDframe *BKE_gpencil_layer_getframe(bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
|
||||
{
|
||||
|
|
|
@ -796,13 +796,13 @@ static const char *particle_adrcodes_to_paths(int adrcode, int *array_index)
|
|||
/* ------- */
|
||||
|
||||
/* Allocate memory for RNA-path for some property given a blocktype, adrcode, and 'root' parts of path
|
||||
* Input:
|
||||
* - id - the datablock that the curve's IPO block is attached to and/or which the new paths will start from
|
||||
* - blocktype, adrcode - determines setting to get
|
||||
* - actname, constname,seq - used to build path
|
||||
* Output:
|
||||
* - array_index - index in property's array (if applicable) to use
|
||||
* - return - the allocated path...
|
||||
* Input:
|
||||
* - id - the datablock that the curve's IPO block is attached to and/or which the new paths will start from
|
||||
* - blocktype, adrcode - determines setting to get
|
||||
* - actname, constname,seq - used to build path
|
||||
* Output:
|
||||
* - array_index - index in property's array (if applicable) to use
|
||||
* - return - the allocated path...
|
||||
*/
|
||||
static char *get_rna_access(ID *id, int blocktype, int adrcode, char actname[], char constname[], Sequence *seq, int *array_index)
|
||||
{
|
||||
|
@ -898,7 +898,7 @@ static char *get_rna_access(ID *id, int blocktype, int adrcode, char actname[],
|
|||
}
|
||||
|
||||
/* check if any property found
|
||||
* - blocktype < 0 is special case for a specific type of driver, where we don't need a property name...
|
||||
* - blocktype < 0 is special case for a specific type of driver, where we don't need a property name...
|
||||
*/
|
||||
if ((propname == NULL) && (blocktype > 0)) {
|
||||
/* nothing was found, so exit */
|
||||
|
@ -1080,7 +1080,7 @@ static ChannelDriver *idriver_to_cdriver(IpoDriver *idriver)
|
|||
}
|
||||
|
||||
/* Add F-Curve to the correct list
|
||||
* - grpname is needed to be used as group name where relevant, and is usually derived from actname
|
||||
* - grpname is needed to be used as group name where relevant, and is usually derived from actname
|
||||
*/
|
||||
static void fcurve_add_to_list(ListBase *groups, ListBase *list, FCurve *fcu, char *grpname, int muteipo)
|
||||
{
|
||||
|
@ -1138,8 +1138,8 @@ static void fcurve_add_to_list(ListBase *groups, ListBase *list, FCurve *fcu, ch
|
|||
|
||||
/* Convert IPO-Curve to F-Curve (including Driver data), and free any of the old data that
|
||||
* is not relevant, BUT do not free the IPO-Curve itself...
|
||||
* actname: name of Action-Channel (if applicable) that IPO-Curve's IPO-block belonged to
|
||||
* constname: name of Constraint-Channel (if applicable) that IPO-Curve's IPO-block belonged to
|
||||
* actname: name of Action-Channel (if applicable) that IPO-Curve's IPO-block belonged to
|
||||
* constname: name of Constraint-Channel (if applicable) that IPO-Curve's IPO-block belonged to
|
||||
* seq: sequencer-strip (if applicable) that IPO-Curve's IPO-block belonged to
|
||||
*/
|
||||
static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *icu, char *actname, char *constname, Sequence *seq, int muteipo)
|
||||
|
@ -1222,8 +1222,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
|
|||
fcurve->array_index = abp->array_index;
|
||||
|
||||
/* convert keyframes
|
||||
* - beztriples and bpoints are mutually exclusive, so we won't have both at the same time
|
||||
* - beztriples are more likely to be encountered as they are keyframes (the other type wasn't used yet)
|
||||
* - beztriples and bpoints are mutually exclusive, so we won't have both at the same time
|
||||
* - beztriples are more likely to be encountered as they are keyframes (the other type wasn't used yet)
|
||||
*/
|
||||
fcurve->totvert = icu->totvert;
|
||||
|
||||
|
@ -1271,15 +1271,15 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
|
|||
unsigned int i = 0;
|
||||
|
||||
/* get rna-path
|
||||
* - we will need to set the 'disabled' flag if no path is able to be made (for now)
|
||||
* - we will need to set the 'disabled' flag if no path is able to be made (for now)
|
||||
*/
|
||||
fcu->rna_path = get_rna_access(id, icu->blocktype, icu->adrcode, actname, constname, seq, &fcu->array_index);
|
||||
if (fcu->rna_path == NULL)
|
||||
fcu->flag |= FCURVE_DISABLED;
|
||||
|
||||
/* convert keyframes
|
||||
* - beztriples and bpoints are mutually exclusive, so we won't have both at the same time
|
||||
* - beztriples are more likely to be encountered as they are keyframes (the other type wasn't used yet)
|
||||
* - beztriples and bpoints are mutually exclusive, so we won't have both at the same time
|
||||
* - beztriples are more likely to be encountered as they are keyframes (the other type wasn't used yet)
|
||||
*/
|
||||
fcu->totvert = icu->totvert;
|
||||
|
||||
|
@ -1308,8 +1308,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
|
|||
}
|
||||
|
||||
/* correct values for euler rotation curves
|
||||
* - they were degrees/10
|
||||
* - we need radians for RNA to do the right thing
|
||||
* - they were degrees/10
|
||||
* - we need radians for RNA to do the right thing
|
||||
*/
|
||||
if ( ((icu->blocktype == ID_OB) && ELEM(icu->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) ||
|
||||
((icu->blocktype == ID_PO) && ELEM(icu->adrcode, AC_EUL_X, AC_EUL_Y, AC_EUL_Z)) )
|
||||
|
@ -1322,8 +1322,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
|
|||
}
|
||||
|
||||
/* correct values for path speed curves
|
||||
* - their values were 0-1
|
||||
* - we now need as 'frames'
|
||||
* - their values were 0-1
|
||||
* - we now need as 'frames'
|
||||
*/
|
||||
if ( (id) && (icu->blocktype == GS(id->name)) &&
|
||||
(fcu->rna_path && STREQ(fcu->rna_path, "eval_time")) )
|
||||
|
@ -1336,9 +1336,9 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
|
|||
}
|
||||
|
||||
/* correct times for rotation drivers
|
||||
* - need to go from degrees to radians...
|
||||
* - there's only really 1 target to worry about
|
||||
* - were also degrees/10
|
||||
* - need to go from degrees to radians...
|
||||
* - there's only really 1 target to worry about
|
||||
* - were also degrees/10
|
||||
*/
|
||||
if (fcu->driver && fcu->driver->variables.first) {
|
||||
DriverVar *dvar = fcu->driver->variables.first;
|
||||
|
@ -1397,10 +1397,10 @@ static void ipo_to_animato(ID *id, Ipo *ipo, char actname[], char constname[], S
|
|||
if (G.debug & G_DEBUG) printf("ipo_to_animato\n");
|
||||
|
||||
/* validate actname and constname
|
||||
* - clear actname if it was one of the generic <builtin> ones (i.e. 'Object', or 'Shapes')
|
||||
* - actname can then be used to assign F-Curves in Action to Action Groups
|
||||
* (i.e. thus keeping the benefits that used to be provided by Action Channels for grouping
|
||||
* F-Curves for bones). This may be added later... for now let's just dump without them...
|
||||
* - clear actname if it was one of the generic <builtin> ones (i.e. 'Object', or 'Shapes')
|
||||
* - actname can then be used to assign F-Curves in Action to Action Groups
|
||||
* (i.e. thus keeping the benefits that used to be provided by Action Channels for grouping
|
||||
* F-Curves for bones). This may be added later... for now let's just dump without them...
|
||||
*/
|
||||
if (actname) {
|
||||
if ((ipo->blocktype == ID_OB) && STREQ(actname, "Object"))
|
||||
|
@ -1608,8 +1608,8 @@ static void nlastrips_to_animdata(ID *id, ListBase *strips)
|
|||
/* create a new-style NLA-strip which references this Action, then copy over relevant settings */
|
||||
{
|
||||
/* init a new strip, and assign the action to it
|
||||
* - no need to muck around with the user-counts, since this is just
|
||||
* passing over the ref to the new owner, not creating an additional ref
|
||||
* - no need to muck around with the user-counts, since this is just
|
||||
* passing over the ref to the new owner, not creating an additional ref
|
||||
*/
|
||||
strip = MEM_callocN(sizeof(NlaStrip), "NlaStrip");
|
||||
strip->act = as->act;
|
||||
|
|
|
@ -140,9 +140,9 @@ Lamp *BKE_lamp_copy(Main *bmain, const Lamp *la)
|
|||
Lamp *BKE_lamp_localize(Lamp *la)
|
||||
{
|
||||
/* TODO replace with something like
|
||||
* Lamp *la_copy;
|
||||
* BKE_id_copy_ex(bmain, &la->id, (ID **)&la_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
|
||||
* return la_copy;
|
||||
* Lamp *la_copy;
|
||||
* BKE_id_copy_ex(bmain, &la->id, (ID **)&la_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
|
||||
* return la_copy;
|
||||
*
|
||||
* ... Once f*** nodes are fully converted to that too :( */
|
||||
|
||||
|
|
|
@ -226,9 +226,9 @@ Material *BKE_material_copy(Main *bmain, const Material *ma)
|
|||
Material *BKE_material_localize(Material *ma)
|
||||
{
|
||||
/* TODO replace with something like
|
||||
* Material *ma_copy;
|
||||
* BKE_id_copy_ex(bmain, &ma->id, (ID **)&ma_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
|
||||
* return ma_copy;
|
||||
* Material *ma_copy;
|
||||
* BKE_id_copy_ex(bmain, &ma->id, (ID **)&ma_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
|
||||
* return ma_copy;
|
||||
*
|
||||
* ... Once f*** nodes are fully converted to that too :( */
|
||||
|
||||
|
|
|
@ -449,18 +449,18 @@ static void freepolygonize(PROCESS *process)
|
|||
|
||||
/**** Cubical Polygonization (optional) ****/
|
||||
|
||||
#define LB 0 /* left bottom edge */
|
||||
#define LT 1 /* left top edge */
|
||||
#define LN 2 /* left near edge */
|
||||
#define LF 3 /* left far edge */
|
||||
#define LB 0 /* left bottom edge */
|
||||
#define LT 1 /* left top edge */
|
||||
#define LN 2 /* left near edge */
|
||||
#define LF 3 /* left far edge */
|
||||
#define RB 4 /* right bottom edge */
|
||||
#define RT 5 /* right top edge */
|
||||
#define RN 6 /* right near edge */
|
||||
#define RF 7 /* right far edge */
|
||||
#define BN 8 /* bottom near edge */
|
||||
#define BF 9 /* bottom far edge */
|
||||
#define TN 10 /* top near edge */
|
||||
#define TF 11 /* top far edge */
|
||||
#define RT 5 /* right top edge */
|
||||
#define RN 6 /* right near edge */
|
||||
#define RF 7 /* right far edge */
|
||||
#define BN 8 /* bottom near edge */
|
||||
#define BF 9 /* bottom far edge */
|
||||
#define TN 10 /* top near edge */
|
||||
#define TF 11 /* top far edge */
|
||||
|
||||
static INTLISTS *cubetable[256];
|
||||
static char faces[256];
|
||||
|
|
|
@ -266,7 +266,7 @@ void BKE_nla_tracks_copy(Main *bmain, ListBase *dst, ListBase *src, const int fl
|
|||
/* Adding ------------------------------------------- */
|
||||
|
||||
/* Add a NLA Track to the given AnimData
|
||||
* - prev: NLA-Track to add the new one after
|
||||
* - prev: NLA-Track to add the new one after
|
||||
*/
|
||||
NlaTrack *BKE_nlatrack_add(AnimData *adt, NlaTrack *prev)
|
||||
{
|
||||
|
@ -311,11 +311,11 @@ NlaStrip *BKE_nlastrip_new(bAction *act)
|
|||
strip = MEM_callocN(sizeof(NlaStrip), "NlaStrip");
|
||||
|
||||
/* generic settings
|
||||
* - selected flag to highlight this to the user
|
||||
* - (XXX) disabled Auto-Blends, as this was often causing some unwanted effects
|
||||
* - (XXX) synchronization of strip-length in accordance with changes to action-length
|
||||
* is not done though, since this should only really happens in editmode for strips now
|
||||
* though this decision is still subject to further review...
|
||||
* - selected flag to highlight this to the user
|
||||
* - (XXX) disabled Auto-Blends, as this was often causing some unwanted effects
|
||||
* - (XXX) synchronization of strip-length in accordance with changes to action-length
|
||||
* is not done though, since this should only really happens in editmode for strips now
|
||||
* though this decision is still subject to further review...
|
||||
*/
|
||||
strip->flag = NLASTRIP_FLAG_SELECT;
|
||||
|
||||
|
@ -324,7 +324,7 @@ NlaStrip *BKE_nlastrip_new(bAction *act)
|
|||
id_us_plus(&act->id);
|
||||
|
||||
/* determine initial range
|
||||
* - strip length cannot be 0... ever...
|
||||
* - strip length cannot be 0... ever...
|
||||
*/
|
||||
calc_action_range(strip->act, &strip->actstart, &strip->actend, 0);
|
||||
|
||||
|
@ -413,7 +413,7 @@ NlaStrip *BKE_nla_add_soundstrip(Scene *scene, Speaker *speaker)
|
|||
/* Strip Mapping ------------------------------------- */
|
||||
|
||||
/* non clipped mapping for strip-time <-> global time (for Action-Clips)
|
||||
* invert = convert action-strip time to global time
|
||||
* invert = convert action-strip time to global time
|
||||
*/
|
||||
static float nlastrip_get_frame_actionclip(NlaStrip *strip, float cframe, short mode)
|
||||
{
|
||||
|
@ -483,7 +483,7 @@ static float nlastrip_get_frame_actionclip(NlaStrip *strip, float cframe, short
|
|||
}
|
||||
|
||||
/* non clipped mapping for strip-time <-> global time (for Transitions)
|
||||
* invert = convert action-strip time to global time
|
||||
* invert = convert action-strip time to global time
|
||||
*/
|
||||
static float nlastrip_get_frame_transition(NlaStrip *strip, float cframe, short mode)
|
||||
{
|
||||
|
@ -528,7 +528,7 @@ float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode)
|
|||
|
||||
|
||||
/* Non clipped mapping for strip-time <-> global time
|
||||
* mode = eNlaTime_ConvertModes -> NLATIME_CONVERT_*
|
||||
* mode = eNlaTime_ConvertModes -> NLATIME_CONVERT_*
|
||||
*
|
||||
* Public API method - perform this mapping using the given AnimData block
|
||||
* and perform any necessary sanity checks on the value
|
||||
|
@ -538,9 +538,9 @@ float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode)
|
|||
NlaStrip *strip;
|
||||
|
||||
/* sanity checks
|
||||
* - obviously we've got to have some starting data
|
||||
* - when not in tweakmode, the active Action does not have any scaling applied :)
|
||||
* - when in tweakmode, if the no-mapping flag is set, do not map
|
||||
* - obviously we've got to have some starting data
|
||||
* - when not in tweakmode, the active Action does not have any scaling applied :)
|
||||
* - when in tweakmode, if the no-mapping flag is set, do not map
|
||||
*/
|
||||
if ((adt == NULL) || (adt->flag & ADT_NLA_EDIT_ON) == 0 || (adt->flag & ADT_NLA_EDIT_NOMAP))
|
||||
return cframe;
|
||||
|
@ -560,9 +560,9 @@ float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode)
|
|||
strip = adt->actstrip;
|
||||
|
||||
/* sanity checks
|
||||
* - in rare cases, we may not be able to find this strip for some reason (internal error)
|
||||
* - for now, if the user has defined a curve to control the time, this correction cannot be performed
|
||||
* reliably...
|
||||
* - in rare cases, we may not be able to find this strip for some reason (internal error)
|
||||
* - for now, if the user has defined a curve to control the time, this correction cannot be performed
|
||||
* reliably...
|
||||
*/
|
||||
if ((strip == NULL) || (strip->flag & NLASTRIP_FLAG_USR_TIME))
|
||||
return cframe;
|
||||
|
@ -692,7 +692,7 @@ bool BKE_nlastrips_add_strip(ListBase *strips, NlaStrip *strip)
|
|||
|
||||
/* Convert 'islands' (i.e. continuous string of) selected strips to be
|
||||
* contained within 'Meta-Strips' which act as strips which contain strips.
|
||||
* temp: are the meta-strips to be created 'temporary' ones used for transforms?
|
||||
* temp: are the meta-strips to be created 'temporary' ones used for transforms?
|
||||
*/
|
||||
void BKE_nlastrips_make_metas(ListBase *strips, bool is_temp)
|
||||
{
|
||||
|
@ -768,8 +768,8 @@ void BKE_nlastrips_clear_metastrip(ListBase *strips, NlaStrip *strip)
|
|||
}
|
||||
|
||||
/* Remove meta-strips (i.e. flatten the list of strips) from the top-level of the list of strips
|
||||
* sel: only consider selected meta-strips, otherwise all meta-strips are removed
|
||||
* onlyTemp: only remove the 'temporary' meta-strips used for transforms
|
||||
* sel: only consider selected meta-strips, otherwise all meta-strips are removed
|
||||
* onlyTemp: only remove the 'temporary' meta-strips used for transforms
|
||||
*/
|
||||
void BKE_nlastrips_clear_metas(ListBase *strips, bool only_sel, bool only_temp)
|
||||
{
|
||||
|
@ -856,8 +856,8 @@ void BKE_nlameta_flush_transforms(NlaStrip *mstrip)
|
|||
short scaleChanged = 0;
|
||||
|
||||
/* sanity checks
|
||||
* - strip must exist
|
||||
* - strip must be a meta-strip with some contents
|
||||
* - strip must exist
|
||||
* - strip must be a meta-strip with some contents
|
||||
*/
|
||||
if (ELEM(NULL, mstrip, mstrip->strips.first))
|
||||
return;
|
||||
|
@ -865,8 +865,8 @@ void BKE_nlameta_flush_transforms(NlaStrip *mstrip)
|
|||
return;
|
||||
|
||||
/* get the original start/end points, and calculate the start-frame offset
|
||||
* - these are simply the start/end frames of the child strips,
|
||||
* since we assume they weren't transformed yet
|
||||
* - these are simply the start/end frames of the child strips,
|
||||
* since we assume they weren't transformed yet
|
||||
*/
|
||||
oStart = ((NlaStrip *)mstrip->strips.first)->start;
|
||||
oEnd = ((NlaStrip *)mstrip->strips.last)->end;
|
||||
|
@ -874,7 +874,7 @@ void BKE_nlameta_flush_transforms(NlaStrip *mstrip)
|
|||
|
||||
/* optimization:
|
||||
* don't flush if nothing changed yet
|
||||
* TODO: maybe we need a flag to say always flush?
|
||||
* TODO: maybe we need a flag to say always flush?
|
||||
*/
|
||||
if (IS_EQF(oStart, mstrip->start) && IS_EQF(oEnd, mstrip->end))
|
||||
return;
|
||||
|
@ -1033,9 +1033,9 @@ void BKE_nlatrack_set_active(ListBase *tracks, NlaTrack *nlt_a)
|
|||
bool BKE_nlatrack_has_space(NlaTrack *nlt, float start, float end)
|
||||
{
|
||||
/* sanity checks
|
||||
* - track must exist
|
||||
* - track must be editable
|
||||
* - bounds cannot be equal (0-length is nasty)
|
||||
* - track must exist
|
||||
* - track must be editable
|
||||
* - bounds cannot be equal (0-length is nasty)
|
||||
*/
|
||||
if ((nlt == NULL) || (nlt->flag & NLATRACK_PROTECTED) || IS_EQF(start, end))
|
||||
return false;
|
||||
|
@ -1162,8 +1162,8 @@ bool BKE_nlastrip_within_bounds(NlaStrip *strip, float min, float max)
|
|||
return false;
|
||||
|
||||
/* only ok if at least part of the strip is within the bounding window
|
||||
* - first 2 cases cover when the strip length is less than the bounding area
|
||||
* - second 2 cases cover when the strip length is greater than the bounding area
|
||||
* - first 2 cases cover when the strip length is less than the bounding area
|
||||
* - second 2 cases cover when the strip length is greater than the bounding area
|
||||
*/
|
||||
if ((stripLen < boundsLen) &&
|
||||
!(IN_RANGE(strip->start, min, max) ||
|
||||
|
@ -1288,8 +1288,8 @@ void BKE_nlastrip_recalculate_bounds(NlaStrip *strip)
|
|||
float actlen, mapping;
|
||||
|
||||
/* sanity checks
|
||||
* - must have a strip
|
||||
* - can only be done for action clips
|
||||
* - must have a strip
|
||||
* - can only be done for action clips
|
||||
*/
|
||||
if ((strip == NULL) || (strip->type != NLASTRIP_TYPE_CLIP))
|
||||
return;
|
||||
|
@ -1512,8 +1512,8 @@ void BKE_nlastrip_validate_name(AnimData *adt, NlaStrip *strip)
|
|||
}
|
||||
|
||||
/* build a hash-table of all the strips in the tracks
|
||||
* - this is easier than iterating over all the tracks+strips hierarchy every time
|
||||
* (and probably faster)
|
||||
* - this is easier than iterating over all the tracks+strips hierarchy every time
|
||||
* (and probably faster)
|
||||
*/
|
||||
gh = BLI_ghash_str_new("nlastrip_validate_name gh");
|
||||
|
||||
|
@ -1529,7 +1529,7 @@ void BKE_nlastrip_validate_name(AnimData *adt, NlaStrip *strip)
|
|||
}
|
||||
|
||||
/* if the hash-table has a match for this name, try other names...
|
||||
* - in an extreme case, it might not be able to find a name, but then everything else in Blender would fail too :)
|
||||
* - in an extreme case, it might not be able to find a name, but then everything else in Blender would fail too :)
|
||||
*/
|
||||
BLI_uniquename_cb(nla_editbone_name_check, (void *)gh, DATA_("NlaStrip"), '.', strip->name, sizeof(strip->name));
|
||||
|
||||
|
@ -1540,9 +1540,9 @@ void BKE_nlastrip_validate_name(AnimData *adt, NlaStrip *strip)
|
|||
/* ---- */
|
||||
|
||||
/* Get strips which overlap the given one at the start/end of its range
|
||||
* - strip: strip that we're finding overlaps for
|
||||
* - track: nla-track that the overlapping strips should be found from
|
||||
* - start, end: frames for the offending endpoints
|
||||
* - strip: strip that we're finding overlaps for
|
||||
* - track: nla-track that the overlapping strips should be found from
|
||||
* - start, end: frames for the offending endpoints
|
||||
*/
|
||||
static void nlastrip_get_endpoint_overlaps(NlaStrip *strip, NlaTrack *track, float **start, float **end)
|
||||
{
|
||||
|
@ -1567,7 +1567,7 @@ static void nlastrip_get_endpoint_overlaps(NlaStrip *strip, NlaTrack *track, flo
|
|||
return; /* the range we're after has already passed */
|
||||
|
||||
/* if this strip is not part of an island of continuous strips, it can be used
|
||||
* - this check needs to be done for each end of the strip we try and use...
|
||||
* - this check needs to be done for each end of the strip we try and use...
|
||||
*/
|
||||
if ((nls->next == NULL) || IS_EQF(nls->next->start, nls->end) == 0) {
|
||||
if ((nls->end > strip->start) && (nls->end < strip->end))
|
||||
|
@ -1601,9 +1601,9 @@ static void BKE_nlastrip_validate_autoblends(NlaTrack *nlt, NlaStrip *nls)
|
|||
nlastrip_get_endpoint_overlaps(nls, nlt->next, &ns, &ne);
|
||||
|
||||
/* set overlaps for this strip
|
||||
* - don't use the values obtained though if the end in question
|
||||
* is directly followed/preceded by another strip, forming an
|
||||
* 'island' of continuous strips
|
||||
* - don't use the values obtained though if the end in question
|
||||
* is directly followed/preceded by another strip, forming an
|
||||
* 'island' of continuous strips
|
||||
*/
|
||||
if ((ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start) == 0)) {
|
||||
/* start overlaps - pick the largest overlap */
|
||||
|
@ -1866,7 +1866,7 @@ bool BKE_nla_tweakmode_enter(AnimData *adt)
|
|||
return true;
|
||||
|
||||
/* go over the tracks, finding the active one, and its active strip
|
||||
* - if we cannot find both, then there's nothing to do
|
||||
* - if we cannot find both, then there's nothing to do
|
||||
*/
|
||||
for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
|
||||
/* check if active */
|
||||
|
@ -1936,16 +1936,16 @@ bool BKE_nla_tweakmode_enter(AnimData *adt)
|
|||
}
|
||||
|
||||
/* go over all the tracks after AND INCLUDING the active one, tagging them as being disabled
|
||||
* - the active track needs to also be tagged, otherwise, it'll overlap with the tweaks going on
|
||||
* - the active track needs to also be tagged, otherwise, it'll overlap with the tweaks going on
|
||||
*/
|
||||
for (nlt = activeTrack; nlt; nlt = nlt->next)
|
||||
nlt->flag |= NLATRACK_DISABLED;
|
||||
|
||||
/* handle AnimData level changes:
|
||||
* - 'real' active action to temp storage (no need to change user-counts)
|
||||
* - action of active strip set to be the 'active action', and have its usercount incremented
|
||||
* - editing-flag for this AnimData block should also get turned on (for more efficient restoring)
|
||||
* - take note of the active strip for mapping-correction of keyframes in the action being edited
|
||||
* - 'real' active action to temp storage (no need to change user-counts)
|
||||
* - action of active strip set to be the 'active action', and have its usercount incremented
|
||||
* - editing-flag for this AnimData block should also get turned on (for more efficient restoring)
|
||||
* - take note of the active strip for mapping-correction of keyframes in the action being edited
|
||||
*/
|
||||
adt->tmpact = adt->action;
|
||||
adt->action = activeStrip->act;
|
||||
|
@ -2011,11 +2011,11 @@ void BKE_nla_tweakmode_exit(AnimData *adt)
|
|||
}
|
||||
|
||||
/* handle AnimData level changes:
|
||||
* - 'temporary' active action needs its usercount decreased, since we're removing this reference
|
||||
* - 'real' active action is restored from storage
|
||||
* - storage pointer gets cleared (to avoid having bad notes hanging around)
|
||||
* - editing-flag for this AnimData block should also get turned off
|
||||
* - clear pointer to active strip
|
||||
* - 'temporary' active action needs its usercount decreased, since we're removing this reference
|
||||
* - 'real' active action is restored from storage
|
||||
* - storage pointer gets cleared (to avoid having bad notes hanging around)
|
||||
* - editing-flag for this AnimData block should also get turned off
|
||||
* - clear pointer to active strip
|
||||
*/
|
||||
if (adt->action)
|
||||
id_us_min(&adt->action->id);
|
||||
|
|
|
@ -333,8 +333,8 @@ static void make_duplis_frames(const DupliContext *ctx)
|
|||
|
||||
/* make a copy of the object's original data (before any dupli-data overwrites it)
|
||||
* as we'll need this to keep track of unkeyed data
|
||||
* - this doesn't take into account other data that can be reached from the object,
|
||||
* for example it's shapekeys or bones, hence the need for an update flush at the end
|
||||
* - this doesn't take into account other data that can be reached from the object,
|
||||
* for example it's shapekeys or bones, hence the need for an update flush at the end
|
||||
*/
|
||||
copyob = *ob;
|
||||
|
||||
|
|
|
@ -1616,7 +1616,7 @@ static void sph_density_accum_cb(void *userdata, int index, const float co[3], f
|
|||
* account, the forces will be biased by the tree search order. This
|
||||
* effectively adds energy to the system, and results in a churning motion.
|
||||
* But, we have to stop somewhere, and it's not the end of the world.
|
||||
* - jahka and z0r
|
||||
* - jahka and z0r
|
||||
*/
|
||||
if (pfr->tot_neighbors >= SPH_NEIGHBORS)
|
||||
return;
|
||||
|
@ -2192,7 +2192,7 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
|
|||
}
|
||||
|
||||
/************************************************
|
||||
* Collisions
|
||||
* Collisions
|
||||
*
|
||||
* The algorithm is roughly:
|
||||
* 1. Use a BVH tree to search for faces that a particle may collide with.
|
||||
|
|
|
@ -410,9 +410,9 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
|
|||
return;
|
||||
|
||||
/* if automatically determining dimensions, use the Object's boundbox
|
||||
* - assume that all quadrics are standing upright on local z-axis
|
||||
* - assume even distribution of mass around the Object's pivot
|
||||
* (i.e. Object pivot is centralized in boundbox)
|
||||
* - assume that all quadrics are standing upright on local z-axis
|
||||
* - assume even distribution of mass around the Object's pivot
|
||||
* (i.e. Object pivot is centralized in boundbox)
|
||||
*/
|
||||
// XXX: all dimensions are auto-determined now... later can add stored settings for this
|
||||
/* get object dimensions without scaling */
|
||||
|
@ -498,10 +498,10 @@ void BKE_rigidbody_calc_volume(Object *ob, float *r_vol)
|
|||
float volume = 0.0f;
|
||||
|
||||
/* if automatically determining dimensions, use the Object's boundbox
|
||||
* - assume that all quadrics are standing upright on local z-axis
|
||||
* - assume even distribution of mass around the Object's pivot
|
||||
* (i.e. Object pivot is centralized in boundbox)
|
||||
* - boundbox gives full width
|
||||
* - assume that all quadrics are standing upright on local z-axis
|
||||
* - assume even distribution of mass around the Object's pivot
|
||||
* (i.e. Object pivot is centralized in boundbox)
|
||||
* - boundbox gives full width
|
||||
*/
|
||||
// XXX: all dimensions are auto-determined now... later can add stored settings for this
|
||||
BKE_object_dimensions_get(ob, size);
|
||||
|
@ -583,10 +583,10 @@ void BKE_rigidbody_calc_center_of_mass(Object *ob, float r_center[3])
|
|||
zero_v3(r_center);
|
||||
|
||||
/* if automatically determining dimensions, use the Object's boundbox
|
||||
* - assume that all quadrics are standing upright on local z-axis
|
||||
* - assume even distribution of mass around the Object's pivot
|
||||
* (i.e. Object pivot is centralized in boundbox)
|
||||
* - boundbox gives full width
|
||||
* - assume that all quadrics are standing upright on local z-axis
|
||||
* - assume even distribution of mass around the Object's pivot
|
||||
* (i.e. Object pivot is centralized in boundbox)
|
||||
* - boundbox gives full width
|
||||
*/
|
||||
// XXX: all dimensions are auto-determined now... later can add stored settings for this
|
||||
BKE_object_dimensions_get(ob, size);
|
||||
|
@ -651,7 +651,7 @@ static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool
|
|||
float rot[4];
|
||||
|
||||
/* sanity checks:
|
||||
* - object doesn't have RigidBody info already: then why is it here?
|
||||
* - object doesn't have RigidBody info already: then why is it here?
|
||||
*/
|
||||
if (rbo == NULL)
|
||||
return;
|
||||
|
@ -783,8 +783,8 @@ static void rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, b
|
|||
float ang_upper;
|
||||
|
||||
/* sanity checks:
|
||||
* - object should have a rigid body constraint
|
||||
* - rigid body constraint should have at least one constrained object
|
||||
* - object should have a rigid body constraint
|
||||
* - rigid body constraint should have at least one constrained object
|
||||
*/
|
||||
if (rbc == NULL) {
|
||||
return;
|
||||
|
@ -944,8 +944,8 @@ RigidBodyWorld *BKE_rigidbody_create_world(Scene *scene)
|
|||
RigidBodyWorld *rbw;
|
||||
|
||||
/* sanity checks
|
||||
* - there must be a valid scene to add world to
|
||||
* - there mustn't be a sim world using this group already
|
||||
* - there must be a valid scene to add world to
|
||||
* - there mustn't be a sim world using this group already
|
||||
*/
|
||||
if (scene == NULL)
|
||||
return NULL;
|
||||
|
@ -1025,9 +1025,9 @@ RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type)
|
|||
RigidBodyWorld *rbw = scene->rigidbody_world;
|
||||
|
||||
/* sanity checks
|
||||
* - rigidbody world must exist
|
||||
* - object must exist
|
||||
* - cannot add rigid body if it already exists
|
||||
* - rigidbody world must exist
|
||||
* - object must exist
|
||||
* - cannot add rigid body if it already exists
|
||||
*/
|
||||
if (ob == NULL || (ob->rigidbody_object != NULL))
|
||||
return NULL;
|
||||
|
@ -1081,9 +1081,9 @@ RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short ty
|
|||
RigidBodyWorld *rbw = scene->rigidbody_world;
|
||||
|
||||
/* sanity checks
|
||||
* - rigidbody world must exist
|
||||
* - object must exist
|
||||
* - cannot add constraint if it already exists
|
||||
* - rigidbody world must exist
|
||||
* - object must exist
|
||||
* - cannot add constraint if it already exists
|
||||
*/
|
||||
if (ob == NULL || (ob->rigidbody_constraint != NULL))
|
||||
return NULL;
|
||||
|
@ -1332,7 +1332,7 @@ static void rigidbody_update_sim_ob(Depsgraph *depsgraph, Scene *scene, RigidBod
|
|||
pd_point_from_loc(scene, eff_loc, eff_vel, 0, &epoint);
|
||||
|
||||
/* calculate net force of effectors, and apply to sim object
|
||||
* - we use 'central force' since apply force requires a "relative position" which we don't have...
|
||||
* - we use 'central force' since apply force requires a "relative position" which we don't have...
|
||||
*/
|
||||
BKE_effectors_apply(effectors, NULL, effector_weights, &epoint, eff_force, NULL);
|
||||
if (G.f & G_DEBUG)
|
||||
|
@ -1398,7 +1398,7 @@ static void rigidbody_update_simulation(Depsgraph *depsgraph, Scene *scene, Rigi
|
|||
if (rbo == NULL) {
|
||||
/* Since this object is included in the sim group but doesn't have
|
||||
* rigid body settings (perhaps it was added manually), add!
|
||||
* - assume object to be active? That is the default for newly added settings...
|
||||
* - assume object to be active? That is the default for newly added settings...
|
||||
*/
|
||||
ob->rigidbody_object = BKE_rigidbody_create_object(scene, ob, RBO_TYPE_ACTIVE);
|
||||
rigidbody_validate_sim_object(rbw, ob, true);
|
||||
|
|
|
@ -1202,8 +1202,8 @@ static void do_mul_effect_byte(
|
|||
fac3 = (int)(256.0f * facf1);
|
||||
|
||||
/* formula:
|
||||
* fac * (a * b) + (1 - fac) * a => fac * a * (b - 1) + axaux = c * px + py * s; //+centx
|
||||
* yaux = -s * px + c * py; //+centy
|
||||
* fac * (a * b) + (1 - fac) * a => fac * a * (b - 1) + axaux = c * px + py * s; //+centx
|
||||
* yaux = -s * px + c * py; //+centy
|
||||
*/
|
||||
|
||||
while (y--) {
|
||||
|
|
|
@ -423,8 +423,8 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
|
|||
* Returns true if "hit" was updated.
|
||||
* Opts control whether an hit is valid or not
|
||||
* Supported options are:
|
||||
* MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored)
|
||||
* MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (back faces hits are ignored)
|
||||
* - MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored)
|
||||
* - MOD_SHRINKWRAP_CULL_TARGET_BACKFACE (back faces hits are ignored)
|
||||
*/
|
||||
bool BKE_shrinkwrap_project_normal(
|
||||
char options, const float vert[3], const float dir[3],
|
||||
|
|
|
@ -748,7 +748,7 @@ static int get_lamp(ViewLayer *view_layer, float *light)
|
|||
}
|
||||
|
||||
/**********************************************************
|
||||
* Obstacles
|
||||
* Obstacles
|
||||
**********************************************************/
|
||||
|
||||
typedef struct ObstaclesFromDMData {
|
||||
|
@ -1005,7 +1005,7 @@ static void update_obstacles(Depsgraph *depsgraph, Object *ob, SmokeDomainSettin
|
|||
}
|
||||
|
||||
/**********************************************************
|
||||
* Flow emission code
|
||||
* Flow emission code
|
||||
**********************************************************/
|
||||
|
||||
typedef struct EmissionMap {
|
||||
|
@ -1484,8 +1484,8 @@ static void sample_mesh(
|
|||
if (sfs->volume_density) {
|
||||
if (BLI_bvhtree_ray_cast(treeData->tree, ray_start, ray_dir, 0.0f, &hit, treeData->raycast_callback, treeData) != -1) {
|
||||
float dot = ray_dir[0] * hit.no[0] + ray_dir[1] * hit.no[1] + ray_dir[2] * hit.no[2];
|
||||
/* If ray and hit face normal are facing same direction
|
||||
* hit point is inside a closed mesh. */
|
||||
/* If ray and hit face normal are facing same direction
|
||||
* hit point is inside a closed mesh. */
|
||||
if (dot >= 0) {
|
||||
/* Also cast a ray in opposite direction to make sure
|
||||
* point is at least surrounded by two faces */
|
||||
|
@ -1800,7 +1800,7 @@ static void emit_from_mesh(Object *flow_ob, SmokeDomainSettings *sds, SmokeFlowS
|
|||
}
|
||||
|
||||
/**********************************************************
|
||||
* Smoke step
|
||||
* Smoke step
|
||||
**********************************************************/
|
||||
|
||||
static void adjustDomainResolution(SmokeDomainSettings *sds, int new_shift[3], EmissionMap *emaps, unsigned int numflowobj, float dt)
|
||||
|
|
|
@ -2119,7 +2119,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
|
|||
}/* existing spring list */
|
||||
}/*any edges*/
|
||||
/* ---springs */
|
||||
}/*omit on snap */
|
||||
}/*omit on snap */
|
||||
}/*loop all bp's*/
|
||||
return 0; /*done fine*/
|
||||
}
|
||||
|
@ -2469,7 +2469,7 @@ static void softbody_calc_forces(struct Depsgraph *depsgraph, Scene *scene, Obje
|
|||
}/* existing spring list */
|
||||
}/*any edges*/
|
||||
/* ---springs */
|
||||
}/*omit on snap */
|
||||
}/*omit on snap */
|
||||
}/*loop all bp's*/
|
||||
|
||||
|
||||
|
|
|
@ -2965,9 +2965,9 @@ int txt_setcurr_tab_spaces(Text *text, int space)
|
|||
}
|
||||
if (strstr(text->curl->line, word)) {
|
||||
/* if we find a ':' on this line, then add a tab but not if it is:
|
||||
* 1) in a comment
|
||||
* 2) within an identifier
|
||||
* 3) after the cursor (text->curc), i.e. when creating space before a function def [#25414]
|
||||
* 1) in a comment
|
||||
* 2) within an identifier
|
||||
* 3) after the cursor (text->curc), i.e. when creating space before a function def [#25414]
|
||||
*/
|
||||
int a;
|
||||
bool is_indent = false;
|
||||
|
|
|
@ -465,9 +465,9 @@ Tex *BKE_texture_copy(Main *bmain, const Tex *tex)
|
|||
Tex *BKE_texture_localize(Tex *tex)
|
||||
{
|
||||
/* TODO replace with something like
|
||||
* Tex *tex_copy;
|
||||
* BKE_id_copy_ex(bmain, &tex->id, (ID **)&tex_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
|
||||
* return tex_copy;
|
||||
* Tex *tex_copy;
|
||||
* BKE_id_copy_ex(bmain, &tex->id, (ID **)&tex_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
|
||||
* return tex_copy;
|
||||
*
|
||||
* ... Once f*** nodes are fully converted to that too :( */
|
||||
|
||||
|
|
|
@ -143,9 +143,9 @@ World *BKE_world_copy(Main *bmain, const World *wrld)
|
|||
World *BKE_world_localize(World *wrld)
|
||||
{
|
||||
/* TODO replace with something like
|
||||
* World *wrld_copy;
|
||||
* BKE_id_copy_ex(bmain, &wrld->id, (ID **)&wrld_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
|
||||
* return wrld_copy;
|
||||
* World *wrld_copy;
|
||||
* BKE_id_copy_ex(bmain, &wrld->id, (ID **)&wrld_copy, LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT, false);
|
||||
* return wrld_copy;
|
||||
*
|
||||
* ... Once f*** nodes are fully converted to that too :( */
|
||||
|
||||
|
|
|
@ -76,19 +76,19 @@ typedef struct DLRBT_Tree {
|
|||
/* Callback Types --------------------------------- */
|
||||
|
||||
/* return -1, 0, 1 for whether the given data is less than, equal to, or greater than the given node
|
||||
* - node: <DLRBT_Node> the node to compare to
|
||||
* - data: pointer to the relevant data or values stored in the bitpattern dependent on the function
|
||||
* - node: <DLRBT_Node> the node to compare to
|
||||
* - data: pointer to the relevant data or values stored in the bitpattern dependent on the function
|
||||
*/
|
||||
typedef short (*DLRBT_Comparator_FP)(void *node, void *data);
|
||||
|
||||
/* return a new node instance wrapping the given data
|
||||
* - data: pointer to the relevant data to create a subclass of node from
|
||||
* - data: pointer to the relevant data to create a subclass of node from
|
||||
*/
|
||||
typedef DLRBT_Node *(*DLRBT_NAlloc_FP)(void *data);
|
||||
|
||||
/* update an existing node instance accordingly to be in sync with the given data *
|
||||
* - node: <DLRBT_Node> the node to update
|
||||
* - data: pointer to the relevant data or values stored in the bitpattern dependent on the function
|
||||
* - node: <DLRBT_Node> the node to update
|
||||
* - data: pointer to the relevant data or values stored in the bitpattern dependent on the function
|
||||
*/
|
||||
typedef void (*DLRBT_NUpdate_FP)(void *node, void *data);
|
||||
|
||||
|
|
|
@ -28,23 +28,24 @@
|
|||
|
||||
/** \file BLI_math.h
|
||||
* \ingroup bli
|
||||
* \section mathabbrev Abbreviations
|
||||
*
|
||||
* - ``fl`` = float
|
||||
* - ``db`` = double
|
||||
* - ``v2`` = vec2 = vector 2
|
||||
* - ``v3`` = vec3 = vector 3
|
||||
* - ``v4`` = vec4 = vector 4
|
||||
* - ``vn`` = vec4 = vector N dimensions, *passed as an arg, after the vector*.
|
||||
* - ``qt`` = quat = quaternion
|
||||
* - ``dq`` = dquat = dual quaternion
|
||||
* - ``m2`` = mat2 = matrix 2x2
|
||||
* - ``m3`` = mat3 = matrix 3x3
|
||||
* - ``m4`` = mat4 = matrix 4x4
|
||||
* - ``eul`` = euler rotation
|
||||
* - ``eulO`` = euler with order
|
||||
* - ``plane`` = plane 4, (vec3, distance)
|
||||
* - ``plane3`` = plane 3 (same as a ``plane`` with a zero 4th component)
|
||||
* \section mathabbrev Abbreviations
|
||||
*
|
||||
* - ``fl`` = float
|
||||
* - ``db`` = double
|
||||
* - ``v2`` = vec2 = vector 2
|
||||
* - ``v3`` = vec3 = vector 3
|
||||
* - ``v4`` = vec4 = vector 4
|
||||
* - ``vn`` = vec4 = vector N dimensions, *passed as an arg, after the vector*.
|
||||
* - ``qt`` = quat = quaternion
|
||||
* - ``dq`` = dquat = dual quaternion
|
||||
* - ``m2`` = mat2 = matrix 2x2
|
||||
* - ``m3`` = mat3 = matrix 3x3
|
||||
* - ``m4`` = mat4 = matrix 4x4
|
||||
* - ``eul`` = euler rotation
|
||||
* - ``eulO`` = euler with order
|
||||
* - ``plane`` = plane 4, (vec3, distance)
|
||||
* - ``plane3`` = plane 3 (same as a ``plane`` with a zero 4th component)
|
||||
*
|
||||
* \subsection mathabbrev_all Function Type Abbreviations
|
||||
*
|
||||
|
@ -57,13 +58,13 @@
|
|||
* - ``_char`` = char
|
||||
* - ``_uchar`` = unsigned char
|
||||
*
|
||||
* \section mathvarnames Variable Names
|
||||
* \section mathvarnames Variable Names
|
||||
*
|
||||
* - f = single value
|
||||
* - a, b, c = vectors
|
||||
* - r = result vector
|
||||
* - A, B, C = matrices
|
||||
* - R = result matrix
|
||||
* - f = single value
|
||||
* - a, b, c = vectors
|
||||
* - r = result vector
|
||||
* - A, B, C = matrices
|
||||
* - R = result matrix
|
||||
*/
|
||||
|
||||
#include "BLI_math_base.h"
|
||||
|
|
|
@ -607,9 +607,9 @@ static int implicit_leafs_index(const BVHBuildHelper *data, const int depth, con
|
|||
* All tree types >= 2 are supported.
|
||||
*
|
||||
* Advantages of the used trees include:
|
||||
* - No need to store child/parent relations (they are implicit);
|
||||
* - Any node child always has an index greater than the parent;
|
||||
* - Brother nodes are sequential in memory;
|
||||
* - No need to store child/parent relations (they are implicit);
|
||||
* - Any node child always has an index greater than the parent;
|
||||
* - Brother nodes are sequential in memory;
|
||||
*
|
||||
*
|
||||
* Some math relations derived for general implicit trees:
|
||||
|
@ -633,9 +633,9 @@ static int implicit_needed_branches(int tree_type, int leafs)
|
|||
* This function handles the problem of "sorting" the leafs (along the split_axis).
|
||||
*
|
||||
* It arranges the elements in the given partitions such that:
|
||||
* - any element in partition N is less or equal to any element in partition N+1.
|
||||
* - if all elements are different all partition will get the same subset of elements
|
||||
* as if the array was sorted.
|
||||
* - any element in partition N is less or equal to any element in partition N+1.
|
||||
* - if all elements are different all partition will get the same subset of elements
|
||||
* as if the array was sorted.
|
||||
*
|
||||
* partition P is described as the elements in the range ( nth[P], nth[P+1] ]
|
||||
*
|
||||
|
@ -732,9 +732,9 @@ static void non_recursive_bvh_div_nodes_task_cb(
|
|||
/**
|
||||
* This functions builds an optimal implicit tree from the given leafs.
|
||||
* Where optimal stands for:
|
||||
* - The resulting tree will have the smallest number of branches;
|
||||
* - At most only one branch will have NULL childs;
|
||||
* - All leafs will be stored at level N or N+1.
|
||||
* - The resulting tree will have the smallest number of branches;
|
||||
* - At most only one branch will have NULL childs;
|
||||
* - All leafs will be stored at level N or N+1.
|
||||
*
|
||||
* This function creates an implicit tree on branches_array, the leafs are given on the leafs_array.
|
||||
*
|
||||
|
|
|
@ -102,8 +102,8 @@ static void linkedlist_sync_add_node(DLRBT_Tree *tree, DLRBT_Node *node)
|
|||
linkedlist_sync_add_node(tree, node->left);
|
||||
|
||||
/* now add self
|
||||
* - must remove detach from other links first
|
||||
* (for now, only clear own pointers)
|
||||
* - must remove detach from other links first
|
||||
* (for now, only clear own pointers)
|
||||
*/
|
||||
node->prev = node->next = NULL;
|
||||
BLI_addtail((ListBase *)tree, (Link *)node);
|
||||
|
|
|
@ -2212,11 +2212,11 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
|
|||
* negligible elements in the s and e arrays. On
|
||||
* completion the variables kase and k are set as follows.
|
||||
*
|
||||
* kase = 1 if s(p) and e[k - 1] are negligible and k<p
|
||||
* kase = 2 if s(k) is negligible and k<p
|
||||
* kase = 3 if e[k - 1] is negligible, k<p, and
|
||||
* s(k), ..., s(p) are not negligible (qr step).
|
||||
* kase = 4 if e(p - 1) is negligible (convergence). */
|
||||
* kase = 1: if s(p) and e[k - 1] are negligible and k<p
|
||||
* kase = 2: if s(k) is negligible and k<p
|
||||
* kase = 3: if e[k - 1] is negligible, k<p, and
|
||||
* s(k), ..., s(p) are not negligible (qr step).
|
||||
* kase = 4: if e(p - 1) is negligible (convergence). */
|
||||
|
||||
for (k = p - 2; k >= -1; k--) {
|
||||
if (k == -1) {
|
||||
|
|
|
@ -1477,7 +1477,7 @@ static const RotOrderInfo rotOrders[] = {
|
|||
|
||||
/* Get relevant pointer to rotation order set from the array
|
||||
* NOTE: since we start at 1 for the values, but arrays index from 0,
|
||||
* there is -1 factor involved in this process...
|
||||
* there is -1 factor involved in this process...
|
||||
*/
|
||||
static const RotOrderInfo *get_rotation_order_info(const short order)
|
||||
{
|
||||
|
|
|
@ -4596,12 +4596,12 @@ static void lib_link_mesh(FileData *fd, Main *main)
|
|||
/*
|
||||
* Re-tessellate, even if the polys were just created from tessfaces, this
|
||||
* is important because it:
|
||||
* - fill the CD_ORIGINDEX layer
|
||||
* - gives consistency of tessface between loading from a file and
|
||||
* converting an edited BMesh back into a mesh (i.e. it replaces
|
||||
* quad tessfaces in a loaded mesh immediately, instead of lazily
|
||||
* waiting until edit mode has been entered/exited, making it easier
|
||||
* to recognize problems that would otherwise only show up after edits).
|
||||
* - fill the CD_ORIGINDEX layer
|
||||
* - gives consistency of tessface between loading from a file and
|
||||
* converting an edited BMesh back into a mesh (i.e. it replaces
|
||||
* quad tessfaces in a loaded mesh immediately, instead of lazily
|
||||
* waiting until edit mode has been entered/exited, making it easier
|
||||
* to recognize problems that would otherwise only show up after edits).
|
||||
*/
|
||||
#ifdef USE_TESSFACE_DEFAULT
|
||||
BKE_mesh_tessface_calc(me);
|
||||
|
|
|
@ -188,7 +188,7 @@ BMesh *BM_mesh_create(
|
|||
/**
|
||||
* \brief BMesh Free Mesh Data
|
||||
*
|
||||
* Frees a BMesh structure.
|
||||
* Frees a BMesh structure.
|
||||
*
|
||||
* \note frees mesh, but not actual BMesh struct
|
||||
*/
|
||||
|
@ -297,7 +297,7 @@ void BM_mesh_clear(BMesh *bm)
|
|||
/**
|
||||
* \brief BMesh Free Mesh
|
||||
*
|
||||
* Frees a BMesh data and its structure.
|
||||
* Frees a BMesh data and its structure.
|
||||
*/
|
||||
void BM_mesh_free(BMesh *bm)
|
||||
{
|
||||
|
|
|
@ -792,7 +792,7 @@ bool BM_vert_edge_pair(BMVert *v, BMEdge **r_e_a, BMEdge **r_e_b)
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the number of edges around this vertex.
|
||||
* Returns the number of edges around this vertex.
|
||||
*/
|
||||
int BM_vert_edge_count(const BMVert *v)
|
||||
{
|
||||
|
@ -817,7 +817,7 @@ int BM_vert_edge_count_nonwire(const BMVert *v)
|
|||
return count;
|
||||
}
|
||||
/**
|
||||
* Returns the number of faces around this edge
|
||||
* Returns the number of faces around this edge
|
||||
*/
|
||||
int BM_edge_face_count(const BMEdge *e)
|
||||
{
|
||||
|
@ -1311,7 +1311,7 @@ bool BM_edge_share_face_check(BMEdge *e1, BMEdge *e2)
|
|||
}
|
||||
|
||||
/**
|
||||
* Test if e1 shares any quad faces with e2
|
||||
* Test if e1 shares any quad faces with e2
|
||||
*/
|
||||
bool BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2)
|
||||
{
|
||||
|
@ -1334,7 +1334,7 @@ bool BM_edge_share_quad_check(BMEdge *e1, BMEdge *e2)
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests to see if e1 shares a vertex with e2
|
||||
* Tests to see if e1 shares a vertex with e2
|
||||
*/
|
||||
bool BM_edge_share_vert_check(BMEdge *e1, BMEdge *e2)
|
||||
{
|
||||
|
@ -1345,7 +1345,7 @@ bool BM_edge_share_vert_check(BMEdge *e1, BMEdge *e2)
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the shared vertex between the two edges or NULL
|
||||
* Return the shared vertex between the two edges or NULL
|
||||
*/
|
||||
BMVert *BM_edge_share_vert(BMEdge *e1, BMEdge *e2)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "intern/bmesh_private.h"
|
||||
|
||||
/**
|
||||
* MISC utility functions.
|
||||
* MISC utility functions.
|
||||
*/
|
||||
|
||||
void bmesh_disk_vert_swap(BMEdge *e, BMVert *v_dst, BMVert *v_src)
|
||||
|
|
|
@ -190,10 +190,10 @@ void *BMW_current_state(BMWalker *walker)
|
|||
if (currentstate) {
|
||||
/* Automatic update of depth. For most walkers that
|
||||
* follow the standard "Step" pattern of:
|
||||
* - read current state
|
||||
* - remove current state
|
||||
* - push new states
|
||||
* - return walk result from just-removed current state
|
||||
* - read current state
|
||||
* - remove current state
|
||||
* - push new states
|
||||
* - return walk result from just-removed current state
|
||||
* this simple automatic update should keep track of depth
|
||||
* just fine. Walkers that deviate from that pattern may
|
||||
* need to manually update the depth if they care about
|
||||
|
|
|
@ -69,25 +69,26 @@ bool AnimationExporter::is_flat_line(std::vector<float> &values, int channel_cou
|
|||
* <source>, <sampler>, and <channel> entries.
|
||||
* This is is used for creating sampled Transformation Animations for either:
|
||||
*
|
||||
* 1-axis animation:
|
||||
* times contains the time points in seconds from within the timeline
|
||||
* values contains the data (list of single floats)
|
||||
* channel_count = 1
|
||||
* axis_name = ['X' | 'Y' | 'Z']
|
||||
* is_rot indicates if the animation is a rotation
|
||||
* 1-axis animation:
|
||||
* times contains the time points in seconds from within the timeline
|
||||
* values contains the data (list of single floats)
|
||||
* channel_count = 1
|
||||
* axis_name = ['X' | 'Y' | 'Z']
|
||||
* is_rot indicates if the animation is a rotation
|
||||
*
|
||||
* 3-axis animation:
|
||||
* times contains the time points in seconds from within the timeline
|
||||
* values contains the data (list of floats where each 3 entries are one vector)
|
||||
* channel_count = 3
|
||||
* axis_name = "" (actually not used)
|
||||
* is_rot = false (see xxx below)
|
||||
* 3-axis animation:
|
||||
* times contains the time points in seconds from within the timeline
|
||||
* values contains the data (list of floats where each 3 entries are one vector)
|
||||
* channel_count = 3
|
||||
* axis_name = "" (actually not used)
|
||||
* is_rot = false (see xxx below)
|
||||
*
|
||||
* xxx: I tried to create a 3 axis rotation animation
|
||||
* like for translation or scale. But i could not
|
||||
* figure out how to setup the channel for this case.
|
||||
* So for now rotations are exported as 3 separate 1-axis collada animations
|
||||
* See export_sampled_animation() further down.
|
||||
* xxx:
|
||||
* I tried to create a 3 axis rotation animation
|
||||
* like for translation or scale. But i could not
|
||||
* figure out how to setup the channel for this case.
|
||||
* So for now rotations are exported as 3 separate 1-axis collada animations
|
||||
* See export_sampled_animation() further down.
|
||||
*/
|
||||
void AnimationExporter::create_sampled_animation(int channel_count,
|
||||
std::vector<float> ×,
|
||||
|
@ -421,8 +422,8 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl
|
|||
bConstraintTarget *ct;
|
||||
Object *obtar;
|
||||
/* get targets
|
||||
* - constraints should use ct->matrix, not directly accessing values
|
||||
* - ct->matrix members have not yet been calculated here!
|
||||
* - constraints should use ct->matrix, not directly accessing values
|
||||
* - ct->matrix members have not yet been calculated here!
|
||||
*/
|
||||
cti->get_constraint_targets(con, &targets);
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_COMPOSITOR_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_DEFINES_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_CPUDevice.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_CPUDEVICE_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_ChunkOrder.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_CHUNKORDER_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_ChunkOrderHotspot.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_CHUNKORDERHOTSPOT_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_CompositorContext.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_COMPOSITORCONTEXT_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_CONVERTER_H__
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Lukas Toenne
|
||||
* Lukas Toenne
|
||||
*/
|
||||
|
||||
#include "COM_Debug.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Lukas Toenne
|
||||
* Lukas Toenne
|
||||
*/
|
||||
|
||||
#ifndef __COM_DEBUG_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_Device.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_DEVICE_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_EXECUTIONGROUP_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
class ExecutionGroup;
|
||||
|
@ -163,9 +163,9 @@ public:
|
|||
|
||||
/**
|
||||
* \brief execute this system
|
||||
* - initialize the NodeOperation's and ExecutionGroup's
|
||||
* - schedule the output ExecutionGroup's based on their priority
|
||||
* - deinitialize the ExecutionGroup's and NodeOperation's
|
||||
* - initialize the NodeOperation's and ExecutionGroup's
|
||||
* - schedule the output ExecutionGroup's based on their priority
|
||||
* - deinitialize the ExecutionGroup's and NodeOperation's
|
||||
*/
|
||||
void execute();
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_MemoryBuffer.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
class MemoryBuffer;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_MemoryProxy.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
class MemoryProxy;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_NODE_H__
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Lukas Toenne
|
||||
* Lukas Toenne
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Lukas Toenne
|
||||
* Lukas Toenne
|
||||
*/
|
||||
|
||||
#ifndef __COM_NODECONVERTER_H__
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Lukas Toenne
|
||||
* Lukas Toenne
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Lukas Toenne
|
||||
* Lukas Toenne
|
||||
*/
|
||||
|
||||
#ifndef __COM_NODEGRAPH_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include <typeinfo>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_NODEOPERATION_H__
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Lukas Toenne
|
||||
* Lukas Toenne
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Lukas Toenne
|
||||
* Lukas Toenne
|
||||
*/
|
||||
|
||||
#ifndef __COM_NODEOPERATIONBUILDER_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_OpenCLDevice.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
class OpenCLDevice;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_SingleThreadedOperation.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_SINGLETHREADEDOPERATION_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_SocketReader.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_SOCKETREADER_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_WorkPackage.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
class WorkPackage;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include <list>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_WORKSCHEDULER_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_AlphaOverNode.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#ifndef __COM_ALPHAOVERNODE_H__
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor:
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
* Jeroen Bakker
|
||||
* Monique Dewanchand
|
||||
*/
|
||||
|
||||
#include "COM_BilateralBlurNode.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue