style cleanup (mostly whitespace)
This commit is contained in:
parent
120297734b
commit
47c373c7a9
@ -233,17 +233,17 @@ bool BOP_intersect(const MT_Vector3& vL1, const MT_Point3& pL1, const MT_Vector3
|
||||
MT_Scalar den = (vL1.y()*vL2.x() - vL1.x() * vL2.y());
|
||||
|
||||
if (!BOP_fuzzyZero(den)) {
|
||||
t = (pL2.y()*vL1.x() - vL1.y()*pL2.x() + pL1.x()*vL1.y() - pL1.y()*vL1.x()) / den ;
|
||||
t = (pL2.y()*vL1.x() - vL1.y()*pL2.x() + pL1.x()*vL1.y() - pL1.y()*vL1.x()) / den;
|
||||
}
|
||||
else {
|
||||
den = (vL1.y()*vL2.z() - vL1.z() * vL2.y());
|
||||
if (!BOP_fuzzyZero(den)) {
|
||||
t = (pL2.y()*vL1.z() - vL1.y()*pL2.z() + pL1.z()*vL1.y() - pL1.y()*vL1.z()) / den ;
|
||||
t = (pL2.y()*vL1.z() - vL1.y()*pL2.z() + pL1.z()*vL1.y() - pL1.y()*vL1.z()) / den;
|
||||
}
|
||||
else {
|
||||
den = (vL1.x()*vL2.z() - vL1.z() * vL2.x());
|
||||
if (!BOP_fuzzyZero(den)) {
|
||||
t = (pL2.x()*vL1.z() - vL1.x()*pL2.z() + pL1.z()*vL1.x() - pL1.x()*vL1.z()) / den ;
|
||||
t = (pL2.x()*vL1.z() - vL1.x()*pL2.z() + pL1.z()*vL1.x() - pL1.x()*vL1.z()) / den;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
@ -289,7 +289,7 @@ void BOP_Merge2::cleanup( void )
|
||||
BOP_Indexs faces = (*edge)->getFaces();
|
||||
for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); ++face) {
|
||||
BOP_Face *f = m_mesh->getFace(*face);
|
||||
if(f->getTAG()== UNCLASSIFIED) ;
|
||||
if (f->getTAG()== UNCLASSIFIED);
|
||||
else (*edge)->removeFace(*face);
|
||||
}
|
||||
if( (*edge)->getFaces().size() == 0) (*edge)->setUsed(false);
|
||||
|
@ -108,11 +108,10 @@ public :
|
||||
|
||||
std::vector<BSP_MVertex> &
|
||||
VertexSet(
|
||||
) const ;
|
||||
|
||||
) const;
|
||||
std::vector<BSP_MFace> &
|
||||
FaceSet(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
std::vector<BSP_MEdge> &
|
||||
EdgeSet(
|
||||
|
@ -37,42 +37,42 @@
|
||||
class CTR_Link {
|
||||
public:
|
||||
CTR_Link(
|
||||
) ;
|
||||
);
|
||||
|
||||
CTR_Link(
|
||||
CTR_Link *next,
|
||||
CTR_Link *prev
|
||||
) ;
|
||||
);
|
||||
|
||||
CTR_Link *
|
||||
getNext(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
CTR_Link *
|
||||
getPrev(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
bool
|
||||
isHead(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
bool
|
||||
isTail(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
void
|
||||
insertBefore(
|
||||
CTR_Link *link
|
||||
) ;
|
||||
);
|
||||
|
||||
void
|
||||
insertAfter(
|
||||
CTR_Link *link
|
||||
) ;
|
||||
);
|
||||
|
||||
void
|
||||
remove(
|
||||
) ;
|
||||
);
|
||||
|
||||
private:
|
||||
CTR_Link *m_next;
|
||||
@ -83,25 +83,25 @@ class CTR_List {
|
||||
public:
|
||||
|
||||
CTR_List(
|
||||
) ;
|
||||
);
|
||||
|
||||
CTR_Link *
|
||||
getHead(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
CTR_Link *
|
||||
getTail(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
void
|
||||
addHead(
|
||||
CTR_Link *link
|
||||
) ;
|
||||
);
|
||||
|
||||
void
|
||||
addTail(
|
||||
CTR_Link *link
|
||||
) ;
|
||||
);
|
||||
|
||||
private:
|
||||
CTR_Link m_head;
|
||||
|
@ -122,7 +122,7 @@ private :
|
||||
MT_Vector3
|
||||
ComputeNormal(
|
||||
const LOD_TriFace &face
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
const
|
||||
MT_Vector3
|
||||
|
@ -128,7 +128,7 @@ private :
|
||||
MT_Vector3
|
||||
ComputeNormal(
|
||||
const LOD_TriFace &face
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
const
|
||||
MT_Vector3
|
||||
|
@ -76,11 +76,11 @@ public:
|
||||
|
||||
std::vector<LOD_Vertex> &
|
||||
VertexSet(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
std::vector<LOD_TriFace> &
|
||||
FaceSet(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
std::vector<LOD_Edge> &
|
||||
EdgeSet(
|
||||
|
@ -50,7 +50,7 @@ public :
|
||||
bool m_select_tag;
|
||||
|
||||
LOD_Vertex(
|
||||
) ;
|
||||
);
|
||||
|
||||
bool
|
||||
RemoveEdge(
|
||||
@ -109,13 +109,13 @@ public :
|
||||
LOD_FaceInd
|
||||
OpFace(
|
||||
LOD_FaceInd f
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
void
|
||||
SwapFace(
|
||||
LOD_FaceInd old_f,
|
||||
LOD_FaceInd new_f
|
||||
) ;
|
||||
);
|
||||
|
||||
|
||||
// return the half edge face - the half edge is defined
|
||||
@ -139,11 +139,11 @@ public :
|
||||
SwapVertex(
|
||||
LOD_VertexInd v_old,
|
||||
LOD_VertexInd v_new
|
||||
) ;
|
||||
);
|
||||
|
||||
bool
|
||||
SelectTag(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
void
|
||||
SetSelectTag(
|
||||
@ -157,7 +157,7 @@ public :
|
||||
void
|
||||
SetOpenTag(
|
||||
int tag
|
||||
) ;
|
||||
);
|
||||
|
||||
bool
|
||||
Degenerate(
|
||||
|
@ -494,7 +494,7 @@ extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
|
||||
* @param windowhandle The handle to the window
|
||||
* @return The validity of the window.
|
||||
*/
|
||||
extern int GHOST_GetValid(GHOST_WindowHandle windowhandle) ;
|
||||
extern int GHOST_GetValid(GHOST_WindowHandle windowhandle);
|
||||
|
||||
/**
|
||||
* Returns the type of drawing context used in this window.
|
||||
@ -592,7 +592,7 @@ extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
|
||||
GHOST_TInt32 inX,
|
||||
GHOST_TInt32 inY,
|
||||
GHOST_TInt32* outX,
|
||||
GHOST_TInt32* outY) ;
|
||||
GHOST_TInt32* outY);
|
||||
|
||||
/**
|
||||
* Converts a point in screen coordinates to client rectangle coordinates
|
||||
|
@ -47,7 +47,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef PREFIX
|
||||
static const char *static_path= PREFIX "/share" ;
|
||||
static const char *static_path= PREFIX "/share";
|
||||
#else
|
||||
static const char *static_path= NULL;
|
||||
#endif
|
||||
|
@ -716,7 +716,7 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
|
||||
GHOST_EventKey* event;
|
||||
|
||||
if (key != GHOST_kKeyUnknown) {
|
||||
char utf8_char[6] = {0} ;
|
||||
char utf8_char[6] = {0};
|
||||
char ascii = 0;
|
||||
|
||||
wchar_t utf16[2]={0};
|
||||
|
@ -174,7 +174,7 @@ public:
|
||||
GHOST_TSuccess
|
||||
getModifierKeys(
|
||||
GHOST_ModifierKeys& keys
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Returns the state of the mouse buttons (ouside the message queue).
|
||||
@ -310,7 +310,7 @@ private :
|
||||
GHOST_WindowX11 *
|
||||
findGhostWindow(
|
||||
Window xwind
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
void
|
||||
processEvent(
|
||||
|
@ -67,7 +67,7 @@ GHOST_WindowSDL::GHOST_WindowSDL(GHOST_SystemSDL *system,
|
||||
m_sdl_glcontext= SDL_GL_CreateContext(m_sdl_win);
|
||||
|
||||
//fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n",
|
||||
// theEvent->error_code, theEvent->request_code) ;
|
||||
// theEvent->error_code, theEvent->request_code);
|
||||
|
||||
setTitle(title);
|
||||
}
|
||||
|
@ -373,7 +373,7 @@ GHOST_WindowX11(
|
||||
XFree(xsizehints);
|
||||
|
||||
XClassHint * xclasshint = XAllocClassHint();
|
||||
int len = title.Length() +1 ;
|
||||
const int len = title.Length() + 1;
|
||||
char *wmclass = (char *)malloc(sizeof(char) * len);
|
||||
strncpy(wmclass, (const char*)title, sizeof(char) * len);
|
||||
xclasshint->res_name = wmclass;
|
||||
@ -485,10 +485,10 @@ GHOST_WindowX11(
|
||||
static int ApplicationErrorHandler(Display *display, XErrorEvent *theEvent)
|
||||
{
|
||||
fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n",
|
||||
theEvent->error_code, theEvent->request_code) ;
|
||||
theEvent->error_code, theEvent->request_code);
|
||||
|
||||
/* No exit! - but keep lint happy */
|
||||
return 0 ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* These C functions are copied from Wine 1.1.13's wintab.c */
|
||||
@ -588,7 +588,7 @@ static BOOL is_eraser(const char *name, const char *type)
|
||||
|
||||
void GHOST_WindowX11::initXInputDevices()
|
||||
{
|
||||
static XErrorHandler old_handler = (XErrorHandler) 0 ;
|
||||
static XErrorHandler old_handler = (XErrorHandler) 0;
|
||||
XExtensionVersion *version = XGetExtensionVersion(m_display, INAME);
|
||||
|
||||
if(version && (version != (XExtensionVersion*)NoSuchExtension)) {
|
||||
@ -600,7 +600,7 @@ void GHOST_WindowX11::initXInputDevices()
|
||||
m_xtablet.CommonData.Active= GHOST_kTabletModeNone;
|
||||
|
||||
/* Install our error handler to override Xlib's termination behavior */
|
||||
old_handler = XSetErrorHandler(ApplicationErrorHandler) ;
|
||||
old_handler = XSetErrorHandler(ApplicationErrorHandler);
|
||||
|
||||
for(int i=0; i<device_count; ++i) {
|
||||
char *device_type = device_info[i].type ? XGetAtomName(m_display, device_info[i].type) : NULL;
|
||||
@ -648,7 +648,7 @@ void GHOST_WindowX11::initXInputDevices()
|
||||
}
|
||||
|
||||
/* Restore handler */
|
||||
(void) XSetErrorHandler(old_handler) ;
|
||||
(void) XSetErrorHandler(old_handler);
|
||||
|
||||
XFreeDeviceList(device_info);
|
||||
|
||||
|
@ -146,7 +146,7 @@ public:
|
||||
|
||||
GHOST_TWindowState
|
||||
getState(
|
||||
) const ;
|
||||
) const;
|
||||
|
||||
GHOST_TSuccess
|
||||
setState(
|
||||
|
@ -118,7 +118,7 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* now corrupt a few blocks...*/
|
||||
ip = (int*) p[5] - 50 ;
|
||||
ip = (int*) p[5] - 50;
|
||||
for (i = 0; i< 1000; i++,ip++) *ip = i+1;
|
||||
ip = (int*) p[6];
|
||||
*(ip+10005) = 0;
|
||||
|
@ -836,8 +836,10 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
|
||||
tmp->f = 2;
|
||||
tmp->g = 1;
|
||||
}
|
||||
} else if (movie->streams[i].sh.Type == FCC("auds")) {
|
||||
;
|
||||
}
|
||||
else if (movie->streams[i].sh.Type == FCC("auds")) {
|
||||
// pass
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ void BKE_previewimg_free(struct PreviewImage **prv);
|
||||
void BKE_previewimg_free_id(struct ID *id);
|
||||
|
||||
/* create a new preview image */
|
||||
struct PreviewImage* BKE_previewimg_create(void) ;
|
||||
struct PreviewImage* BKE_previewimg_create(void);
|
||||
|
||||
/* create a copy of the preview image */
|
||||
struct PreviewImage* BKE_previewimg_copy(struct PreviewImage *prv);
|
||||
|
@ -343,7 +343,7 @@ struct bNode *nodeAddNode(struct bNodeTree *ntree, struct bNodeTemplate *ntemp);
|
||||
void nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
|
||||
void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node);
|
||||
|
||||
void nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype) ;
|
||||
void nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype);
|
||||
void nodeMakeDynamicType(struct bNode *node);
|
||||
int nodeDynamicUnlinkText(struct ID *txtid);
|
||||
|
||||
|
@ -2541,7 +2541,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
|
||||
}
|
||||
}
|
||||
}
|
||||
nr_tris_to_pile = nr_verts-2 ;
|
||||
nr_tris_to_pile = nr_verts - 2;
|
||||
if ( nr_tris_to_pile==1 || nr_tris_to_pile==2 )
|
||||
{
|
||||
const int indices[] = {offs+0, offs+1, offs+2, offs+0, offs+2, (offs+3)&0x3 };
|
||||
|
@ -1497,8 +1497,8 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
|
||||
/* Determine if the current frame is within the strip's range */
|
||||
length = strip->end-strip->start;
|
||||
actlength = strip->actend-strip->actstart;
|
||||
striptime = (scene_cfra-(strip->start)) / length;
|
||||
stripframe = (scene_cfra-(strip->start)) ;
|
||||
striptime = (scene_cfra - strip->start) / length;
|
||||
stripframe = (scene_cfra - strip->start);
|
||||
|
||||
if (striptime>=0.0) {
|
||||
|
||||
|
@ -1649,7 +1649,7 @@ int count_duplilist(Object *ob)
|
||||
for(; psys; psys=psys->next)
|
||||
pdup += psys->totpart;
|
||||
|
||||
if(pdup==0){
|
||||
if(pdup==0) {
|
||||
Mesh *me= ob->data;
|
||||
return me->totvert;
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ static void copy_bonechildren(Bone* newBone, Bone* oldBone, Bone* actBone, Bone
|
||||
|
||||
/* For each child in the list, update it's children */
|
||||
newChildBone = newBone->childbase.first;
|
||||
for (curBone = oldBone->childbase.first; curBone; curBone = curBone->next){
|
||||
for (curBone = oldBone->childbase.first; curBone; curBone = curBone->next) {
|
||||
newChildBone->parent = newBone;
|
||||
copy_bonechildren(newChildBone, curBone, actBone, newActBone);
|
||||
newChildBone = newChildBone->next;
|
||||
|
@ -45,7 +45,7 @@
|
||||
void
|
||||
CSG_DestroyMeshDescriptor(
|
||||
CSG_MeshDescriptor *mesh
|
||||
){
|
||||
) {
|
||||
// Call mesh descriptors destroy function....
|
||||
mesh->m_destroy_func(mesh);
|
||||
}
|
||||
@ -66,7 +66,7 @@ static
|
||||
void
|
||||
CSG_DestroyCSGMeshInternals(
|
||||
CSG_MeshDescriptor *mesh
|
||||
){
|
||||
) {
|
||||
CSG_FreeVertexDescriptor(&(mesh->m_vertex_iterator));
|
||||
CSG_FreeFaceDescriptor(&(mesh->m_face_iterator));
|
||||
}
|
||||
@ -102,7 +102,7 @@ MakeCSGMeshFromBlenderBase(
|
||||
CSG_LoadBlenderMesh(
|
||||
Object * obj,
|
||||
CSG_MeshDescriptor *output
|
||||
){
|
||||
) {
|
||||
|
||||
Mesh *me;
|
||||
if (output == NULL || obj == NULL) return 0;
|
||||
@ -132,7 +132,7 @@ CSG_LoadBlenderMesh(
|
||||
int
|
||||
CSG_AddMeshToBlender(
|
||||
CSG_MeshDescriptor *mesh
|
||||
){
|
||||
) {
|
||||
Mesh *me_new = NULL;
|
||||
Object *ob_new = NULL;
|
||||
float inv_mat[4][4];
|
||||
@ -172,7 +172,7 @@ CSG_PerformOp(
|
||||
CSG_MeshDescriptor *mesh2,
|
||||
int int_op_type,
|
||||
CSG_MeshDescriptor *output
|
||||
){
|
||||
) {
|
||||
|
||||
CSG_OperationType op_type;
|
||||
CSG_BooleanOperation * bool_op = CSG_NewBooleanFunction();
|
||||
@ -241,7 +241,7 @@ NewBooleanMeshTest(
|
||||
struct Base * base,
|
||||
struct Base * base_select,
|
||||
int op_type
|
||||
){
|
||||
) {
|
||||
|
||||
CSG_MeshDescriptor m1,m2,output;
|
||||
CSG_MeshDescriptor output2,output3;
|
||||
|
@ -118,7 +118,6 @@ static int cdDM_getNumTessFaces(DerivedMesh *dm)
|
||||
printf("%s: has no faces!, call DM_ensure_tessface() if you need them\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
return dm->numTessFaceData;
|
||||
}
|
||||
|
||||
@ -807,7 +806,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
|
||||
GPU_normal_setup( dm );
|
||||
GPU_uv_setup( dm );
|
||||
if( col != NULL ) {
|
||||
/*if( realcol && dm->drawObject->colType == CD_TEXTURE_MCOL ) {
|
||||
/*if( realcol && dm->drawObject->colType == CD_TEXTURE_MCOL ) {
|
||||
col = 0;
|
||||
} else if( mcol && dm->drawObject->colType == CD_MCOL ) {
|
||||
col = 0;
|
||||
|
@ -194,10 +194,10 @@ gsl_poly_solve_cubic (double a, double b, double c,
|
||||
|
||||
if (R == 0 && Q == 0)
|
||||
{
|
||||
*x0 = - a / 3 ;
|
||||
*x1 = - a / 3 ;
|
||||
*x2 = - a / 3 ;
|
||||
return 3 ;
|
||||
*x0 = - a / 3;
|
||||
*x1 = - a / 3;
|
||||
*x2 = - a / 3;
|
||||
return 3;
|
||||
}
|
||||
else if (CR2 == CQ3)
|
||||
{
|
||||
@ -222,7 +222,7 @@ gsl_poly_solve_cubic (double a, double b, double c,
|
||||
*x1 = - sqrtQ - a / 3;
|
||||
*x2 = 2 * sqrtQ - a / 3;
|
||||
}
|
||||
return 3 ;
|
||||
return 3;
|
||||
}
|
||||
else if (CR2 < CQ3) /* equivalent to R2 < Q3 */
|
||||
{
|
||||
@ -237,14 +237,14 @@ gsl_poly_solve_cubic (double a, double b, double c,
|
||||
/* Sort *x0, *x1, *x2 into increasing order */
|
||||
|
||||
if (*x0 > *x1)
|
||||
mySWAP(*x0, *x1) ;
|
||||
mySWAP(*x0, *x1);
|
||||
|
||||
if (*x1 > *x2)
|
||||
{
|
||||
mySWAP(*x1, *x2) ;
|
||||
mySWAP(*x1, *x2);
|
||||
|
||||
if (*x0 > *x1)
|
||||
mySWAP(*x0, *x1) ;
|
||||
mySWAP(*x0, *x1);
|
||||
}
|
||||
|
||||
return 3;
|
||||
@ -253,7 +253,7 @@ gsl_poly_solve_cubic (double a, double b, double c,
|
||||
{
|
||||
double sgnR = (R >= 0 ? 1 : -1);
|
||||
double A = -sgnR * pow (fabs (R) + sqrt (R2 - Q3), 1.0/3.0);
|
||||
double B = Q / A ;
|
||||
double B = Q / A;
|
||||
*x0 = A + B - a / 3;
|
||||
return 1;
|
||||
}
|
||||
@ -297,27 +297,27 @@ gsl_poly_solve_quadratic (double a, double b, double c,
|
||||
{
|
||||
double sgnb = (b > 0 ? 1 : -1);
|
||||
double temp = -0.5 * (b + sgnb * sqrt (disc));
|
||||
double r1 = temp / a ;
|
||||
double r2 = c / temp ;
|
||||
double r1 = temp / a;
|
||||
double r2 = c / temp;
|
||||
|
||||
if (r1 < r2)
|
||||
{
|
||||
*x0 = r1 ;
|
||||
*x1 = r2 ;
|
||||
*x0 = r1;
|
||||
*x1 = r2;
|
||||
}
|
||||
else
|
||||
{
|
||||
*x0 = r2 ;
|
||||
*x1 = r1 ;
|
||||
*x0 = r2;
|
||||
*x1 = r1;
|
||||
}
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
else if (disc == 0)
|
||||
{
|
||||
*x0 = -0.5 * b / a ;
|
||||
*x1 = -0.5 * b / a ;
|
||||
return 2 ;
|
||||
*x0 = -0.5 * b / a;
|
||||
*x1 = -0.5 * b / a;
|
||||
return 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ void defgroup_copy_list(ListBase *outbase, ListBase *inbase)
|
||||
|
||||
outbase->first= outbase->last= NULL;
|
||||
|
||||
for (defgroup = inbase->first; defgroup; defgroup=defgroup->next){
|
||||
for (defgroup = inbase->first; defgroup; defgroup=defgroup->next) {
|
||||
defgroupn= defgroup_duplicate(defgroup);
|
||||
BLI_addtail(outbase, defgroupn);
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Objec
|
||||
for(base = scene->base.first; base; base= base->next) {
|
||||
if((base->lay & ob->lay) && base->object->pd) {
|
||||
Object *ob1= base->object;
|
||||
if((ob1->pd->deflect || ob1->pd->forcefield) && (ob1 != ob)) {
|
||||
if((ob1->pd->deflect || ob1->pd->forcefield) && (ob1 != ob)) {
|
||||
node2 = dag_get_node(dag, ob1);
|
||||
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Field Collision");
|
||||
}
|
||||
@ -380,7 +380,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
|
||||
node->customdata_mask= 0;
|
||||
|
||||
if (ob->type == OB_ARMATURE) {
|
||||
if (ob->pose){
|
||||
if (ob->pose) {
|
||||
bPoseChannel *pchan;
|
||||
bConstraint *con;
|
||||
|
||||
@ -1421,7 +1421,8 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
|
||||
retval = 1;
|
||||
}
|
||||
// else if (itA->node->color == DAG_BLACK) { // cross or forward
|
||||
// ;
|
||||
//
|
||||
// }
|
||||
}
|
||||
itA = itA->next;
|
||||
}
|
||||
@ -1770,7 +1771,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
|
||||
if (node) {
|
||||
node = pop_queue(nqueue);
|
||||
if (node->ob == sce) // we are done
|
||||
break ;
|
||||
break;
|
||||
node->color = DAG_BLACK;
|
||||
|
||||
time++;
|
||||
@ -2068,7 +2069,7 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
|
||||
sce->theDag->time++; // so we know which nodes were accessed
|
||||
lasttime= sce->theDag->time;
|
||||
for(itA = firstnode->child; itA; itA= itA->next) {
|
||||
if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) {
|
||||
if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) {
|
||||
ob= (Object*)(itA->node->ob);
|
||||
|
||||
if(ob->recalc & OB_RECALC_ALL) {
|
||||
@ -2565,7 +2566,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
|
||||
}
|
||||
|
||||
if(idtype == ID_MC) {
|
||||
for(obt=bmain->object.first; obt; obt= obt->id.next){
|
||||
for(obt=bmain->object.first; obt; obt= obt->id.next) {
|
||||
bConstraint *con;
|
||||
for (con = obt->constraints.first; con; con=con->next) {
|
||||
bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
|
||||
@ -2890,7 +2891,7 @@ void DAG_pose_sort(Object *ob)
|
||||
if (node) {
|
||||
node = pop_queue(nqueue);
|
||||
if (node->ob == NULL) // we are done
|
||||
break ;
|
||||
break;
|
||||
node->color = DAG_BLACK;
|
||||
|
||||
/* put node in new list */
|
||||
|
@ -1110,7 +1110,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
|
||||
if(forRender || nu->hide==0) {
|
||||
int resolu= nu->resolu, resolv= nu->resolv;
|
||||
|
||||
if(forRender){
|
||||
if(forRender) {
|
||||
if(cu->resolu_ren) resolu= cu->resolu_ren;
|
||||
if(cu->resolv_ren) resolv= cu->resolv_ren;
|
||||
}
|
||||
|
@ -4161,7 +4161,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
|
||||
/*
|
||||
* Spread Effect
|
||||
*/
|
||||
if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) {
|
||||
if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) {
|
||||
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 */
|
||||
@ -4204,7 +4204,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
|
||||
/*
|
||||
* Shrink Effect
|
||||
*/
|
||||
if (surface->effect & MOD_DPAINT_EFFECT_DO_SHRINK) {
|
||||
if (surface->effect & MOD_DPAINT_EFFECT_DO_SHRINK) {
|
||||
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 */
|
||||
|
@ -508,7 +508,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU
|
||||
falloff=0.0f;
|
||||
else if(eff->pd->zdir == PFIELD_Z_NEG && fac > 0.0f)
|
||||
falloff=0.0f;
|
||||
else switch(eff->pd->falloff){
|
||||
else switch(eff->pd->falloff) {
|
||||
case PFIELD_FALL_SPHERE:
|
||||
falloff*= falloff_func_dist(eff->pd, efd->distance);
|
||||
break;
|
||||
@ -610,8 +610,9 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
|
||||
ParticleKey state;
|
||||
|
||||
/* exclude the particle itself for self effecting particles */
|
||||
if(eff->psys == point->psys && *efd->index == point->index)
|
||||
;
|
||||
if(eff->psys == point->psys && *efd->index == point->index) {
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
ParticleSimulationData sim= {NULL};
|
||||
sim.scene= eff->scene;
|
||||
@ -809,7 +810,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
|
||||
}
|
||||
}
|
||||
|
||||
if(eff->pd->flag & PFIELD_TEX_2D){
|
||||
if(eff->pd->flag & PFIELD_TEX_2D) {
|
||||
float fac = -dot_v3v3(force, efd->nor);
|
||||
madd_v3_v3fl(force, efd->nor, fac);
|
||||
}
|
||||
@ -836,7 +837,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
|
||||
|
||||
copy_v3_v3(force, efd->vec_to_point);
|
||||
|
||||
switch(pd->forcefield){
|
||||
switch(pd->forcefield) {
|
||||
case PFIELD_WIND:
|
||||
copy_v3_v3(force, efd->nor);
|
||||
mul_v3_fl(force, strength * efd->falloff);
|
||||
@ -1000,7 +1001,7 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
|
||||
do_physical_effector(eff, &efd, point, force);
|
||||
|
||||
// for softbody backward compatibility
|
||||
if(point->flag & PE_WIND_AS_SPEED && impulse){
|
||||
if(point->flag & PE_WIND_AS_SPEED && impulse) {
|
||||
sub_v3_v3v3(temp2, force, temp1);
|
||||
sub_v3_v3v3(impulse, impulse, temp2);
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue),
|
||||
* 2) if before first frame or after last frame, make sure some cycling is in use
|
||||
*/
|
||||
if (evaltime < prevkey[0]) {
|
||||
if (data->before_mode) {
|
||||
if (data->before_mode) {
|
||||
side= -1;
|
||||
mode= data->before_mode;
|
||||
cycles= data->before_cycles;
|
||||
|
@ -333,7 +333,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
|
||||
nu2->flagu = CU_NURB_CYCLIC;
|
||||
|
||||
bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint),"underline_bp");
|
||||
if (bp == NULL){
|
||||
if (bp == NULL) {
|
||||
MEM_freeN(nu2);
|
||||
return;
|
||||
}
|
||||
@ -399,7 +399,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
|
||||
while(nu1)
|
||||
{
|
||||
bezt1 = nu1->bezt;
|
||||
if (bezt1){
|
||||
if (bezt1) {
|
||||
nu2 =(Nurb*) MEM_mallocN(sizeof(Nurb),"duplichar_nurb");
|
||||
if (nu2 == NULL) break;
|
||||
memcpy(nu2, nu1, sizeof(struct Nurb));
|
||||
@ -419,7 +419,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
|
||||
i = nu2->pntsu;
|
||||
|
||||
bezt2 = (BezTriple*)MEM_mallocN(i * sizeof(BezTriple),"duplichar_bezt2");
|
||||
if (bezt2 == NULL){
|
||||
if (bezt2 == NULL) {
|
||||
MEM_freeN(nu2);
|
||||
break;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ void unlink_group(Group *group)
|
||||
#endif
|
||||
}
|
||||
|
||||
for(psys=ob->particlesystem.first; psys; psys=psys->next){
|
||||
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
|
||||
if(psys->part->dup_group==group)
|
||||
psys->part->dup_group= NULL;
|
||||
#if 0 /* not used anymore, only keps for readfile.c, no need to account for this */
|
||||
|
@ -263,7 +263,7 @@ int BKE_icon_getid(struct ID* id)
|
||||
|
||||
id->icon_id = get_next_free_id();
|
||||
|
||||
if (!id->icon_id){
|
||||
if (!id->icon_id) {
|
||||
printf("BKE_icon_getid: Internal error - not enough IDs\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, IDProperty *src)
|
||||
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
|
||||
{
|
||||
IDProperty *loop;
|
||||
if((loop= IDP_GetPropertyFromGroup(group, prop->name))) {
|
||||
if ((loop= IDP_GetPropertyFromGroup(group, prop->name))) {
|
||||
BLI_insertlink(&group->data.group, loop, prop);
|
||||
|
||||
BLI_remlink(&group->data.group, loop);
|
||||
@ -506,7 +506,7 @@ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
|
||||
or 1 if it succeeded in adding to the group.*/
|
||||
int IDP_AddToGroup(IDProperty *group, IDProperty *prop)
|
||||
{
|
||||
if(IDP_GetPropertyFromGroup(group, prop->name) == NULL) {
|
||||
if (IDP_GetPropertyFromGroup(group, prop->name) == NULL) {
|
||||
group->len++;
|
||||
BLI_addtail(&group->data.group, prop);
|
||||
return 1;
|
||||
@ -517,7 +517,7 @@ int IDP_AddToGroup(IDProperty *group, IDProperty *prop)
|
||||
|
||||
int IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew)
|
||||
{
|
||||
if(IDP_GetPropertyFromGroup(group, pnew->name) == NULL) {
|
||||
if (IDP_GetPropertyFromGroup(group, pnew->name) == NULL) {
|
||||
group->len++;
|
||||
BLI_insertlink(&group->data.group, previous, pnew);
|
||||
return 1;
|
||||
|
@ -1122,11 +1122,11 @@ int BKE_add_image_extension(char *string, const char imtype)
|
||||
}
|
||||
#endif
|
||||
#ifdef WITH_CINEON
|
||||
else if(imtype==R_IMF_IMTYPE_CINEON){
|
||||
else if(imtype==R_IMF_IMTYPE_CINEON) {
|
||||
if (!BLI_testextensie(string, ".cin"))
|
||||
extension= ".cin";
|
||||
}
|
||||
else if(imtype==R_IMF_IMTYPE_DPX){
|
||||
else if(imtype==R_IMF_IMTYPE_DPX) {
|
||||
if (!BLI_testextensie(string, ".dpx"))
|
||||
extension= ".dpx";
|
||||
}
|
||||
|
@ -1697,7 +1697,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
|
||||
while(search)
|
||||
{
|
||||
// only handle active springs
|
||||
// if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)){}
|
||||
// if(((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) && !(springs[i].flags & CSPRING_FLAG_DEACTIVATE))|| !(clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED)) {}
|
||||
cloth_calc_spring_force(clmd, search->link, lF, lX, lV, dFdV, dFdX, time);
|
||||
|
||||
search = search->next;
|
||||
|
@ -1329,7 +1329,7 @@ static void lib_indirect_test_id(ID *id, Library *lib)
|
||||
// XXX old animation system! --------------------------------------
|
||||
{
|
||||
bActionStrip *strip;
|
||||
for (strip=ob->nlastrips.first; strip; strip=strip->next){
|
||||
for (strip=ob->nlastrips.first; strip; strip=strip->next) {
|
||||
LIBTAG(strip->object);
|
||||
LIBTAG(strip->act);
|
||||
LIBTAG(strip->ipo);
|
||||
|
@ -233,13 +233,13 @@ int BKE_mesh_validate_arrays( Mesh *me,
|
||||
if(remove == FALSE) {
|
||||
if(mf->v4) {
|
||||
if(mf->v1 == mf->v2) { PRINT(" face %u: verts invalid, v1/v2 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||
if(mf->v1 == mf->v3) { PRINT(" face %u: verts invalid, v1/v3 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||
if(mf->v1 == mf->v4) { PRINT(" face %u: verts invalid, v1/v4 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||
if(mf->v1 == mf->v3) { PRINT(" face %u: verts invalid, v1/v3 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||
if(mf->v1 == mf->v4) { PRINT(" face %u: verts invalid, v1/v4 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||
|
||||
if(mf->v2 == mf->v3) { PRINT(" face %u: verts invalid, v2/v3 both %u\n", i, mf->v2); remove= do_fixes; }
|
||||
if(mf->v2 == mf->v4) { PRINT(" face %u: verts invalid, v2/v4 both %u\n", i, mf->v2); remove= do_fixes; }
|
||||
if(mf->v2 == mf->v3) { PRINT(" face %u: verts invalid, v2/v3 both %u\n", i, mf->v2); remove= do_fixes; }
|
||||
if(mf->v2 == mf->v4) { PRINT(" face %u: verts invalid, v2/v4 both %u\n", i, mf->v2); remove= do_fixes; }
|
||||
|
||||
if(mf->v3 == mf->v4) { PRINT(" face %u: verts invalid, v3/v4 both %u\n", i, mf->v3); remove= do_fixes; }
|
||||
if(mf->v3 == mf->v4) { PRINT(" face %u: verts invalid, v3/v4 both %u\n", i, mf->v3); remove= do_fixes; }
|
||||
}
|
||||
else {
|
||||
if(mf->v1 == mf->v2) { PRINT(" faceT %u: verts invalid, v1/v2 both %u\n", i, mf->v1); remove= do_fixes; }
|
||||
|
@ -1073,7 +1073,7 @@ void BKE_nlastrip_set_active (AnimData *adt, NlaStrip *strip)
|
||||
|
||||
/* loop over tracks, deactivating*/
|
||||
for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) {
|
||||
for (nls= nlt->strips.first; nls; nls= nls->next) {
|
||||
for (nls= nlt->strips.first; nls; nls= nls->next) {
|
||||
if (nls != strip)
|
||||
nls->flag &= ~NLASTRIP_FLAG_ACTIVE;
|
||||
else
|
||||
|
@ -422,7 +422,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
|
||||
{
|
||||
if (oc->_do_disp_y)
|
||||
{
|
||||
ocr->disp[1] = INTERP(oc->_disp_y) ;
|
||||
ocr->disp[1] = INTERP(oc->_disp_y);
|
||||
}
|
||||
if (oc->_do_normals)
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ ParticleSystem *psys_get_current(Object *ob)
|
||||
ParticleSystem *psys;
|
||||
if(ob==NULL) return NULL;
|
||||
|
||||
for(psys=ob->particlesystem.first; psys; psys=psys->next){
|
||||
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
|
||||
if(psys->flag & PSYS_CURRENT)
|
||||
return psys;
|
||||
}
|
||||
@ -219,12 +219,12 @@ Object *psys_get_lattice(ParticleSimulationData *sim)
|
||||
{
|
||||
Object *lattice=NULL;
|
||||
|
||||
if(psys_in_edit_mode(sim->scene, sim->psys)==0){
|
||||
if(psys_in_edit_mode(sim->scene, sim->psys)==0) {
|
||||
|
||||
ModifierData *md = (ModifierData*)psys_get_modifier(sim->ob, sim->psys);
|
||||
|
||||
for(; md; md=md->next){
|
||||
if(md->type==eModifierType_Lattice){
|
||||
for(; md; md=md->next) {
|
||||
if(md->type==eModifierType_Lattice) {
|
||||
LatticeModifierData *lmd = (LatticeModifierData *)md;
|
||||
lattice=lmd->object;
|
||||
break;
|
||||
@ -523,7 +523,7 @@ void psys_free_pdd(ParticleSystem *psys)
|
||||
/* free everything */
|
||||
void psys_free(Object *ob, ParticleSystem * psys)
|
||||
{
|
||||
if(psys){
|
||||
if(psys) {
|
||||
int nr = 0;
|
||||
ParticleSystem * tpsys;
|
||||
|
||||
@ -536,14 +536,14 @@ void psys_free(Object *ob, ParticleSystem * psys)
|
||||
if(psys->edit && psys->free_edit)
|
||||
psys->free_edit(psys->edit);
|
||||
|
||||
if(psys->child){
|
||||
if(psys->child) {
|
||||
MEM_freeN(psys->child);
|
||||
psys->child = NULL;
|
||||
psys->totchild = 0;
|
||||
}
|
||||
|
||||
// check if we are last non-visible particle system
|
||||
for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next){
|
||||
for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next) {
|
||||
if(tpsys->part)
|
||||
{
|
||||
if(ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR))
|
||||
@ -557,7 +557,7 @@ void psys_free(Object *ob, ParticleSystem * psys)
|
||||
if(!nr)
|
||||
ob->transflag &= ~OB_DUPLIPARTS;
|
||||
|
||||
if(psys->part){
|
||||
if(psys->part) {
|
||||
psys->part->id.us--;
|
||||
psys->part=NULL;
|
||||
}
|
||||
@ -744,7 +744,7 @@ void psys_render_restore(Object *ob, ParticleSystem *psys)
|
||||
|
||||
psys_free_path_cache(psys, NULL);
|
||||
|
||||
if(psys->child){
|
||||
if(psys->child) {
|
||||
MEM_freeN(psys->child);
|
||||
psys->child= 0;
|
||||
psys->totchild= 0;
|
||||
@ -1029,10 +1029,10 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic
|
||||
|
||||
interp_v3_v3v3v3v3(result->co, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t);
|
||||
|
||||
if(velocity){
|
||||
if(velocity) {
|
||||
float temp[3];
|
||||
|
||||
if(dt>0.999f){
|
||||
if(dt>0.999f) {
|
||||
key_curve_position_weights(dt-0.001f, t, type);
|
||||
interp_v3_v3v3v3v3(temp, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t);
|
||||
sub_v3_v3v3(result->vel, result->co, temp);
|
||||
@ -1351,7 +1351,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
|
||||
keytime = (real_t - keys[1].time) / dfra;
|
||||
|
||||
/* convert velocity to timestep size */
|
||||
if(pind->keyed || pind->cache || point_vel){
|
||||
if(pind->keyed || pind->cache || point_vel) {
|
||||
invdt = dfra * 0.04f * (psys ? psys->part->timetweak : 1.f);
|
||||
mul_v3_fl(keys[1].vel, invdt);
|
||||
mul_v3_fl(keys[2].vel, invdt);
|
||||
@ -1424,7 +1424,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
|
||||
|
||||
interp_v3_v3v3v3v3(vec, v1, v2, v3, v4, w);
|
||||
|
||||
if(nor){
|
||||
if(nor) {
|
||||
if(mface->flag & ME_SMOOTH)
|
||||
interp_v3_v3v3v3v3(nor, n1, n2, n3, n4, w);
|
||||
else
|
||||
@ -1434,7 +1434,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
|
||||
else {
|
||||
interp_v3_v3v3v3(vec, v1, v2, v3, w);
|
||||
|
||||
if(nor){
|
||||
if(nor) {
|
||||
if(mface->flag & ME_SMOOTH)
|
||||
interp_v3_v3v3v3(nor, n1, n2, n3, w);
|
||||
else
|
||||
@ -1443,8 +1443,8 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
|
||||
}
|
||||
|
||||
/* calculate tangent vectors */
|
||||
if(utan && vtan){
|
||||
if(tface){
|
||||
if(utan && vtan) {
|
||||
if(tface) {
|
||||
uv1= tface->uv[0];
|
||||
uv2= tface->uv[1];
|
||||
uv3= tface->uv[2];
|
||||
@ -1459,7 +1459,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
|
||||
map_to_sphere( uv4, uv4+1,v4[0], v4[1], v4[2]);
|
||||
}
|
||||
|
||||
if(v4){
|
||||
if(v4) {
|
||||
s1= uv3[0] - uv1[0];
|
||||
s2= uv4[0] - uv1[0];
|
||||
|
||||
@ -1570,7 +1570,7 @@ static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int
|
||||
if(values==0 || index==-1)
|
||||
return 0.0;
|
||||
|
||||
switch(from){
|
||||
switch(from) {
|
||||
case PART_FROM_VERT:
|
||||
return values[index];
|
||||
case PART_FROM_FACE:
|
||||
@ -1824,10 +1824,10 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys)
|
||||
ModifierData *md;
|
||||
ParticleSystemModifierData *psmd;
|
||||
|
||||
for(md=ob->modifiers.first; md; md=md->next){
|
||||
if(md->type==eModifierType_ParticleSystem){
|
||||
for(md=ob->modifiers.first; md; md=md->next) {
|
||||
if(md->type==eModifierType_ParticleSystem) {
|
||||
psmd= (ParticleSystemModifierData*) md;
|
||||
if(psmd->psys==psys){
|
||||
if(psmd->psys==psys) {
|
||||
return psmd;
|
||||
}
|
||||
}
|
||||
@ -1842,22 +1842,22 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *
|
||||
{
|
||||
/* TODO */
|
||||
float zerovec[3]={0.0f,0.0f,0.0f};
|
||||
if(vec){
|
||||
if(vec) {
|
||||
copy_v3_v3(vec,zerovec);
|
||||
}
|
||||
if(nor){
|
||||
if(nor) {
|
||||
copy_v3_v3(nor,zerovec);
|
||||
}
|
||||
if(utan){
|
||||
if(utan) {
|
||||
copy_v3_v3(utan,zerovec);
|
||||
}
|
||||
if(vtan){
|
||||
if(vtan) {
|
||||
copy_v3_v3(vtan,zerovec);
|
||||
}
|
||||
if(orco){
|
||||
if(orco) {
|
||||
copy_v3_v3(orco,zerovec);
|
||||
}
|
||||
if(ornor){
|
||||
if(ornor) {
|
||||
copy_v3_v3(ornor,zerovec);
|
||||
}
|
||||
}
|
||||
@ -1866,8 +1866,8 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *
|
||||
/************************************************/
|
||||
void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
|
||||
{
|
||||
if(psmd){
|
||||
if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT){
|
||||
if(psmd) {
|
||||
if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT) {
|
||||
if(vec)
|
||||
copy_v3_v3(vec,fuv);
|
||||
|
||||
@ -2007,13 +2007,13 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
|
||||
inp_y=dot_v3v3(y_vec, vec_one);
|
||||
inp_z=dot_v3v3(z_vec, vec_one);
|
||||
|
||||
if(inp_y > 0.5f){
|
||||
if(inp_y > 0.5f) {
|
||||
copy_v3_v3(state_co, y_vec);
|
||||
|
||||
mul_v3_fl(y_vec, amplitude*(float)cos(t));
|
||||
mul_v3_fl(z_vec, amplitude/2.f*(float)sin(2.f*t));
|
||||
}
|
||||
else if(inp_z > 0.0f){
|
||||
else if(inp_z > 0.0f) {
|
||||
mul_v3_v3fl(state_co, z_vec, (float)sin((float)M_PI/3.f));
|
||||
madd_v3_v3fl(state_co, y_vec, -0.5f);
|
||||
|
||||
@ -2041,7 +2041,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
|
||||
|
||||
shape = 2.f*(float)M_PI * (1.f+shape);
|
||||
|
||||
if(t<shape){
|
||||
if(t<shape) {
|
||||
shape = t/shape;
|
||||
shape = (float)sqrt((double)shape);
|
||||
interp_v3_v3v3(result, result, state_co, shape);
|
||||
@ -2064,7 +2064,7 @@ static float do_clump(ParticleKey *state, ParticleKey *par, float time, float cl
|
||||
{
|
||||
float clump = 0.f;
|
||||
|
||||
if(par && clumpfac!=0.0f){
|
||||
if(par && clumpfac!=0.0f) {
|
||||
float cpow;
|
||||
|
||||
if(clumppow < 0.0f)
|
||||
@ -2208,7 +2208,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
|
||||
totstrength *= weight;
|
||||
}
|
||||
|
||||
if(totstrength != 0.0f){
|
||||
if(totstrength != 0.0f) {
|
||||
if(totstrength > 1.0f)
|
||||
mul_v3_fl(effect, 1.0f / totstrength);
|
||||
CLAMP(totstrength, 0.0f, 1.0f);
|
||||
@ -2287,7 +2287,7 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK
|
||||
}
|
||||
static int check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *state, float max_length, float *cur_length, float length, float *dvec)
|
||||
{
|
||||
if(*cur_length + length > max_length){
|
||||
if(*cur_length + length > max_length) {
|
||||
mul_v3_fl(dvec, (max_length - *cur_length) / length);
|
||||
add_v3_v3v3(state->co, (state - 1)->co, dvec);
|
||||
keys->steps = k;
|
||||
@ -2325,12 +2325,12 @@ float *psys_cache_vgroup(DerivedMesh *dm, ParticleSystem *psys, int vgroup)
|
||||
/* hair dynamics pinning vgroup */
|
||||
|
||||
}
|
||||
else if(psys->vgroup[vgroup]){
|
||||
else if(psys->vgroup[vgroup]) {
|
||||
MDeformVert *dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
|
||||
if(dvert){
|
||||
if(dvert) {
|
||||
int totvert=dm->getNumVerts(dm), i;
|
||||
vg=MEM_callocN(sizeof(float)*totvert, "vg_cache");
|
||||
if(psys->vg_neg&(1<<vgroup)){
|
||||
if(psys->vg_neg&(1<<vgroup)) {
|
||||
for(i=0; i<totvert; i++)
|
||||
vg[i]= 1.0f - defvert_find_weight(&dvert[i], psys->vgroup[vgroup] - 1);
|
||||
}
|
||||
@ -2357,14 +2357,14 @@ void psys_find_parents(ParticleSimulationData *sim)
|
||||
|
||||
tree=BLI_kdtree_new(totparent);
|
||||
|
||||
for(p=0,cpa=sim->psys->child; p<totparent; p++,cpa++){
|
||||
for(p=0,cpa=sim->psys->child; p<totparent; p++,cpa++) {
|
||||
psys_particle_on_emitter(sim->psmd,from,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,0,0,0,orco,0);
|
||||
BLI_kdtree_insert(tree, p, orco, NULL);
|
||||
}
|
||||
|
||||
BLI_kdtree_balance(tree);
|
||||
|
||||
for(; p<totchild; p++,cpa++){
|
||||
for(; p<totchild; p++,cpa++) {
|
||||
psys_particle_on_emitter(sim->psmd,from,cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,co,0,0,0,orco,0);
|
||||
cpa->parent=BLI_kdtree_find_nearest(tree, orco, NULL, NULL);
|
||||
}
|
||||
@ -2426,7 +2426,7 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c
|
||||
steps = (int)pow(2.0, (double)pset->draw_step);
|
||||
}
|
||||
|
||||
if(totchild && part->childtype==PART_CHILD_FACES){
|
||||
if(totchild && part->childtype==PART_CHILD_FACES) {
|
||||
totparent=(int)(totchild*part->parents*0.3f);
|
||||
|
||||
if(G.rendering && part->child_nbr && part->ren_child_nbr)
|
||||
@ -2479,7 +2479,7 @@ static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float c
|
||||
|
||||
/* set correct ipo timing */
|
||||
#if 0 // XXX old animation system
|
||||
if(part->flag&PART_ABS_TIME && part->ipo){
|
||||
if(part->flag&PART_ABS_TIME && part->ipo) {
|
||||
calc_ipo(part->ipo, cfra);
|
||||
execute_ipo((ID *)part, part->ipo);
|
||||
}
|
||||
@ -2509,7 +2509,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
|
||||
if(!pcache)
|
||||
return;
|
||||
|
||||
if(ctx->between){
|
||||
if(ctx->between) {
|
||||
ParticleData *pa = psys->particles + cpa->pa[0];
|
||||
int w, needupdate;
|
||||
float foffset, wsum=0.f;
|
||||
@ -2638,8 +2638,8 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
|
||||
}
|
||||
|
||||
/* create the child path */
|
||||
for(k=0,child=child_keys; k<=ctx->steps; k++,child++){
|
||||
if(ctx->between){
|
||||
for(k=0,child=child_keys; k<=ctx->steps; k++,child++) {
|
||||
if(ctx->between) {
|
||||
int w=0;
|
||||
|
||||
zero_v3(child->co);
|
||||
@ -2696,7 +2696,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
|
||||
}
|
||||
}
|
||||
|
||||
for(k=0,child=child_keys; k<=ctx->steps; k++,child++){
|
||||
for(k=0,child=child_keys; k<=ctx->steps; k++,child++) {
|
||||
t = (float)k/(float)ctx->steps;
|
||||
|
||||
if(ctx->totparent)
|
||||
@ -2720,7 +2720,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
|
||||
do_child_modifiers(&ctx->sim, &ptex, (ParticleKey *)par, par_rot, cpa, orco, hairmat, (ParticleKey *)child, t);
|
||||
|
||||
/* we have to correct velocity because of kink & clump */
|
||||
if(k>1){
|
||||
if(k>1) {
|
||||
sub_v3_v3v3((child-1)->vel, child->co, (child-2)->co);
|
||||
mul_v3_fl((child-1)->vel, 0.5);
|
||||
|
||||
@ -2732,7 +2732,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
|
||||
sub_v3_v3v3(child->vel, child->co, (child-1)->co);
|
||||
|
||||
/* check if path needs to be cut before actual end of data points */
|
||||
if(k){
|
||||
if(k) {
|
||||
sub_v3_v3v3(dvec, child->co, (child-1)->co);
|
||||
length = 1.0f/(float)ctx->steps;
|
||||
k = check_path_length(k, child_keys, child, max_length, &cur_length, length, dvec);
|
||||
@ -2763,7 +2763,7 @@ static void *exec_child_path_cache(void *data)
|
||||
ChildParticle *cpa;
|
||||
int i, totchild= ctx->totchild, first= 0;
|
||||
|
||||
if(thread->tot > 1){
|
||||
if(thread->tot > 1) {
|
||||
first= ctx->parent_pass? 0 : ctx->totparent;
|
||||
totchild= ctx->parent_pass? ctx->totparent : ctx->totchild;
|
||||
}
|
||||
@ -2988,7 +2988,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
|
||||
dietime = birthtime + pa_length * (dietime - birthtime);
|
||||
|
||||
/*--interpolate actual path from data points--*/
|
||||
for(k=0, ca=cache[p]; k<=steps; k++, ca++){
|
||||
for(k=0, ca=cache[p]; k<=steps; k++, ca++) {
|
||||
time = (float)k / (float)steps;
|
||||
t = birthtime + time * (dietime - birthtime);
|
||||
result.time = -t;
|
||||
@ -3062,7 +3062,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
|
||||
|
||||
psys->totcached = totpart;
|
||||
|
||||
if(psys->lattice){
|
||||
if(psys->lattice) {
|
||||
end_latt_deform(psys->lattice);
|
||||
psys->lattice= NULL;
|
||||
}
|
||||
@ -3125,7 +3125,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
|
||||
}
|
||||
|
||||
/*---first main loop: create all actual particles' paths---*/
|
||||
for(i=0, point=edit->points; i<totpart; i++, pa+=pa?1:0, point++){
|
||||
for(i=0, point=edit->points; i<totpart; i++, pa+=pa?1:0, point++) {
|
||||
if(edit->totcached && !(point->flag & PEP_EDIT_RECALC))
|
||||
continue;
|
||||
|
||||
@ -3142,7 +3142,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
|
||||
|
||||
|
||||
/* should init_particle_interpolation set this ? */
|
||||
if(pset->brushtype==PE_BRUSH_WEIGHT){
|
||||
if(pset->brushtype==PE_BRUSH_WEIGHT) {
|
||||
pind.hkey[0] = NULL;
|
||||
/* pa != NULL since the weight brush is only available for hair */
|
||||
pind.hkey[1] = pa->hair;
|
||||
@ -3172,7 +3172,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
|
||||
}
|
||||
|
||||
/*--interpolate actual path from data points--*/
|
||||
for(k=0, ca=cache[i]; k<=steps; k++, ca++){
|
||||
for(k=0, ca=cache[i]; k<=steps; k++, ca++) {
|
||||
time = (float)k / (float)steps;
|
||||
t = birthtime + time * (dietime - birthtime);
|
||||
result.time = -t;
|
||||
@ -3202,7 +3202,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
|
||||
}
|
||||
|
||||
/* selection coloring in edit mode */
|
||||
if(pset->brushtype==PE_BRUSH_WEIGHT){
|
||||
if(pset->brushtype==PE_BRUSH_WEIGHT) {
|
||||
float t2;
|
||||
|
||||
if(k==0) {
|
||||
@ -3225,8 +3225,8 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
|
||||
pind.hkey[0] = pind.hkey[1] - 1;
|
||||
}
|
||||
else {
|
||||
if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT){
|
||||
if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){
|
||||
if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT) {
|
||||
if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) {
|
||||
copy_v3_v3(ca->col, sel_col);
|
||||
}
|
||||
else{
|
||||
@ -3235,7 +3235,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
|
||||
}
|
||||
}
|
||||
else{
|
||||
if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){
|
||||
if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) {
|
||||
keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
|
||||
interp_v3_v3v3(ca->col, nosel_col, sel_col, keytime);
|
||||
}
|
||||
@ -3282,7 +3282,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
|
||||
/************************************************/
|
||||
void copy_particle_key(ParticleKey *to, ParticleKey *from, int time)
|
||||
{
|
||||
if(time){
|
||||
if(time) {
|
||||
memcpy(to,from,sizeof(ParticleKey));
|
||||
}
|
||||
else{
|
||||
@ -3669,7 +3669,7 @@ void make_local_particlesettings(ParticleSettings *part)
|
||||
/* test objects */
|
||||
for(ob= bmain->object.first; ob && ELEM(FALSE, is_lib, is_local); ob= ob->id.next) {
|
||||
ParticleSystem *psys=ob->particlesystem.first;
|
||||
for(; psys; psys=psys->next){
|
||||
for(; psys; psys=psys->next) {
|
||||
if(psys->part==part) {
|
||||
if(ob->id.lib) is_lib= TRUE;
|
||||
else is_local= TRUE;
|
||||
@ -3691,7 +3691,7 @@ void make_local_particlesettings(ParticleSettings *part)
|
||||
/* do objects */
|
||||
for(ob= bmain->object.first; ob; ob= ob->id.next) {
|
||||
ParticleSystem *psys;
|
||||
for(psys= ob->particlesystem.first; psys; psys=psys->next){
|
||||
for(psys= ob->particlesystem.first; psys; psys=psys->next) {
|
||||
if(psys->part==part && ob->id.lib==0) {
|
||||
psys->part= part_new;
|
||||
part_new->id.us++;
|
||||
@ -3763,9 +3763,9 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
|
||||
ptex->length= 1.0f - part->randlength * PSYS_FRAND(child_index + 26);
|
||||
ptex->length*= part->clength_thres < PSYS_FRAND(child_index + 27) ? part->clength : 1.0f;
|
||||
|
||||
for(m=0; m<MAX_MTEX; m++, mtexp++){
|
||||
for(m=0; m<MAX_MTEX; m++, mtexp++) {
|
||||
mtex = *mtexp;
|
||||
if(mtex && mtex->mapto){
|
||||
if(mtex && mtex->mapto) {
|
||||
float def=mtex->def_var;
|
||||
short blend=mtex->blendtype;
|
||||
short texco = mtex->texco;
|
||||
@ -3831,9 +3831,9 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
|
||||
|
||||
ptex->time = (float)(pa - sim->psys->particles)/(float)sim->psys->totpart;
|
||||
|
||||
for(m=0; m<MAX_MTEX; m++, mtexp++){
|
||||
for(m=0; m<MAX_MTEX; m++, mtexp++) {
|
||||
mtex = *mtexp;
|
||||
if(mtex && mtex->mapto){
|
||||
if(mtex && mtex->mapto) {
|
||||
float def=mtex->def_var;
|
||||
short blend=mtex->blendtype;
|
||||
short texco = mtex->texco;
|
||||
@ -3869,7 +3869,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
|
||||
|
||||
if((event & mtex->mapto) & PAMAP_TIME) {
|
||||
/* the first time has to set the base value for time regardless of blend mode */
|
||||
if((setvars&MAP_PA_TIME)==0){
|
||||
if((setvars&MAP_PA_TIME)==0) {
|
||||
int flip= (mtex->timefac < 0.0f);
|
||||
float timefac= fabsf(mtex->timefac);
|
||||
ptex->time *= 1.0f - timefac;
|
||||
@ -3912,10 +3912,10 @@ float psys_get_child_time(ParticleSystem *psys, ChildParticle *cpa, float cfra,
|
||||
ParticleSettings *part = psys->part;
|
||||
float time, life;
|
||||
|
||||
if(part->childtype==PART_CHILD_FACES){
|
||||
if(part->childtype==PART_CHILD_FACES) {
|
||||
int w=0;
|
||||
time=0.0;
|
||||
while(w<4 && cpa->pa[w]>=0){
|
||||
while(w<4 && cpa->pa[w]>=0) {
|
||||
time+=cpa->w[w]*(psys->particles+cpa->pa[w])->time;
|
||||
w++;
|
||||
}
|
||||
@ -4001,7 +4001,7 @@ static void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *pte
|
||||
/* state is safe to cast, since only co and vel are used */
|
||||
guided = do_guides(sim->psys->effectors, (ParticleKey*)state, cpa->parent, t);
|
||||
|
||||
if(guided==0){
|
||||
if(guided==0) {
|
||||
float clump = do_clump(state, par, t, part->clumpfac, part->clumppow, ptex ? ptex->clump : 1.f);
|
||||
|
||||
if(kink_freq != 0.f) {
|
||||
@ -4054,7 +4054,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
|
||||
t=state->time;
|
||||
CLAMP(t, 0.0f, 1.0f);
|
||||
|
||||
if(p<totpart){
|
||||
if(p<totpart) {
|
||||
/* interpolate pathcache directly if it exist */
|
||||
if(psys->pathcache) {
|
||||
ParticleCacheKey result;
|
||||
@ -4098,7 +4098,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(totchild){
|
||||
else if(totchild) {
|
||||
//invert_m4_m4(imat,ob->obmat);
|
||||
|
||||
/* interpolate childcache directly if it exists */
|
||||
@ -4115,16 +4115,16 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
|
||||
if(state->time < 0.0f)
|
||||
t = psys_get_child_time(psys, cpa, -state->time, NULL, NULL);
|
||||
|
||||
if(totchild && part->childtype==PART_CHILD_FACES){
|
||||
if(totchild && part->childtype==PART_CHILD_FACES) {
|
||||
/* part->parents could still be 0 so we can't test with totparent */
|
||||
between=1;
|
||||
}
|
||||
if(between){
|
||||
if(between) {
|
||||
int w = 0;
|
||||
float foffset;
|
||||
|
||||
/* get parent states */
|
||||
while(w<4 && cpa->pa[w]>=0){
|
||||
while(w<4 && cpa->pa[w]>=0) {
|
||||
keys[w].time = state->time;
|
||||
psys_get_particle_on_path(sim, cpa->pa[w], keys+w, 1);
|
||||
w++;
|
||||
@ -4179,7 +4179,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
|
||||
|
||||
/* correct child ipo timing */
|
||||
#if 0 // XXX old animation system
|
||||
if((part->flag&PART_ABS_TIME)==0 && part->ipo){
|
||||
if((part->flag&PART_ABS_TIME)==0 && part->ipo) {
|
||||
calc_ipo(part->ipo, 100.0f*t);
|
||||
execute_ipo((ID *)part, part->ipo);
|
||||
}
|
||||
@ -4193,14 +4193,14 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
|
||||
/* TODO: assign vertex groups */
|
||||
get_child_modifier_parameters(part, &ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex);
|
||||
|
||||
if(between){
|
||||
if(between) {
|
||||
int w=0;
|
||||
|
||||
state->co[0] = state->co[1] = state->co[2] = 0.0f;
|
||||
state->vel[0] = state->vel[1] = state->vel[2] = 0.0f;
|
||||
|
||||
/* child position is the weighted sum of parent positions */
|
||||
while(w<4 && cpa->pa[w]>=0){
|
||||
while(w<4 && cpa->pa[w]>=0) {
|
||||
state->co[0] += cpa->w[w] * keys[w].co[0];
|
||||
state->co[1] += cpa->w[w] * keys[w].co[1];
|
||||
state->co[2] += cpa->w[w] * keys[w].co[2];
|
||||
@ -4227,11 +4227,11 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
|
||||
do_child_modifiers(sim, &ptex, par, par->rot, cpa, orco, hairmat, state, t);
|
||||
|
||||
/* try to estimate correct velocity */
|
||||
if(vel){
|
||||
if(vel) {
|
||||
ParticleKey tstate;
|
||||
float length = len_v3(state->vel);
|
||||
|
||||
if(t>=0.001f){
|
||||
if(t>=0.001f) {
|
||||
tstate.time=t-0.001f;
|
||||
psys_get_particle_on_path(sim,p,&tstate,0);
|
||||
sub_v3_v3v3(state->vel,state->co,tstate.co);
|
||||
@ -4263,11 +4263,11 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
|
||||
/* negative time means "use current time" */
|
||||
cfra = state->time > 0 ? state->time : BKE_curframe(sim->scene);
|
||||
|
||||
if(p>=totpart){
|
||||
if(p>=totpart) {
|
||||
if(!psys->totchild)
|
||||
return 0;
|
||||
|
||||
if(part->childtype == PART_CHILD_FACES){
|
||||
if(part->childtype == PART_CHILD_FACES) {
|
||||
if(!(psys->flag & PSYS_KEYED))
|
||||
return 0;
|
||||
|
||||
@ -4303,13 +4303,13 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
|
||||
cfra = MIN2(cfra, pa->dietime);
|
||||
}
|
||||
|
||||
if(sim->psys->flag & PSYS_KEYED){
|
||||
if(sim->psys->flag & PSYS_KEYED) {
|
||||
state->time= -cfra;
|
||||
psys_get_particle_on_path(sim, p, state,1);
|
||||
return 1;
|
||||
}
|
||||
else{
|
||||
if(cpa){
|
||||
if(cpa) {
|
||||
float mat[4][4];
|
||||
ParticleKey *key1;
|
||||
float t = (cfra - pa->time) / pa->lifetime;
|
||||
|
@ -306,7 +306,7 @@ static int get_psys_tot_child(struct Scene *scene, ParticleSystem *psys)
|
||||
|
||||
static void alloc_child_particles(ParticleSystem *psys, int tot)
|
||||
{
|
||||
if(psys->child){
|
||||
if(psys->child) {
|
||||
/* only re-allocate if we have to */
|
||||
if(psys->part->childtype && psys->totchild == tot) {
|
||||
memset(psys->child, 0, tot*sizeof(ChildParticle));
|
||||
@ -415,13 +415,13 @@ static void distribute_simple_children(Scene *scene, Object *ob, DerivedMesh *fi
|
||||
alloc_child_particles(psys, totpart);
|
||||
|
||||
cpa = psys->child;
|
||||
for(i=0; i<child_nbr; i++){
|
||||
for(p=0; p<psys->totpart; p++,cpa++){
|
||||
for(i=0; i<child_nbr; i++) {
|
||||
for(p=0; p<psys->totpart; p++,cpa++) {
|
||||
float length=2.0;
|
||||
cpa->parent=p;
|
||||
|
||||
/* create even spherical distribution inside unit sphere */
|
||||
while(length>=1.0f){
|
||||
while(length>=1.0f) {
|
||||
cpa->fuv[0]=2.0f*BLI_frand()-1.0f;
|
||||
cpa->fuv[1]=2.0f*BLI_frand()-1.0f;
|
||||
cpa->fuv[2]=2.0f*BLI_frand()-1.0f;
|
||||
@ -449,7 +449,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
copy_v3_v3(max, mv->co);
|
||||
mv++;
|
||||
|
||||
for(i=1; i<totvert; i++, mv++){
|
||||
for(i=1; i<totvert; i++, mv++) {
|
||||
min[0]=MIN2(min[0],mv->co[0]);
|
||||
min[1]=MIN2(min[1],mv->co[1]);
|
||||
min[2]=MIN2(min[2],mv->co[2]);
|
||||
@ -483,9 +483,9 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
min[1]+= d < delta[1] ? d/2.f : delta[1]/2.f;
|
||||
min[2]+= d < delta[2] ? d/2.f : delta[2]/2.f;
|
||||
|
||||
for(i=0,p=0,pa=psys->particles; i<res; i++){
|
||||
for(j=0; j<res; j++){
|
||||
for(k=0; k<res; k++,p++,pa++){
|
||||
for(i=0,p=0,pa=psys->particles; i<res; i++) {
|
||||
for(j=0; j<res; j++) {
|
||||
for(k=0; k<res; k++,p++,pa++) {
|
||||
pa->fuv[0] = min[0] + (float)i*d;
|
||||
pa->fuv[1] = min[1] + (float)j*d;
|
||||
pa->fuv[2] = min[2] + (float)k*d;
|
||||
@ -496,7 +496,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
}
|
||||
|
||||
/* enable particles near verts/edges/faces/inside surface */
|
||||
if(from==PART_FROM_VERT){
|
||||
if(from==PART_FROM_VERT) {
|
||||
float vec[3];
|
||||
|
||||
pa=psys->particles;
|
||||
@ -505,7 +505,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
min[1] -= d/2.0f;
|
||||
min[2] -= d/2.0f;
|
||||
|
||||
for(i=0,mv=mvert; i<totvert; i++,mv++){
|
||||
for(i=0,mv=mvert; i<totvert; i++,mv++) {
|
||||
sub_v3_v3v3(vec,mv->co,min);
|
||||
vec[0]/=delta[0];
|
||||
vec[1]/=delta[1];
|
||||
@ -515,7 +515,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
+(int)(vec[2]*(size[2]-1)))->flag &= ~PARS_UNEXIST;
|
||||
}
|
||||
}
|
||||
else if(ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)){
|
||||
else if(ELEM(from,PART_FROM_FACE,PART_FROM_VOLUME)) {
|
||||
float co1[3], co2[3];
|
||||
|
||||
MFace *mface= NULL, *mface_array;
|
||||
@ -526,13 +526,13 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
totface=dm->getNumTessFaces(dm);
|
||||
mface=mface_array=dm->getTessFaceDataArray(dm,CD_MFACE);
|
||||
|
||||
for(a=0; a<amax; a++){
|
||||
if(a==0){ a0mul=res*res; a1mul=res; a2mul=1; }
|
||||
else if(a==1){ a0mul=res; a1mul=1; a2mul=res*res; }
|
||||
for(a=0; a<amax; a++) {
|
||||
if(a==0) { a0mul=res*res; a1mul=res; a2mul=1; }
|
||||
else if(a==1) { a0mul=res; a1mul=1; a2mul=res*res; }
|
||||
else{ a0mul=1; a1mul=res*res; a2mul=res; }
|
||||
|
||||
for(a1=0; a1<size[(a+1)%3]; a1++){
|
||||
for(a2=0; a2<size[(a+2)%3]; a2++){
|
||||
for(a1=0; a1<size[(a+1)%3]; a1++) {
|
||||
for(a2=0; a2<size[(a+2)%3]; a2++) {
|
||||
mface= mface_array;
|
||||
|
||||
pa = psys->particles + a1*a1mul + a2*a2mul;
|
||||
@ -543,22 +543,22 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
co1[a] -= 0.001f*d;
|
||||
|
||||
/* lets intersect the faces */
|
||||
for(i=0; i<totface; i++,mface++){
|
||||
for(i=0; i<totface; i++,mface++) {
|
||||
copy_v3_v3(v1, mvert[mface->v1].co);
|
||||
copy_v3_v3(v2, mvert[mface->v2].co);
|
||||
copy_v3_v3(v3, mvert[mface->v3].co);
|
||||
|
||||
if(isect_axial_line_tri_v3(a, co1, co2, v2, v3, v1, &lambda)){
|
||||
if(isect_axial_line_tri_v3(a, co1, co2, v2, v3, v1, &lambda)) {
|
||||
if(from==PART_FROM_FACE)
|
||||
(pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
|
||||
else /* store number of intersections */
|
||||
(pa+(int)(lambda*size[a])*a0mul)->hair_index++;
|
||||
}
|
||||
|
||||
if(mface->v4){
|
||||
if(mface->v4) {
|
||||
copy_v3_v3(v4, mvert[mface->v4].co);
|
||||
|
||||
if(isect_axial_line_tri_v3(a, co1, co2, v4, v1, v3, &lambda)){
|
||||
if(isect_axial_line_tri_v3(a, co1, co2, v4, v1, v3, &lambda)) {
|
||||
if(from==PART_FROM_FACE)
|
||||
(pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
|
||||
else
|
||||
@ -567,10 +567,10 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
}
|
||||
}
|
||||
|
||||
if(from==PART_FROM_VOLUME){
|
||||
if(from==PART_FROM_VOLUME) {
|
||||
int in=pa->hair_index%2;
|
||||
if(in) pa->hair_index++;
|
||||
for(i=0; i<size[0]; i++){
|
||||
for(i=0; i<size[0]; i++) {
|
||||
if(in || (pa+i*a0mul)->hair_index%2)
|
||||
(pa+i*a0mul)->flag &= ~PARS_UNEXIST;
|
||||
/* odd intersections == in->out / out->in */
|
||||
@ -584,9 +584,9 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
}
|
||||
|
||||
if(psys->part->flag & PART_GRID_HEXAGONAL) {
|
||||
for(i=0,p=0,pa=psys->particles; i<res; i++){
|
||||
for(j=0; j<res; j++){
|
||||
for(k=0; k<res; k++,p++,pa++){
|
||||
for(i=0,p=0,pa=psys->particles; i<res; i++) {
|
||||
for(j=0; j<res; j++) {
|
||||
for(k=0; k<res; k++,p++,pa++) {
|
||||
if(j%2)
|
||||
pa->fuv[0] += d/2.f;
|
||||
|
||||
@ -599,11 +599,11 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
}
|
||||
}
|
||||
|
||||
if(psys->part->flag & PART_GRID_INVERT){
|
||||
for(i=0; i<size[0]; i++){
|
||||
for(j=0; j<size[1]; j++){
|
||||
if(psys->part->flag & PART_GRID_INVERT) {
|
||||
for(i=0; i<size[0]; i++) {
|
||||
for(j=0; j<size[1]; j++) {
|
||||
pa=psys->particles + res*(i*res + j);
|
||||
for(k=0; k<size[2]; k++, pa++){
|
||||
for(k=0; k<size[2]; k++, pa++) {
|
||||
pa->flag ^= PARS_UNEXIST;
|
||||
}
|
||||
}
|
||||
@ -612,7 +612,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
|
||||
|
||||
if(psys->part->grid_rand > 0.f) {
|
||||
float rfac = d * psys->part->grid_rand;
|
||||
for(p=0,pa=psys->particles; p<psys->totpart; p++,pa++){
|
||||
for(p=0,pa=psys->particles; p<psys->totpart; p++,pa++) {
|
||||
if(pa->flag & PARS_UNEXIST)
|
||||
continue;
|
||||
|
||||
@ -765,7 +765,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
|
||||
pa->fuv[1] = pa->fuv[2] = pa->fuv[3] = 0.0;
|
||||
|
||||
#if ONLY_WORKING_WITH_PA_VERTS
|
||||
if(ctx->tree){
|
||||
if(ctx->tree) {
|
||||
KDTreeNearest ptn[3];
|
||||
int w, maxw;
|
||||
|
||||
@ -773,7 +773,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
|
||||
transform_mesh_orco_verts((Mesh*)ob->data, &orco1, 1, 1);
|
||||
maxw = BLI_kdtree_find_n_nearest(ctx->tree,3,orco1,NULL,ptn);
|
||||
|
||||
for(w=0; w<maxw; w++){
|
||||
for(w=0; w<maxw; w++) {
|
||||
pa->verts[w]=ptn->num;
|
||||
}
|
||||
}
|
||||
@ -785,7 +785,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
|
||||
pa->num = i = ctx->index[p];
|
||||
mface = dm->getTessFaceData(dm,i,CD_MFACE);
|
||||
|
||||
switch(distr){
|
||||
switch(distr) {
|
||||
case PART_DISTR_JIT:
|
||||
if(ctx->jitlevel == 1) {
|
||||
if(mface->v4)
|
||||
@ -810,7 +810,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
|
||||
pa->foffset= 0.0f;
|
||||
|
||||
/* experimental */
|
||||
if(from==PART_FROM_VOLUME){
|
||||
if(from==PART_FROM_VOLUME) {
|
||||
MVert *mvert=dm->getVertDataArray(dm,CD_MVERT);
|
||||
|
||||
tot=dm->getNumTessFaces(dm);
|
||||
@ -825,25 +825,25 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
|
||||
min_d=2.0;
|
||||
intersect=0;
|
||||
|
||||
for(i=0,mface=dm->getTessFaceDataArray(dm,CD_MFACE); i<tot; i++,mface++){
|
||||
for(i=0,mface=dm->getTessFaceDataArray(dm,CD_MFACE); i<tot; i++,mface++) {
|
||||
if(i==pa->num) continue;
|
||||
|
||||
v1=mvert[mface->v1].co;
|
||||
v2=mvert[mface->v2].co;
|
||||
v3=mvert[mface->v3].co;
|
||||
|
||||
if(isect_line_tri_v3(co1, co2, v2, v3, v1, &cur_d, 0)){
|
||||
if(cur_d<min_d){
|
||||
if(isect_line_tri_v3(co1, co2, v2, v3, v1, &cur_d, 0)) {
|
||||
if(cur_d<min_d) {
|
||||
min_d=cur_d;
|
||||
pa->foffset=cur_d*50.0f; /* to the middle of volume */
|
||||
intersect=1;
|
||||
}
|
||||
}
|
||||
if(mface->v4){
|
||||
if(mface->v4) {
|
||||
v4=mvert[mface->v4].co;
|
||||
|
||||
if(isect_line_tri_v3(co1, co2, v4, v1, v3, &cur_d, 0)){
|
||||
if(cur_d<min_d){
|
||||
if(isect_line_tri_v3(co1, co2, v4, v1, v3, &cur_d, 0)) {
|
||||
if(cur_d<min_d) {
|
||||
min_d=cur_d;
|
||||
pa->foffset=cur_d*50.0f; /* to the middle of volume */
|
||||
intersect=1;
|
||||
@ -853,7 +853,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
|
||||
}
|
||||
if(intersect==0)
|
||||
pa->foffset=0.0;
|
||||
else switch(distr){
|
||||
else switch(distr) {
|
||||
case PART_DISTR_JIT:
|
||||
pa->foffset*= ctx->jit[p%(2*ctx->jitlevel)];
|
||||
break;
|
||||
@ -883,7 +883,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
|
||||
|
||||
cpa->num = ctx->index[p];
|
||||
|
||||
if(ctx->tree){
|
||||
if(ctx->tree) {
|
||||
KDTreeNearest ptn[10];
|
||||
int w,maxw;//, do_seams;
|
||||
float maxd /*, mind,dd */, totw= 0.0f;
|
||||
@ -898,24 +898,24 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
|
||||
/* mind=ptn[0].dist; */ /* UNUSED */
|
||||
|
||||
/* the weights here could be done better */
|
||||
for(w=0; w<maxw; w++){
|
||||
for(w=0; w<maxw; w++) {
|
||||
parent[w]=ptn[w].index;
|
||||
pweight[w]=(float)pow(2.0,(double)(-6.0f*ptn[w].dist/maxd));
|
||||
}
|
||||
for(;w<10; w++){
|
||||
for(;w<10; w++) {
|
||||
parent[w]=-1;
|
||||
pweight[w]=0.0f;
|
||||
}
|
||||
|
||||
for(w=0,i=0; w<maxw && i<4; w++){
|
||||
if(parent[w]>=0){
|
||||
for(w=0,i=0; w<maxw && i<4; w++) {
|
||||
if(parent[w]>=0) {
|
||||
cpa->pa[i]=parent[w];
|
||||
cpa->w[i]=pweight[w];
|
||||
totw+=pweight[w];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
for(;i<4; i++){
|
||||
for(;i<4; i++) {
|
||||
cpa->pa[i]=-1;
|
||||
cpa->w[i]=0.0f;
|
||||
}
|
||||
@ -993,7 +993,7 @@ static void distribute_invalid(Scene *scene, ParticleSystem *psys, int from)
|
||||
int p, totchild = get_psys_tot_child(scene, psys);
|
||||
|
||||
if(psys->child && totchild) {
|
||||
for(p=0,cpa=psys->child; p<totchild; p++,cpa++){
|
||||
for(p=0,cpa=psys->child; p<totchild; p++,cpa++) {
|
||||
cpa->fuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3]= 0.0;
|
||||
cpa->foffset= 0.0f;
|
||||
cpa->parent=0;
|
||||
@ -1057,7 +1057,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
||||
}
|
||||
else {
|
||||
/* Grid distribution */
|
||||
if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT){
|
||||
if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT) {
|
||||
BLI_srandom(31415926 + psys->seed);
|
||||
dm= CDDM_from_mesh((Mesh*)ob->data, ob);
|
||||
distribute_grid(dm,psys);
|
||||
@ -1079,7 +1079,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
||||
|
||||
tree=BLI_kdtree_new(totpart);
|
||||
|
||||
for(p=0,pa=psys->particles; p<totpart; p++,pa++){
|
||||
for(p=0,pa=psys->particles; p<totpart; p++,pa++) {
|
||||
psys_particle_on_dm(dm,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,nor,0,0,orco,ornor);
|
||||
transform_mesh_orco_verts((Mesh*)ob->data, &orco, 1, 1);
|
||||
BLI_kdtree_insert(tree, p, orco, ornor);
|
||||
@ -1128,7 +1128,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
||||
/* Get total number of emission elements and allocate needed arrays */
|
||||
totelem = (from == PART_FROM_VERT) ? dm->getNumVerts(dm) : dm->getNumTessFaces(dm);
|
||||
|
||||
if(totelem == 0){
|
||||
if(totelem == 0) {
|
||||
distribute_invalid(scene, psys, children ? PART_FROM_CHILD : 0);
|
||||
|
||||
if(G.f & G_DEBUG)
|
||||
@ -1147,14 +1147,14 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
||||
jitter_offset = MEM_callocN(sizeof(float)*totelem, "particle_distribution_jitoff");
|
||||
|
||||
/* Calculate weights from face areas */
|
||||
if((part->flag&PART_EDISTR || children) && from != PART_FROM_VERT){
|
||||
if((part->flag&PART_EDISTR || children) && from != PART_FROM_VERT) {
|
||||
MVert *v1, *v2, *v3, *v4;
|
||||
float totarea=0.f, co1[3], co2[3], co3[3], co4[3];
|
||||
float (*orcodata)[3];
|
||||
|
||||
orcodata= dm->getVertDataArray(dm, CD_ORCO);
|
||||
|
||||
for(i=0; i<totelem; i++){
|
||||
for(i=0; i<totelem; i++) {
|
||||
MFace *mf=dm->getTessFaceData(dm,i,CD_MFACE);
|
||||
|
||||
if(orcodata) {
|
||||
@ -1206,13 +1206,13 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
||||
/* Calculate weights from vgroup */
|
||||
vweight = psys_cache_vgroup(dm,psys,PSYS_VG_DENSITY);
|
||||
|
||||
if(vweight){
|
||||
if(vweight) {
|
||||
if(from==PART_FROM_VERT) {
|
||||
for(i=0;i<totelem; i++)
|
||||
element_weight[i]*=vweight[i];
|
||||
}
|
||||
else { /* PART_FROM_FACE / PART_FROM_VOLUME */
|
||||
for(i=0;i<totelem; i++){
|
||||
for(i=0;i<totelem; i++) {
|
||||
MFace *mf=dm->getTessFaceData(dm,i,CD_MFACE);
|
||||
tweight = vweight[mf->v1] + vweight[mf->v2] + vweight[mf->v3];
|
||||
|
||||
@ -1402,7 +1402,7 @@ static void distribute_particles(ParticleSimulationData *sim, int from)
|
||||
PARTICLE_PSMD;
|
||||
int distr_error=0;
|
||||
|
||||
if(psmd){
|
||||
if(psmd) {
|
||||
if(psmd->dm)
|
||||
distribute_particles_on_dm(sim, from);
|
||||
else
|
||||
@ -1411,7 +1411,7 @@ static void distribute_particles(ParticleSimulationData *sim, int from)
|
||||
else
|
||||
distribute_particles_on_shape(sim, from);
|
||||
|
||||
if(distr_error){
|
||||
if(distr_error) {
|
||||
distribute_invalid(sim->scene, sim->psys, from);
|
||||
|
||||
fprintf(stderr,"Particle distribution error!\n");
|
||||
@ -1467,7 +1467,7 @@ void psys_threads_free(ParticleThread *threads)
|
||||
if(ctx->vg_roughe)
|
||||
MEM_freeN(ctx->vg_roughe);
|
||||
|
||||
if(ctx->sim.psys->lattice){
|
||||
if(ctx->sim.psys->lattice) {
|
||||
end_latt_deform(ctx->sim.psys->lattice);
|
||||
ctx->sim.psys->lattice= NULL;
|
||||
}
|
||||
@ -1602,7 +1602,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
||||
normalize_v3(nor);
|
||||
|
||||
/* -tangent */
|
||||
if(part->tanfac!=0.0f){
|
||||
if(part->tanfac!=0.0f) {
|
||||
//float phase=vg_rot?2.0f*(psys_particle_value_from_verts(sim->psmd->dm,part->from,pa,vg_rot)-0.5f):0.0f;
|
||||
float phase=0.0f;
|
||||
mul_v3_fl(vtan,-cosf((float)M_PI*(part->tanphase+phase)));
|
||||
@ -1620,7 +1620,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
||||
|
||||
|
||||
/* -velocity (boids need this even if there's no random velocity) */
|
||||
if(part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)){
|
||||
if(part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)) {
|
||||
r_vel[0] = 2.0f * (PSYS_FRAND(p + 10) - 0.5f);
|
||||
r_vel[1] = 2.0f * (PSYS_FRAND(p + 11) - 0.5f);
|
||||
r_vel[2] = 2.0f * (PSYS_FRAND(p + 12) - 0.5f);
|
||||
@ -1630,7 +1630,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
||||
}
|
||||
|
||||
/* -angular velocity */
|
||||
if(part->avemode==PART_AVE_RAND){
|
||||
if(part->avemode==PART_AVE_RAND) {
|
||||
r_ave[0] = 2.0f * (PSYS_FRAND(p + 13) - 0.5f);
|
||||
r_ave[1] = 2.0f * (PSYS_FRAND(p + 14) - 0.5f);
|
||||
r_ave[2] = 2.0f * (PSYS_FRAND(p + 15) - 0.5f);
|
||||
@ -1640,7 +1640,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
||||
}
|
||||
|
||||
/* -rotation */
|
||||
if(part->randrotfac != 0.0f){
|
||||
if(part->randrotfac != 0.0f) {
|
||||
r_rot[0] = 2.0f * (PSYS_FRAND(p + 16) - 0.5f);
|
||||
r_rot[1] = 2.0f * (PSYS_FRAND(p + 17) - 0.5f);
|
||||
r_rot[2] = 2.0f * (PSYS_FRAND(p + 18) - 0.5f);
|
||||
@ -1685,12 +1685,12 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
||||
/* -velocity from: */
|
||||
|
||||
/* *reactions */
|
||||
if(dtime > 0.f){
|
||||
if(dtime > 0.f) {
|
||||
sub_v3_v3v3(vel, pa->state.vel, pa->prev_state.vel);
|
||||
}
|
||||
|
||||
/* *emitter velocity */
|
||||
if(dtime != 0.f && part->obfac != 0.f){
|
||||
if(dtime != 0.f && part->obfac != 0.f) {
|
||||
sub_v3_v3v3(vel, loc, state->co);
|
||||
mul_v3_fl(vel, part->obfac/dtime);
|
||||
}
|
||||
@ -1736,9 +1736,9 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
||||
/* -rotation */
|
||||
unit_qt(state->rot);
|
||||
|
||||
if(part->rotmode){
|
||||
if(part->rotmode) {
|
||||
/* create vector into which rotation is aligned */
|
||||
switch(part->rotmode){
|
||||
switch(part->rotmode) {
|
||||
case PART_ROT_NOR:
|
||||
copy_v3_v3(rot_vec, nor);
|
||||
break;
|
||||
@ -1781,8 +1781,8 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
||||
|
||||
zero_v3(state->ave);
|
||||
|
||||
if(part->avemode){
|
||||
switch(part->avemode){
|
||||
if(part->avemode) {
|
||||
switch(part->avemode) {
|
||||
case PART_AVE_SPIN:
|
||||
copy_v3_v3(state->ave, vel);
|
||||
break;
|
||||
@ -1835,7 +1835,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
||||
}
|
||||
|
||||
|
||||
if(part->type == PART_HAIR){
|
||||
if(part->type == PART_HAIR) {
|
||||
pa->lifetime = 100.0f;
|
||||
}
|
||||
else{
|
||||
@ -1966,7 +1966,7 @@ static void set_keyed_keys(ParticleSimulationData *sim)
|
||||
|
||||
psys_get_particle_state(&ksim, p%ksim.psys->totpart, key, 1);
|
||||
|
||||
if(psys->flag & PSYS_KEYED_TIMING){
|
||||
if(psys->flag & PSYS_KEYED_TIMING) {
|
||||
key->time = pa->time + pt->time;
|
||||
if(pt->duration != 0.0f && k+1 < totkeys) {
|
||||
copy_particle_key(key+1, key, 1);
|
||||
@ -2099,7 +2099,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
|
||||
if(pa->prev_state.time < 0.f && integrator == PART_INT_VERLET)
|
||||
integrator = PART_INT_EULER;
|
||||
|
||||
switch(integrator){
|
||||
switch(integrator) {
|
||||
case PART_INT_EULER:
|
||||
steps=1;
|
||||
break;
|
||||
@ -2118,7 +2118,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
|
||||
|
||||
states->time = 0.f;
|
||||
|
||||
for(i=0; i<steps; i++){
|
||||
for(i=0; i<steps; i++) {
|
||||
zero_v3(force);
|
||||
zero_v3(impulse);
|
||||
|
||||
@ -2133,13 +2133,13 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
|
||||
/* calculate next state */
|
||||
add_v3_v3(states[i].vel, impulse);
|
||||
|
||||
switch(integrator){
|
||||
switch(integrator) {
|
||||
case PART_INT_EULER:
|
||||
madd_v3_v3v3fl(pa->state.co, states->co, states->vel, dtime);
|
||||
madd_v3_v3v3fl(pa->state.vel, states->vel, acceleration, dtime);
|
||||
break;
|
||||
case PART_INT_MIDPOINT:
|
||||
if(i==0){
|
||||
if(i==0) {
|
||||
madd_v3_v3v3fl(states[1].co, states->co, states->vel, dtime*0.5f);
|
||||
madd_v3_v3v3fl(states[1].vel, states->vel, acceleration, dtime*0.5f);
|
||||
states[1].time = dtime*0.5f;
|
||||
@ -2151,7 +2151,7 @@ static void integrate_particle(ParticleSettings *part, ParticleData *pa, float d
|
||||
}
|
||||
break;
|
||||
case PART_INT_RK4:
|
||||
switch(i){
|
||||
switch(i) {
|
||||
case 0:
|
||||
copy_v3_v3(dx[0], states->vel);
|
||||
mul_v3_fl(dx[0], dtime);
|
||||
@ -2252,7 +2252,7 @@ static void sph_spring_delete(ParticleSystem *psys, int j)
|
||||
|
||||
psys->tot_fluidsprings--;
|
||||
|
||||
if (psys->tot_fluidsprings < psys->alloc_fluidsprings/2 && psys->alloc_fluidsprings > PSYS_FLUID_SPRINGS_INITIAL_SIZE){
|
||||
if (psys->tot_fluidsprings < psys->alloc_fluidsprings/2 && psys->alloc_fluidsprings > PSYS_FLUID_SPRINGS_INITIAL_SIZE) {
|
||||
psys->alloc_fluidsprings /= 2;
|
||||
psys->fluid_springs = (ParticleSpring*)MEM_reallocN(psys->fluid_springs, psys->alloc_fluidsprings * sizeof(ParticleSpring));
|
||||
}
|
||||
@ -2508,7 +2508,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
|
||||
|
||||
madd_v3_v3fl(force, vec, -10.f * spring_constant * (1.f - rij/h) * (spring->rest_length - rij));
|
||||
}
|
||||
else if(fluid->spring_frames == 0 || (pa->prev_state.time-pa->time) <= fluid->spring_frames){
|
||||
else if(fluid->spring_frames == 0 || (pa->prev_state.time-pa->time) <= fluid->spring_frames) {
|
||||
ParticleSpring temp_spring;
|
||||
temp_spring.particle_index[0] = index;
|
||||
temp_spring.particle_index[1] = pfn->index;
|
||||
@ -2621,7 +2621,7 @@ static void basic_force_cb(void *efdata_v, ParticleKey *state, float *force, flo
|
||||
madd_v3_v3fl(force, state->vel, -part->dragfac * pa->size * pa->size * len_v3(state->vel));
|
||||
|
||||
/* brownian force */
|
||||
if(part->brownfac != 0.0f){
|
||||
if(part->brownfac != 0.0f) {
|
||||
force[0] += (BLI_frand()-0.5f) * part->brownfac;
|
||||
force[1] += (BLI_frand()-0.5f) * part->brownfac;
|
||||
force[2] += (BLI_frand()-0.5f) * part->brownfac;
|
||||
@ -2684,8 +2684,8 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
|
||||
{
|
||||
float rotfac, rot1[4], rot2[4]={1.0,0.0,0.0,0.0}, dtime=dfra*timestep;
|
||||
|
||||
if((part->flag & PART_ROT_DYN)==0){
|
||||
if(part->avemode==PART_AVE_SPIN){
|
||||
if((part->flag & PART_ROT_DYN)==0) {
|
||||
if(part->avemode==PART_AVE_SPIN) {
|
||||
float angle;
|
||||
float len1 = len_v3(pa->prev_state.vel);
|
||||
float len2 = len_v3(pa->state.vel);
|
||||
@ -2704,7 +2704,7 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
|
||||
}
|
||||
|
||||
rotfac=len_v3(pa->state.ave);
|
||||
if(rotfac == 0.0f){ /* unit_qt(in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */
|
||||
if(rotfac == 0.0f) { /* unit_qt(in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */
|
||||
rot1[0]=1.0f;
|
||||
rot1[1]=rot1[2]=rot1[3]=0;
|
||||
}
|
||||
@ -3145,7 +3145,7 @@ static int collision_detect(ParticleData *pa, ParticleCollision *col, BVHTreeRay
|
||||
if(hit->dist == 0.0f)
|
||||
hit->dist = col->original_ray_length = 0.000001f;
|
||||
|
||||
for(coll = colliders->first; coll; coll=coll->next){
|
||||
for(coll = colliders->first; coll; coll=coll->next) {
|
||||
/* for boids: don't check with current ground object */
|
||||
if(coll->ob == col->skip)
|
||||
continue;
|
||||
@ -3400,7 +3400,7 @@ static void collision_check(ParticleSimulationData *sim, int p, float dfra, floa
|
||||
}
|
||||
|
||||
/* 10 iterations to catch multiple collisions */
|
||||
while(collision_count < COLLISION_MAX_COLLISIONS){
|
||||
while(collision_count < COLLISION_MAX_COLLISIONS) {
|
||||
if(collision_detect(pa, &col, &hit, sim->colliders)) {
|
||||
|
||||
collision_count++;
|
||||
@ -3432,7 +3432,7 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra)
|
||||
if(alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (sim->ob && sim->ob->mode & OB_MODE_WEIGHT_PAINT)))
|
||||
distr=1;
|
||||
|
||||
if(distr){
|
||||
if(distr) {
|
||||
if(alloc)
|
||||
realloc_particles(sim, sim->psys->totpart);
|
||||
|
||||
@ -3830,18 +3830,18 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
|
||||
/* store this, so we can do multiple loops over particles */
|
||||
pa->state.time = dfra;
|
||||
|
||||
if(dietime <= cfra && psys->cfra < dietime){
|
||||
if(dietime <= cfra && psys->cfra < dietime) {
|
||||
/* particle dies some time between this and last step */
|
||||
pa->state.time = dietime - ((birthtime > psys->cfra) ? birthtime : psys->cfra);
|
||||
pa->alive = PARS_DYING;
|
||||
}
|
||||
else if(birthtime <= cfra && birthtime >= psys->cfra){
|
||||
else if(birthtime <= cfra && birthtime >= psys->cfra) {
|
||||
/* particle is born some time between this and last step*/
|
||||
reset_particle(sim, pa, dfra*timestep, cfra);
|
||||
pa->alive = PARS_ALIVE;
|
||||
pa->state.time = cfra - birthtime;
|
||||
}
|
||||
else if(dietime < cfra){
|
||||
else if(dietime < cfra) {
|
||||
/* nothing to be done when particle is dead */
|
||||
}
|
||||
|
||||
@ -3923,7 +3923,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
|
||||
|
||||
/* finalize particle state and time after dynamics */
|
||||
LOOP_DYNAMIC_PARTICLES {
|
||||
if(pa->alive == PARS_DYING){
|
||||
if(pa->alive == PARS_DYING) {
|
||||
pa->alive=PARS_DEAD;
|
||||
pa->state.time=pa->dietime;
|
||||
}
|
||||
@ -3982,7 +3982,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
|
||||
else
|
||||
pa->alive = PARS_ALIVE;
|
||||
|
||||
if(psys->lattice){
|
||||
if(psys->lattice) {
|
||||
end_latt_deform(psys->lattice);
|
||||
psys->lattice= NULL;
|
||||
}
|
||||
@ -3997,7 +3997,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
|
||||
static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
|
||||
{
|
||||
ParticleSystem *psys = sim->psys;
|
||||
if(psys->particles){
|
||||
if(psys->particles) {
|
||||
MEM_freeN(psys->particles);
|
||||
psys->particles = 0;
|
||||
psys->totpart = 0;
|
||||
@ -4263,7 +4263,7 @@ static void system_step(ParticleSimulationData *sim, float cfra)
|
||||
update_children(sim);
|
||||
|
||||
/* cleanup */
|
||||
if(psys->lattice){
|
||||
if(psys->lattice) {
|
||||
end_latt_deform(psys->lattice);
|
||||
psys->lattice= NULL;
|
||||
}
|
||||
@ -4322,7 +4322,7 @@ void psys_check_boid_data(ParticleSystem *psys)
|
||||
pa->boid = bpa++;
|
||||
}
|
||||
}
|
||||
else if(pa->boid){
|
||||
else if(pa->boid) {
|
||||
MEM_freeN(pa->boid);
|
||||
LOOP_PARTICLES
|
||||
pa->boid = NULL;
|
||||
@ -4466,7 +4466,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
|
||||
/* first step is negative so particles get killed and reset */
|
||||
psys->cfra= 1.0f;
|
||||
|
||||
for(i=0; i<=part->hair_step; i++){
|
||||
for(i=0; i<=part->hair_step; i++) {
|
||||
hcfra=100.0f*(float)i/(float)psys->part->hair_step;
|
||||
if((part->flag & PART_HAIR_REGROW)==0)
|
||||
BKE_animsys_evaluate_animdata(scene, &part->id, part->adt, hcfra, ADT_RECALC_ANIM);
|
||||
|
@ -275,7 +275,7 @@ static void ptcache_particle_read(int index, void *psys_v, void **data, float cf
|
||||
if(cfra > pa->state.time)
|
||||
memcpy(&pa->prev_state, &pa->state, sizeof(ParticleKey));
|
||||
|
||||
if(old_data){
|
||||
if(old_data) {
|
||||
/* old format cache */
|
||||
memcpy(&pa->state, old_data, sizeof(ParticleKey));
|
||||
return;
|
||||
@ -3015,7 +3015,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid)
|
||||
PointCache *cache = pid->cache;
|
||||
int last_exact = cache->last_exact;
|
||||
|
||||
if (!G.relbase_valid){
|
||||
if (!G.relbase_valid) {
|
||||
cache->flag &= ~PTCACHE_DISK_CACHE;
|
||||
if (G.f & G_DEBUG)
|
||||
printf("File must be saved before using disk cache!\n");
|
||||
|
@ -495,7 +495,7 @@ static void do_alphaover_effect_float(float facf0, float facf1, int x, int y,
|
||||
/* rt = rt1 over rt2 (alpha from rt1) */
|
||||
|
||||
fac= fac2;
|
||||
mfac= 1.0f - (fac2*rt1[3]) ;
|
||||
mfac= 1.0f - (fac2 * rt1[3]);
|
||||
|
||||
if(fac <= 0.0f) {
|
||||
memcpy(rt, rt2, 4 * sizeof(float));
|
||||
@ -906,9 +906,9 @@ static void makeGammaTables(float gamma)
|
||||
/* multiplication factors used in scaling the interpolation. */
|
||||
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) {
|
||||
gamfactor_table[i] = inv_color_step
|
||||
* (gamma_range_table[i + 1] - gamma_range_table[i]) ;
|
||||
* (gamma_range_table[i + 1] - gamma_range_table[i]);
|
||||
inv_gamfactor_table[i] = inv_color_step
|
||||
* (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ;
|
||||
* (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]);
|
||||
}
|
||||
|
||||
} /* end of void makeGammaTables(float gamma) */
|
||||
@ -971,7 +971,7 @@ static void gamtabs(float gamma)
|
||||
else if(gamma==1.0f) igamtab1[a-1]= 256*a-1;
|
||||
else {
|
||||
val= a/256.0f;
|
||||
igamtab1[a-1]= (65535.0*pow(val, gamma)) -1 ;
|
||||
igamtab1[a - 1]= (65535.0 * pow(val, gamma)) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1631,7 +1631,7 @@ float hyp3,hyp4,b4,b5
|
||||
if(wipezone->flip) x = xo - x;
|
||||
angle = wipezone->angle;
|
||||
|
||||
if(wipe->forward){
|
||||
if(wipe->forward) {
|
||||
posx = facf0 * xo;
|
||||
posy = facf0 * yo;
|
||||
} else{
|
||||
@ -1699,9 +1699,9 @@ float hyp3,hyp4,b4,b5
|
||||
|
||||
hwidth = minf(hwidth, fabsf(b3-b1)/2.0f);
|
||||
|
||||
if(b2 < b1 && b2 < b3 ){
|
||||
if(b2 < b1 && b2 < b3 ) {
|
||||
output = in_band(hwidth,hyp,0,1);
|
||||
} else if(b2 > b1 && b2 > b3 ){
|
||||
} else if(b2 > b1 && b2 > b3 ) {
|
||||
output = in_band(hwidth,hyp2,0,1);
|
||||
} else {
|
||||
if( hyp < hwidth && hyp2 > hwidth )
|
||||
@ -1724,7 +1724,7 @@ float hyp3,hyp4,b4,b5
|
||||
widthf = wipe->edgeWidth*2.0f*(float)M_PI;
|
||||
temp1 = 2.0f * (float)M_PI * facf0;
|
||||
|
||||
if(wipe->forward){
|
||||
if(wipe->forward) {
|
||||
temp1 = 2.0f*(float)M_PI - temp1;
|
||||
}
|
||||
|
||||
@ -1736,7 +1736,7 @@ float hyp3,hyp4,b4,b5
|
||||
else if(x<=0 && y <= 0) temp2 += (float)M_PI;
|
||||
else if(x >= 0 && y <= 0) temp2 = 2.0f*(float)M_PI - temp2;
|
||||
|
||||
if(wipe->forward){
|
||||
if(wipe->forward) {
|
||||
temp3 = temp1-(widthf*0.5f)*facf0;
|
||||
temp4 = temp1+(widthf*0.5f)*(1-facf0);
|
||||
} else{
|
||||
@ -1775,10 +1775,10 @@ float hyp3,hyp4,b4,b5
|
||||
temp2 = yo*(1-facf0/2)-yo*facf0/2;
|
||||
pointdist = sqrt(temp1*temp1 + temp2*temp2);
|
||||
|
||||
if(b2 < b1 && b2 < b3 ){
|
||||
if(b2 < b1 && b2 < b3 ) {
|
||||
if(hwidth < pointdist)
|
||||
output = in_band(wipezone,hwidth,hyp,facf0,0,1);
|
||||
} else if(b2 > b1 && b2 > b3 ){
|
||||
} else if(b2 > b1 && b2 > b3 ) {
|
||||
if(hwidth < pointdist)
|
||||
output = in_band(wipezone,hwidth,hyp2,facf0,0,1);
|
||||
} else {
|
||||
@ -1799,10 +1799,10 @@ float hyp3,hyp4,b4,b5
|
||||
hyp = abs(angle*x+y+(-posy/2-angle*posx/2))*wipezone->pythangle;
|
||||
hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))*wipezone->pythangle;
|
||||
|
||||
if(b2 < b1 && b2 < b3 ){
|
||||
if(b2 < b1 && b2 < b3 ) {
|
||||
if(hwidth < pointdist)
|
||||
output *= in_band(wipezone,hwidth,hyp,facf0,0,1);
|
||||
} else if(b2 > b1 && b2 > b3 ){
|
||||
} else if(b2 > b1 && b2 > b3 ) {
|
||||
if(hwidth < pointdist)
|
||||
output *= in_band(wipezone,hwidth,hyp2,facf0,0,1);
|
||||
} else {
|
||||
@ -1911,10 +1911,10 @@ static void do_wipe_effect_byte(Sequence *seq, float facf0, float UNUSED(facf1),
|
||||
}
|
||||
|
||||
rt+=4;
|
||||
if(rt1 !=NULL){
|
||||
if(rt1 !=NULL) {
|
||||
rt1+=4;
|
||||
}
|
||||
if(rt2 !=NULL){
|
||||
if(rt2 !=NULL) {
|
||||
rt2+=4;
|
||||
}
|
||||
}
|
||||
@ -1969,10 +1969,10 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float UNUSED(facf1)
|
||||
}
|
||||
|
||||
rt+=4;
|
||||
if(rt1 !=NULL){
|
||||
if(rt1 !=NULL) {
|
||||
rt1+=4;
|
||||
}
|
||||
if(rt2 !=NULL){
|
||||
if(rt2 !=NULL) {
|
||||
rt2+=4;
|
||||
}
|
||||
}
|
||||
@ -2107,7 +2107,7 @@ static void do_transform(Scene *scene, Sequence *seq, float UNUSED(facf0), int x
|
||||
}
|
||||
|
||||
// Translate
|
||||
if(!transform->percent){
|
||||
if(!transform->percent) {
|
||||
float rd_s = (scene->r.size/100.0f);
|
||||
|
||||
translate_x = transform->xIni*rd_s+(x/2.0f);
|
||||
@ -2173,7 +2173,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
|
||||
/* Allocate memory for the filter elements */
|
||||
halfWidth = ((quality+1)*blur);
|
||||
filter = (float *)MEM_mallocN(sizeof(float)*halfWidth*2, "blurbitmapfilter");
|
||||
if (!filter){
|
||||
if (!filter) {
|
||||
MEM_freeN (temp);
|
||||
return;
|
||||
}
|
||||
@ -2185,7 +2185,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
|
||||
/* Blancmange (bmange@airdmhor.gen.nz) */
|
||||
|
||||
k = -1.0f/(2.0f*(float)M_PI*blur*blur);
|
||||
for (ix = 0;ix< halfWidth;ix++){
|
||||
for (ix = 0;ix< halfWidth;ix++) {
|
||||
weight = (float)exp(k*(ix*ix));
|
||||
filter[halfWidth - ix] = weight;
|
||||
filter[halfWidth + ix] = weight;
|
||||
@ -2201,16 +2201,16 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
|
||||
filter[ix]/=fval;
|
||||
|
||||
/* Blur the rows */
|
||||
for (y=0;y<height;y++){
|
||||
for (y=0;y<height;y++) {
|
||||
/* Do the left & right strips */
|
||||
for (x=0;x<halfWidth;x++){
|
||||
for (x=0;x<halfWidth;x++) {
|
||||
index=(x+y*width)*4;
|
||||
fx=0;
|
||||
curColor[0]=curColor[1]=curColor[2]=0;
|
||||
curColor2[0]=curColor2[1]=curColor2[2]=0;
|
||||
|
||||
for (i=x-halfWidth;i<x+halfWidth;i++){
|
||||
if ((i>=0)&&(i<width)){
|
||||
for (i=x-halfWidth;i<x+halfWidth;i++) {
|
||||
if ((i>=0)&&(i<width)) {
|
||||
curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
|
||||
curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
|
||||
curColor[2]+=map[(i+y*width)*4+GlowB]*filter[fx];
|
||||
@ -2234,11 +2234,11 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
|
||||
|
||||
}
|
||||
/* Do the main body */
|
||||
for (x=halfWidth;x<width-halfWidth;x++){
|
||||
for (x=halfWidth;x<width-halfWidth;x++) {
|
||||
index=(x+y*width)*4;
|
||||
fx=0;
|
||||
curColor[0]=curColor[1]=curColor[2]=0;
|
||||
for (i=x-halfWidth;i<x+halfWidth;i++){
|
||||
for (i=x-halfWidth;i<x+halfWidth;i++) {
|
||||
curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
|
||||
curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
|
||||
curColor[2]+=map[(i+y*width)*4+GlowB]*filter[fx];
|
||||
@ -2255,15 +2255,15 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
|
||||
|
||||
|
||||
/* Blur the columns */
|
||||
for (x=0;x<width;x++){
|
||||
for (x=0;x<width;x++) {
|
||||
/* Do the top & bottom strips */
|
||||
for (y=0;y<halfWidth;y++){
|
||||
for (y=0;y<halfWidth;y++) {
|
||||
index=(x+y*width)*4;
|
||||
fy=0;
|
||||
curColor[0]=curColor[1]=curColor[2]=0;
|
||||
curColor2[0]=curColor2[1]=curColor2[2]=0;
|
||||
for (i=y-halfWidth;i<y+halfWidth;i++){
|
||||
if ((i>=0)&&(i<height)){
|
||||
for (i=y-halfWidth;i<y+halfWidth;i++) {
|
||||
if ((i>=0)&&(i<height)) {
|
||||
/* Bottom */
|
||||
curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
|
||||
curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
|
||||
@ -2287,11 +2287,11 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
|
||||
temp[((x+(height-1-y)*width)*4)+GlowB]=curColor2[2];
|
||||
}
|
||||
/* Do the main body */
|
||||
for (y=halfWidth;y<height-halfWidth;y++){
|
||||
for (y=halfWidth;y<height-halfWidth;y++) {
|
||||
index=(x+y*width)*4;
|
||||
fy=0;
|
||||
curColor[0]=curColor[1]=curColor[2]=0;
|
||||
for (i=y-halfWidth;i<y+halfWidth;i++){
|
||||
for (i=y-halfWidth;i<y+halfWidth;i++) {
|
||||
curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
|
||||
curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
|
||||
curColor[2]+=map[(x+i*width)*4+GlowB]*filter[fy];
|
||||
@ -2342,7 +2342,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
|
||||
/* Allocate memory for the filter elements */
|
||||
halfWidth = ((quality+1)*blur);
|
||||
filter = (float *)MEM_mallocN(sizeof(float)*halfWidth*2, "blurbitmapfilter");
|
||||
if (!filter){
|
||||
if (!filter) {
|
||||
MEM_freeN (temp);
|
||||
return;
|
||||
}
|
||||
@ -2355,7 +2355,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
|
||||
|
||||
k = -1.0f/(2.0f*(float)M_PI*blur*blur);
|
||||
|
||||
for (ix = 0;ix< halfWidth;ix++){
|
||||
for (ix = 0;ix< halfWidth;ix++) {
|
||||
weight = (float)exp(k*(ix*ix));
|
||||
filter[halfWidth - ix] = weight;
|
||||
filter[halfWidth + ix] = weight;
|
||||
@ -2371,16 +2371,16 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
|
||||
filter[ix]/=fval;
|
||||
|
||||
/* Blur the rows */
|
||||
for (y=0;y<height;y++){
|
||||
for (y=0;y<height;y++) {
|
||||
/* Do the left & right strips */
|
||||
for (x=0;x<halfWidth;x++){
|
||||
for (x=0;x<halfWidth;x++) {
|
||||
index=(x+y*width)*4;
|
||||
fx=0;
|
||||
curColor[0]=curColor[1]=curColor[2]=0.0f;
|
||||
curColor2[0]=curColor2[1]=curColor2[2]=0.0f;
|
||||
|
||||
for (i=x-halfWidth;i<x+halfWidth;i++){
|
||||
if ((i>=0)&&(i<width)){
|
||||
for (i=x-halfWidth;i<x+halfWidth;i++) {
|
||||
if ((i>=0)&&(i<width)) {
|
||||
curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
|
||||
curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
|
||||
curColor[2]+=map[(i+y*width)*4+GlowB]*filter[fx];
|
||||
@ -2404,11 +2404,11 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
|
||||
|
||||
}
|
||||
/* Do the main body */
|
||||
for (x=halfWidth;x<width-halfWidth;x++){
|
||||
for (x=halfWidth;x<width-halfWidth;x++) {
|
||||
index=(x+y*width)*4;
|
||||
fx=0;
|
||||
curColor[0]=curColor[1]=curColor[2]=0;
|
||||
for (i=x-halfWidth;i<x+halfWidth;i++){
|
||||
for (i=x-halfWidth;i<x+halfWidth;i++) {
|
||||
curColor[0]+=map[(i+y*width)*4+GlowR]*filter[fx];
|
||||
curColor[1]+=map[(i+y*width)*4+GlowG]*filter[fx];
|
||||
curColor[2]+=map[(i+y*width)*4+GlowB]*filter[fx];
|
||||
@ -2425,15 +2425,15 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
|
||||
|
||||
|
||||
/* Blur the columns */
|
||||
for (x=0;x<width;x++){
|
||||
for (x=0;x<width;x++) {
|
||||
/* Do the top & bottom strips */
|
||||
for (y=0;y<halfWidth;y++){
|
||||
for (y=0;y<halfWidth;y++) {
|
||||
index=(x+y*width)*4;
|
||||
fy=0;
|
||||
curColor[0]=curColor[1]=curColor[2]=0;
|
||||
curColor2[0]=curColor2[1]=curColor2[2]=0;
|
||||
for (i=y-halfWidth;i<y+halfWidth;i++){
|
||||
if ((i>=0)&&(i<height)){
|
||||
for (i=y-halfWidth;i<y+halfWidth;i++) {
|
||||
if ((i>=0)&&(i<height)) {
|
||||
/* Bottom */
|
||||
curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
|
||||
curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
|
||||
@ -2457,11 +2457,11 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
|
||||
temp[((x+(height-1-y)*width)*4)+GlowB]=curColor2[2];
|
||||
}
|
||||
/* Do the main body */
|
||||
for (y=halfWidth;y<height-halfWidth;y++){
|
||||
for (y=halfWidth;y<height-halfWidth;y++) {
|
||||
index=(x+y*width)*4;
|
||||
fy=0;
|
||||
curColor[0]=curColor[1]=curColor[2]=0;
|
||||
for (i=y-halfWidth;i<y+halfWidth;i++){
|
||||
for (i=y-halfWidth;i<y+halfWidth;i++) {
|
||||
curColor[0]+=map[(x+i*width)*4+GlowR]*filter[fy];
|
||||
curColor[1]+=map[(x+i*width)*4+GlowG]*filter[fy];
|
||||
curColor[2]+=map[(x+i*width)*4+GlowB]*filter[fy];
|
||||
@ -2491,8 +2491,8 @@ static void RVAddBitmaps_byte (unsigned char* a, unsigned char* b, unsigned char
|
||||
{
|
||||
int x,y,index;
|
||||
|
||||
for (y=0;y<height;y++){
|
||||
for (x=0;x<width;x++){
|
||||
for (y=0;y<height;y++) {
|
||||
for (x=0;x<width;x++) {
|
||||
index=(x+y*width)*4;
|
||||
c[index+GlowR]=MIN2(255,a[index+GlowR]+b[index+GlowR]);
|
||||
c[index+GlowG]=MIN2(255,a[index+GlowG]+b[index+GlowG]);
|
||||
@ -2507,8 +2507,8 @@ static void RVAddBitmaps_float (float* a, float* b, float* c,
|
||||
{
|
||||
int x,y,index;
|
||||
|
||||
for (y=0;y<height;y++){
|
||||
for (x=0;x<width;x++){
|
||||
for (y=0;y<height;y++) {
|
||||
for (x=0;x<width;x++) {
|
||||
index=(x+y*width)*4;
|
||||
c[index+GlowR]= MIN2(1.0f, a[index+GlowR]+b[index+GlowR]);
|
||||
c[index+GlowG]= MIN2(1.0f, a[index+GlowG]+b[index+GlowG]);
|
||||
@ -2534,7 +2534,7 @@ static void RVIsolateHighlights_byte (unsigned char* in, unsigned char* out,
|
||||
|
||||
/* Isolate the intensity */
|
||||
intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold);
|
||||
if (intensity>0){
|
||||
if (intensity>0) {
|
||||
out[index+GlowR]=MIN2(255*clamp, (in[index+GlowR]*boost*intensity)/255);
|
||||
out[index+GlowG]=MIN2(255*clamp, (in[index+GlowG]*boost*intensity)/255);
|
||||
out[index+GlowB]=MIN2(255*clamp, (in[index+GlowB]*boost*intensity)/255);
|
||||
@ -2563,7 +2563,7 @@ static void RVIsolateHighlights_float (float* in, float* out,
|
||||
|
||||
/* Isolate the intensity */
|
||||
intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold);
|
||||
if (intensity>0){
|
||||
if (intensity>0) {
|
||||
out[index+GlowR]=MIN2(clamp, (in[index+GlowR]*boost*intensity));
|
||||
out[index+GlowG]=MIN2(clamp, (in[index+GlowG]*boost*intensity));
|
||||
out[index+GlowB]=MIN2(clamp, (in[index+GlowB]*boost*intensity));
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2444,7 +2444,7 @@ static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata,
|
||||
MLoopUV *mloopuv;
|
||||
int i, j;
|
||||
|
||||
for(i=0; i < numTex; i++){
|
||||
for(i=0; i < numTex; i++) {
|
||||
texface = CustomData_get_n(fdata, CD_MTFACE, findex, i);
|
||||
texpoly = CustomData_get_n(pdata, CD_MTEXPOLY, polyindex, i);
|
||||
|
||||
@ -2456,7 +2456,7 @@ static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata,
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0; i < numCol; i++){
|
||||
for(i=0; i < numCol; i++) {
|
||||
mloopcol = CustomData_get_n(ldata, CD_MLOOPCOL, loopstart, i);
|
||||
mcol = CustomData_get_n(fdata, CD_MCOL, findex, i);
|
||||
|
||||
|
@ -173,7 +173,7 @@ void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(event==CLAMP_PYRAMID_LEVELS || (event==CLAMP_SEARCH_DIM && track->tracker == TRACKER_KLT)) {
|
||||
else if(event==CLAMP_PYRAMID_LEVELS || (event==CLAMP_SEARCH_DIM && track->tracker == TRACKER_KLT)) {
|
||||
float dim[2];
|
||||
sub_v2_v2v2(dim, track->pat_max, track->pat_min);
|
||||
{
|
||||
|
@ -1154,12 +1154,13 @@ IDProperty *ffmpeg_property_add(RenderData *rd, const char *type, int opt_index,
|
||||
|
||||
/* not all versions of ffmpeg include that, so here we go ... */
|
||||
|
||||
static const AVOption *my_av_find_opt(void *v, const char *name,
|
||||
const char *unit, int mask, int flags){
|
||||
static const AVOption *my_av_find_opt(void *v, const char *name,
|
||||
const char *unit, int mask, int flags)
|
||||
{
|
||||
AVClass *c= *(AVClass**)v;
|
||||
const AVOption *o= c->option;
|
||||
|
||||
for(;o && o->name; o++){
|
||||
for(;o && o->name; o++) {
|
||||
if(!strcmp(o->name, name) &&
|
||||
(!unit || (o->unit && !strcmp(o->unit, unit))) &&
|
||||
(o->flags & mask) == flags )
|
||||
|
@ -179,17 +179,17 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
|
||||
stack[cur++]=root->right;
|
||||
}
|
||||
|
||||
while(cur--){
|
||||
while(cur--) {
|
||||
node=stack[cur];
|
||||
|
||||
cur_dist = node->co[node->d] - co[node->d];
|
||||
|
||||
if(cur_dist<0.0f){
|
||||
if(cur_dist<0.0f) {
|
||||
cur_dist= -cur_dist*cur_dist;
|
||||
|
||||
if(-cur_dist<min_dist){
|
||||
if(-cur_dist<min_dist) {
|
||||
cur_dist=squared_distance(node->co,co,node->nor,nor);
|
||||
if(cur_dist<min_dist){
|
||||
if(cur_dist<min_dist) {
|
||||
min_dist=cur_dist;
|
||||
min_node=node;
|
||||
}
|
||||
@ -202,9 +202,9 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
|
||||
else{
|
||||
cur_dist= cur_dist*cur_dist;
|
||||
|
||||
if(cur_dist<min_dist){
|
||||
if(cur_dist<min_dist) {
|
||||
cur_dist=squared_distance(node->co,co,node->nor,nor);
|
||||
if(cur_dist<min_dist){
|
||||
if(cur_dist<min_dist) {
|
||||
min_dist=cur_dist;
|
||||
min_node=node;
|
||||
}
|
||||
@ -214,7 +214,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
|
||||
if(node->left)
|
||||
stack[cur++]=node->left;
|
||||
}
|
||||
if(cur+3 > totstack){
|
||||
if(cur+3 > totstack) {
|
||||
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
|
||||
memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
|
||||
if(stack != defaultstack)
|
||||
@ -286,15 +286,15 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
|
||||
stack[cur++]=root->right;
|
||||
}
|
||||
|
||||
while(cur--){
|
||||
while(cur--) {
|
||||
node=stack[cur];
|
||||
|
||||
cur_dist = node->co[node->d] - co[node->d];
|
||||
|
||||
if(cur_dist<0.0f){
|
||||
if(cur_dist<0.0f) {
|
||||
cur_dist= -cur_dist*cur_dist;
|
||||
|
||||
if(found<n || -cur_dist<nearest[found-1].dist){
|
||||
if(found<n || -cur_dist<nearest[found-1].dist) {
|
||||
cur_dist=squared_distance(node->co,co,node->nor,nor);
|
||||
|
||||
if(found<n || cur_dist<nearest[found-1].dist)
|
||||
@ -309,7 +309,7 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
|
||||
else{
|
||||
cur_dist= cur_dist*cur_dist;
|
||||
|
||||
if(found<n || cur_dist<nearest[found-1].dist){
|
||||
if(found<n || cur_dist<nearest[found-1].dist) {
|
||||
cur_dist=squared_distance(node->co,co,node->nor,nor);
|
||||
if(found<n || cur_dist<nearest[found-1].dist)
|
||||
add_nearest(nearest,&found,n,node->index,cur_dist,node->co);
|
||||
@ -320,7 +320,7 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
|
||||
if(node->left)
|
||||
stack[cur++]=node->left;
|
||||
}
|
||||
if(cur+3 > totstack){
|
||||
if(cur+3 > totstack) {
|
||||
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
|
||||
memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
|
||||
if(stack != defaultstack)
|
||||
@ -427,7 +427,7 @@ int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KD
|
||||
stack[cur++]=node->right;
|
||||
}
|
||||
|
||||
if(cur+3 > totstack){
|
||||
if(cur+3 > totstack) {
|
||||
KDTreeNode **temp=MEM_callocN((totstack+100)*sizeof(KDTreeNode*), "psys_treestack");
|
||||
memcpy(temp,stack,totstack*sizeof(KDTreeNode*));
|
||||
if(stack != defaultstack)
|
||||
|
@ -166,7 +166,7 @@ void *BLI_mempool_alloc(BLI_mempool *pool)
|
||||
pool->free = mpchunk->data; /*start of the list*/
|
||||
if (pool->allow_iter)
|
||||
pool->free->freeword = FREEWORD;
|
||||
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++){
|
||||
for(addr = mpchunk->data, j=0; j < pool->pchunk; j++) {
|
||||
curnode = ((BLI_freenode*)addr);
|
||||
addr += pool->esize;
|
||||
curnode->next = (BLI_freenode*)addr;
|
||||
|
@ -117,8 +117,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
|
||||
che->width= glyph->advance.x * scale;
|
||||
|
||||
// Start converting the FT data
|
||||
npoints = (int *)MEM_callocN((ftoutline.n_contours)* sizeof(int),"endpoints") ;
|
||||
onpoints = (int *)MEM_callocN((ftoutline.n_contours)* sizeof(int),"onpoints") ;
|
||||
npoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"endpoints");
|
||||
onpoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int),"onpoints");
|
||||
|
||||
// calculate total points of each contour
|
||||
for(j = 0; j < ftoutline.n_contours; j++) {
|
||||
@ -145,8 +145,8 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
|
||||
//contour loop, bezier & conic styles merged
|
||||
for(j = 0; j < ftoutline.n_contours; j++) {
|
||||
// add new curve
|
||||
nu = (Nurb*)MEM_callocN(sizeof(struct Nurb),"objfnt_nurb");
|
||||
bezt = (BezTriple*)MEM_callocN((onpoints[j])* sizeof(BezTriple),"objfnt_bezt") ;
|
||||
nu = (Nurb *)MEM_callocN(sizeof(struct Nurb), "objfnt_nurb");
|
||||
bezt = (BezTriple *)MEM_callocN((onpoints[j]) * sizeof(BezTriple), "objfnt_bezt");
|
||||
BLI_addtail(&che->nurbsbase, nu);
|
||||
|
||||
nu->type= CU_BEZIER;
|
||||
|
@ -51,10 +51,10 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
|
||||
x = jit1[i];
|
||||
y = jit1[i+1];
|
||||
for (j = 2*num-2; j>=0 ; j-=2) {
|
||||
if (i != j){
|
||||
if (i != j) {
|
||||
vecx = jit1[j] - x - 1.0f;
|
||||
vecy = jit1[j+1] - y - 1.0f;
|
||||
for (k = 3; k>0 ; k--){
|
||||
for (k = 3; k>0 ; k--) {
|
||||
if( fabsf(vecx)<rad1 && fabsf(vecy)<rad1) {
|
||||
len= sqrt(vecx*vecx + vecy*vecy);
|
||||
if(len>0 && len<rad1) {
|
||||
@ -91,7 +91,7 @@ void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1)
|
||||
|
||||
x -= dvecx/18.0f;
|
||||
y -= dvecy/18.0f;
|
||||
x -= floorf(x) ;
|
||||
x -= floorf(x);
|
||||
y -= floorf(y);
|
||||
jit2[i] = x;
|
||||
jit2[i+1] = y;
|
||||
@ -104,12 +104,12 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2)
|
||||
int i, j;
|
||||
float vecx, vecy, dvecx, dvecy, x, y;
|
||||
|
||||
for (i=2*num -2; i>= 0 ; i-=2){
|
||||
for (i=2*num -2; i>= 0 ; i-=2) {
|
||||
dvecx = dvecy = 0.0;
|
||||
x = jit1[i];
|
||||
y = jit1[i+1];
|
||||
for (j =2*num -2; j>= 0 ; j-=2){
|
||||
if (i != j){
|
||||
for (j =2*num -2; j>= 0 ; j-=2) {
|
||||
if (i != j) {
|
||||
vecx = jit1[j] - x - 1.0f;
|
||||
vecy = jit1[j+1] - y - 1.0f;
|
||||
|
||||
@ -130,7 +130,7 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2)
|
||||
|
||||
x -= dvecx/2.0f;
|
||||
y -= dvecy/2.0f;
|
||||
x -= floorf(x) ;
|
||||
x -= floorf(x);
|
||||
y -= floorf(y);
|
||||
jit2[i] = x;
|
||||
jit2[i+1] = y;
|
||||
|
@ -381,7 +381,7 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
|
||||
if(u>u2) SWAP(float, u, u2);
|
||||
|
||||
if(u>1.0f+eps || u2<-eps) return -1; /* non-ovlerlapping segments */
|
||||
else if(maxf(0.0f, u) == minf(1.0f, u2)){ /* one common point: can return result */
|
||||
else if(maxf(0.0f, u) == minf(1.0f, u2)) { /* one common point: can return result */
|
||||
interp_v2_v2v2(vi, v1, v2, maxf(0, u));
|
||||
return 1;
|
||||
}
|
||||
@ -995,7 +995,7 @@ int isect_sweeping_sphere_tri_v3(
|
||||
|
||||
if(z <= 0.0f && (x >= 0.0f && y >= 0.0f))
|
||||
{
|
||||
//(((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y))) & 0x80000000){
|
||||
//(((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y))) & 0x80000000) {
|
||||
*r_lambda=t0;
|
||||
copy_v3_v3(ipoint,point);
|
||||
return 1;
|
||||
@ -1154,7 +1154,7 @@ int isect_axial_line_tri_v3(const int axis, const float p1[3], const float p2[3]
|
||||
if ((v < 0.0f)||(v > 1.0f)) return 0;
|
||||
|
||||
f= e1[a1];
|
||||
if((f > -0.000001f) && (f < 0.000001f)){
|
||||
if((f > -0.000001f) && (f < 0.000001f)) {
|
||||
f= e1[a2];
|
||||
if((f > -0.000001f) && (f < 0.000001f)) return 0;
|
||||
u= (-p[a2]-v*e2[a2])/f;
|
||||
@ -1680,8 +1680,8 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int,
|
||||
x1 += ix;
|
||||
error += delta_y;
|
||||
|
||||
if(callback(x1, y1, userData) == 0) {
|
||||
return ;
|
||||
if (callback(x1, y1, userData) == 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2523,7 +2523,7 @@ pointers may be NULL if not needed
|
||||
static float _det_m3(float m2[3][3])
|
||||
{
|
||||
float det = 0.f;
|
||||
if (m2){
|
||||
if (m2) {
|
||||
det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
|
||||
-m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
|
||||
+m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
|
||||
@ -2548,8 +2548,8 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
|
||||
if (pos && rpos && (list_size > 0)) /* paranoya check */
|
||||
{
|
||||
/* do com for both clouds */
|
||||
for(a=0; a<list_size; a++){
|
||||
if (weight){
|
||||
for(a=0; a<list_size; a++) {
|
||||
if (weight) {
|
||||
float v[3];
|
||||
copy_v3_v3(v,pos[a]);
|
||||
mul_v3_fl(v,weight[a]);
|
||||
@ -2558,7 +2558,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
|
||||
}
|
||||
else add_v3_v3(accu_com, pos[a]);
|
||||
|
||||
if (rweight){
|
||||
if (rweight) {
|
||||
float v[3];
|
||||
copy_v3_v3(v,rpos[a]);
|
||||
mul_v3_fl(v,rweight[a]);
|
||||
@ -2568,7 +2568,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
|
||||
else add_v3_v3(accu_rcom, rpos[a]);
|
||||
|
||||
}
|
||||
if (!weight || !rweight){
|
||||
if (!weight || !rweight) {
|
||||
accu_weight = accu_rweight = list_size;
|
||||
}
|
||||
|
||||
@ -2576,7 +2576,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
|
||||
mul_v3_fl(accu_rcom,1.0f/accu_rweight);
|
||||
if (lloc) copy_v3_v3(lloc,accu_com);
|
||||
if (rloc) copy_v3_v3(rloc,accu_rcom);
|
||||
if (lrot || lscale){ /* caller does not want rot nor scale, strange but legal */
|
||||
if (lrot || lscale) { /* caller does not want rot nor scale, strange but legal */
|
||||
/*so now do some reverse engeneering and see if we can split rotation from scale ->Polardecompose*/
|
||||
/* build 'projection' matrix */
|
||||
float m[3][3],mr[3][3],q[3][3],qi[3][3];
|
||||
@ -2587,7 +2587,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
|
||||
zero_m3(mr);
|
||||
|
||||
/* build 'projection' matrix */
|
||||
for(a=0; a<list_size; a++){
|
||||
for(a=0; a<list_size; a++) {
|
||||
sub_v3_v3v3(va,rpos[a],accu_rcom);
|
||||
/* mul_v3_fl(va,bp->mass); mass needs renormalzation here ?? */
|
||||
sub_v3_v3v3(vb,pos[a],accu_com);
|
||||
@ -2628,7 +2628,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
|
||||
/* without the far case ... but seems to work here pretty neat */
|
||||
odet = 0.f;
|
||||
ndet = _det_m3(q);
|
||||
while((odet-ndet)*(odet-ndet) > eps && i<imax){
|
||||
while((odet-ndet)*(odet-ndet) > eps && i<imax) {
|
||||
invert_m3_m3(qi,q);
|
||||
transpose_m3(qi);
|
||||
add_m3_m3m3(q,q,qi);
|
||||
@ -2638,7 +2638,7 @@ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,flo
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i){
|
||||
if (i) {
|
||||
float scale[3][3];
|
||||
float irot[3][3];
|
||||
if(lrot) copy_m3_m3(lrot,q);
|
||||
@ -2883,20 +2883,20 @@ typedef union {
|
||||
|
||||
static vFloat vec_splat_float(float val)
|
||||
{
|
||||
return (vFloat){val, val, val, val};
|
||||
return (vFloat) {val, val, val, val};
|
||||
}
|
||||
|
||||
static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float *q2, float *q3)
|
||||
{
|
||||
vFloat vcos, rlen, vrx, vry, vrz, vsrx, vsry, vsrz, gx, gy, gz, vangle;
|
||||
vUInt8 rotate = (vUInt8){4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3};
|
||||
vUInt8 rotate = (vUInt8) {4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3};
|
||||
vFloatResult vresult;
|
||||
float result;
|
||||
|
||||
/* compute r* */
|
||||
vrx = (vFloat){q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]);
|
||||
vry = (vFloat){q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]);
|
||||
vrz = (vFloat){q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]);
|
||||
vrx = (vFloat) {q0[0], q1[0], q2[0], q3[0]} - vec_splat_float(p[0]);
|
||||
vry = (vFloat) {q0[1], q1[1], q2[1], q3[1]} - vec_splat_float(p[1]);
|
||||
vrz = (vFloat) {q0[2], q1[2], q2[2], q3[2]} - vec_splat_float(p[2]);
|
||||
|
||||
/* normalize r* */
|
||||
rlen = vec_rsqrte(vrx*vrx + vry*vry + vrz*vrz + vec_splat_float(1e-16f));
|
||||
|
@ -594,14 +594,14 @@ void transpose_m3(float mat[][3])
|
||||
{
|
||||
float t;
|
||||
|
||||
t = mat[0][1] ;
|
||||
mat[0][1] = mat[1][0] ;
|
||||
t = mat[0][1];
|
||||
mat[0][1] = mat[1][0];
|
||||
mat[1][0] = t;
|
||||
t = mat[0][2] ;
|
||||
mat[0][2] = mat[2][0] ;
|
||||
t = mat[0][2];
|
||||
mat[0][2] = mat[2][0];
|
||||
mat[2][0] = t;
|
||||
t = mat[1][2] ;
|
||||
mat[1][2] = mat[2][1] ;
|
||||
t = mat[1][2];
|
||||
mat[1][2] = mat[2][1];
|
||||
mat[2][1] = t;
|
||||
}
|
||||
|
||||
@ -609,25 +609,25 @@ void transpose_m4(float mat[][4])
|
||||
{
|
||||
float t;
|
||||
|
||||
t = mat[0][1] ;
|
||||
mat[0][1] = mat[1][0] ;
|
||||
t = mat[0][1];
|
||||
mat[0][1] = mat[1][0];
|
||||
mat[1][0] = t;
|
||||
t = mat[0][2] ;
|
||||
mat[0][2] = mat[2][0] ;
|
||||
t = mat[0][2];
|
||||
mat[0][2] = mat[2][0];
|
||||
mat[2][0] = t;
|
||||
t = mat[0][3] ;
|
||||
mat[0][3] = mat[3][0] ;
|
||||
t = mat[0][3];
|
||||
mat[0][3] = mat[3][0];
|
||||
mat[3][0] = t;
|
||||
|
||||
t = mat[1][2] ;
|
||||
mat[1][2] = mat[2][1] ;
|
||||
t = mat[1][2];
|
||||
mat[1][2] = mat[2][1];
|
||||
mat[2][1] = t;
|
||||
t = mat[1][3] ;
|
||||
mat[1][3] = mat[3][1] ;
|
||||
t = mat[1][3];
|
||||
mat[1][3] = mat[3][1];
|
||||
mat[3][1] = t;
|
||||
|
||||
t = mat[2][3] ;
|
||||
mat[2][3] = mat[3][2] ;
|
||||
t = mat[2][3];
|
||||
mat[2][3] = mat[3][2];
|
||||
mat[3][2] = t;
|
||||
}
|
||||
|
||||
@ -1099,7 +1099,7 @@ void rotate_m4(float mat[][4], const char axis, const float angle)
|
||||
|
||||
cosine = (float)cos(angle);
|
||||
sine = (float)sin(angle);
|
||||
switch(axis){
|
||||
switch (axis) {
|
||||
case 'X':
|
||||
for(col=0 ; col<4 ; col++)
|
||||
temp[col] = cosine*mat[1][col] + sine*mat[2][col];
|
||||
@ -1347,7 +1347,7 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
|
||||
s[k] = -s[k];
|
||||
}
|
||||
for (j = k+1; j < n; j++) {
|
||||
if ((k < nct) && (s[k] != 0.0f)) {
|
||||
if ((k < nct) && (s[k] != 0.0f)) {
|
||||
|
||||
// Apply the transformation.
|
||||
|
||||
@ -1538,7 +1538,7 @@ void svd_m4(float U[4][4], float s[4], float V[4][4], float A_[4][4])
|
||||
}
|
||||
t = (ks != p ? fabsf(e[ks]) : 0.f) +
|
||||
(ks != k+1 ? fabsf(e[ks-1]) : 0.0f);
|
||||
if (fabsf(s[ks]) <= eps*t) {
|
||||
if (fabsf(s[ks]) <= eps*t) {
|
||||
s[ks] = 0.0f;
|
||||
break;
|
||||
}
|
||||
|
@ -507,7 +507,7 @@ void QuatInterpolW(float *result, float *quat1, float *quat2, float t)
|
||||
{
|
||||
float omega, cosom, sinom, sc1, sc2;
|
||||
|
||||
cosom = quat1[0]*quat2[0] + quat1[1]*quat2[1] + quat1[2]*quat2[2] + quat1[3]*quat2[3] ;
|
||||
cosom = quat1[0] * quat2[0] + quat1[1] * quat2[1] + quat1[2] * quat2[2] + quat1[3] * quat2[3];
|
||||
|
||||
/* rotate around shortest angle */
|
||||
if ((1.0f + cosom) > 0.0001f) {
|
||||
@ -548,8 +548,8 @@ void interp_qt_qtqt(float result[4], const float quat1[4], const float quat2[4],
|
||||
{
|
||||
float quat[4], omega, cosom, sinom, sc1, sc2;
|
||||
|
||||
cosom = quat1[0]*quat2[0] + quat1[1]*quat2[1] + quat1[2]*quat2[2] + quat1[3]*quat2[3] ;
|
||||
|
||||
cosom = quat1[0] * quat2[0] + quat1[1] * quat2[1] + quat1[2] * quat2[2] + quat1[3] * quat2[3];
|
||||
|
||||
/* rotate around shortest angle */
|
||||
if (cosom < 0.0f) {
|
||||
cosom = -cosom;
|
||||
|
@ -957,29 +957,29 @@ static float noise3_perlin(float vec[3])
|
||||
sz = surve(rz0);
|
||||
|
||||
|
||||
q = g[ b00 + bz0 ] ;
|
||||
q = g[ b00 + bz0 ];
|
||||
u = at(rx0,ry0,rz0);
|
||||
q = g[ b10 + bz0 ] ;
|
||||
q = g[ b10 + bz0 ];
|
||||
v = at(rx1,ry0,rz0);
|
||||
a = lerp(sx, u, v);
|
||||
|
||||
q = g[ b01 + bz0 ] ;
|
||||
q = g[ b01 + bz0 ];
|
||||
u = at(rx0,ry1,rz0);
|
||||
q = g[ b11 + bz0 ] ;
|
||||
q = g[ b11 + bz0 ];
|
||||
v = at(rx1,ry1,rz0);
|
||||
b = lerp(sx, u, v);
|
||||
|
||||
c = lerp(sy, a, b); /* interpolate in y at lo x */
|
||||
|
||||
q = g[ b00 + bz1 ] ;
|
||||
q = g[ b00 + bz1 ];
|
||||
u = at(rx0,ry0,rz1);
|
||||
q = g[ b10 + bz1 ] ;
|
||||
q = g[ b10 + bz1 ];
|
||||
v = at(rx1,ry0,rz1);
|
||||
a = lerp(sx, u, v);
|
||||
|
||||
q = g[ b01 + bz1 ] ;
|
||||
q = g[ b01 + bz1 ];
|
||||
u = at(rx0,ry1,rz1);
|
||||
q = g[ b11 + bz1 ] ;
|
||||
q = g[ b11 + bz1 ];
|
||||
v = at(rx1,ry1,rz1);
|
||||
b = lerp(sx, u, v);
|
||||
|
||||
|
@ -1935,12 +1935,12 @@ void BLI_string_to_utf8(char *original, char *utf_8, const char *code)
|
||||
if (cd == (iconv_t)(-1)) {
|
||||
printf("iconv_open Error");
|
||||
*utf_8='\0';
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
rv=iconv(cd, &original, &inbytesleft, &utf_8, &outbytesleft);
|
||||
if (rv == (size_t) -1) {
|
||||
printf("iconv Error\n");
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
*utf_8 = '\0';
|
||||
iconv_close(cd);
|
||||
|
@ -104,7 +104,7 @@ static struct ListBase *dirbase = &dirbase_;
|
||||
char *BLI_current_working_dir(char *dir, const int maxncpy)
|
||||
{
|
||||
const char *pwd= getenv("PWD");
|
||||
if (pwd){
|
||||
if (pwd) {
|
||||
BLI_strncpy(dir, pwd, maxncpy);
|
||||
return dir;
|
||||
}
|
||||
@ -117,12 +117,12 @@ static int bli_compare(struct direntry *entry1, struct direntry *entry2)
|
||||
{
|
||||
/* type is equal to stat.st_mode */
|
||||
|
||||
if (S_ISDIR(entry1->type)){
|
||||
if (S_ISDIR(entry1->type)) {
|
||||
if (S_ISDIR(entry2->type)==0) return (-1);
|
||||
} else{
|
||||
if (S_ISDIR(entry2->type)) return (1);
|
||||
}
|
||||
if (S_ISREG(entry1->type)){
|
||||
if (S_ISREG(entry1->type)) {
|
||||
if (S_ISREG(entry2->type)==0) return (-1);
|
||||
} else{
|
||||
if (S_ISREG(entry2->type)) return (1);
|
||||
@ -175,7 +175,7 @@ double BLI_dir_free_space(const char *dir)
|
||||
|
||||
strcpy(name,dir);
|
||||
|
||||
if(len){
|
||||
if(len) {
|
||||
slash = strrchr(name,'/');
|
||||
if (slash) slash[1] = 0;
|
||||
} else strcpy(name,"/");
|
||||
@ -206,20 +206,20 @@ static void bli_builddir(const char *dirname, const char *relname)
|
||||
BLI_strncpy(buf, relname, sizeof(buf));
|
||||
rellen=strlen(relname);
|
||||
|
||||
if (rellen){
|
||||
if (rellen) {
|
||||
buf[rellen]='/';
|
||||
rellen++;
|
||||
}
|
||||
|
||||
if (chdir(dirname) == -1){
|
||||
if (chdir(dirname) == -1) {
|
||||
perror(dirname);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (dir = (DIR *)opendir(".")) ){
|
||||
if ( (dir = (DIR *)opendir(".")) ) {
|
||||
while ((fname = (struct dirent*) readdir(dir)) != NULL) {
|
||||
dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
|
||||
if (dlink){
|
||||
if (dlink) {
|
||||
BLI_strncpy(buf + rellen ,fname->d_name, sizeof(buf) - rellen);
|
||||
dlink->name = BLI_strdup(buf);
|
||||
BLI_addhead(dirbase,dlink);
|
||||
@ -227,7 +227,7 @@ static void bli_builddir(const char *dirname, const char *relname)
|
||||
}
|
||||
}
|
||||
|
||||
if (newnum){
|
||||
if (newnum) {
|
||||
|
||||
if(files) {
|
||||
void *tmp= realloc(files, (totnum+newnum) * sizeof(struct direntry));
|
||||
@ -243,9 +243,9 @@ static void bli_builddir(const char *dirname, const char *relname)
|
||||
if(files==NULL)
|
||||
files=(struct direntry *)malloc(newnum * sizeof(struct direntry));
|
||||
|
||||
if (files){
|
||||
if (files) {
|
||||
dlink = (struct dirlink *) dirbase->first;
|
||||
while(dlink){
|
||||
while(dlink) {
|
||||
memset(&files[actnum], 0 , sizeof(struct direntry));
|
||||
files[actnum].relname = dlink->name;
|
||||
files[actnum].path = BLI_strdupcat(dirname, dlink->name);
|
||||
@ -298,7 +298,7 @@ static void bli_adddirstrings(void)
|
||||
struct tm *tm;
|
||||
time_t zero= 0;
|
||||
|
||||
for(num=0, file= files; num<actnum; num++, file++){
|
||||
for(num=0, file= files; num<actnum; num++, file++) {
|
||||
#ifdef WIN32
|
||||
mode = 0;
|
||||
BLI_strncpy(file->mode1, types[0], sizeof(file->mode1));
|
||||
@ -313,14 +313,14 @@ static void bli_adddirstrings(void)
|
||||
|
||||
if (((mode & S_ISGID) == S_ISGID) && (file->mode2[2]=='-'))file->mode2[2]='l';
|
||||
|
||||
if (mode & (S_ISUID | S_ISGID)){
|
||||
if (mode & (S_ISUID | S_ISGID)) {
|
||||
if (file->mode1[2]=='x') file->mode1[2]='s';
|
||||
else file->mode1[2]='S';
|
||||
|
||||
if (file->mode2[2]=='x')file->mode2[2]='s';
|
||||
}
|
||||
|
||||
if (mode & S_ISVTX){
|
||||
if (mode & S_ISVTX) {
|
||||
if (file->mode3[2] == 'x') file->mode3[2] = 't';
|
||||
else file->mode3[2] = 'T';
|
||||
}
|
||||
|
@ -12590,7 +12590,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
act->type= act->otype= ACT_ACTION;
|
||||
|
||||
}
|
||||
else if (act->type == ACT_SHAPEACTION) {
|
||||
else if (act->type == ACT_SHAPEACTION) {
|
||||
act->type = act->otype = ACT_ACTION;
|
||||
}
|
||||
}
|
||||
|
@ -721,7 +721,7 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
|
||||
else if(ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) )
|
||||
write_curvemapping(wd, node->storage);
|
||||
else if(ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION)
|
||||
/* pass */ ;
|
||||
/* pass */;
|
||||
else
|
||||
writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
|
||||
void AnimationExporter::operator() (Object *ob)
|
||||
{
|
||||
FCurve *fcu;
|
||||
char * transformName ;
|
||||
char *transformName;
|
||||
/* bool isMatAnim = false; */ /* UNUSED */
|
||||
|
||||
//Export transform animations
|
||||
@ -254,7 +254,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
|
||||
std::string input_id = create_source_from_fcurve(COLLADASW::InputSemantic::INPUT, fcu, anim_id, axis_name);
|
||||
|
||||
// create output source
|
||||
std::string output_id ;
|
||||
std::string output_id;
|
||||
|
||||
//quat rotations are skipped for now, because of complications with determining axis.
|
||||
if(quatRotation)
|
||||
@ -302,7 +302,7 @@ void AnimationExporter::dae_animation(Object* ob, FCurve *fcu, char* transformNa
|
||||
|
||||
addSampler(sampler);
|
||||
|
||||
std::string target ;
|
||||
std::string target;
|
||||
|
||||
if ( !is_param )
|
||||
target = translate_id(ob_name)
|
||||
|
@ -610,9 +610,10 @@ void AnimationImporter:: Assign_color_animations(const COLLADAFW::UniqueId& list
|
||||
void AnimationImporter:: Assign_float_animations(const COLLADAFW::UniqueId& listid, ListBase *AnimCurves, const char * anim_type)
|
||||
{
|
||||
char rna_path[100];
|
||||
if (animlist_map.find(listid) == animlist_map.end()) return ;
|
||||
else
|
||||
{
|
||||
if (animlist_map.find(listid) == animlist_map.end()) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
//anim_type has animations
|
||||
const COLLADAFW::AnimationList *animlist = animlist_map[listid];
|
||||
const COLLADAFW::AnimationList::AnimationBindings& bindings = animlist->getAnimationBindings();
|
||||
@ -665,7 +666,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>&
|
||||
}
|
||||
// new curves to assign matrix transform animation
|
||||
FCurve *newcu[10]; // if tm_type is matrix, then create 10 curves: 4 rot, 3 loc, 3 scale
|
||||
unsigned int totcu = 10 ;
|
||||
unsigned int totcu = 10;
|
||||
const char *tm_str = NULL;
|
||||
char rna_path[200];
|
||||
for (int i = 0; i < totcu; i++) {
|
||||
@ -824,9 +825,10 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
|
||||
const COLLADAFW::UniqueId& listid = transform->getAnimationList();
|
||||
|
||||
//check if transformation has animations
|
||||
if (animlist_map.find(listid) == animlist_map.end()) continue ;
|
||||
else
|
||||
{
|
||||
if (animlist_map.find(listid) == animlist_map.end()) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
//transformation has animations
|
||||
const COLLADAFW::AnimationList *animlist = animlist_map[listid];
|
||||
const COLLADAFW::AnimationList::AnimationBindings& bindings = animlist->getAnimationBindings();
|
||||
@ -1030,7 +1032,7 @@ void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vector<FCur
|
||||
|
||||
// new curves to assign matrix transform animation
|
||||
FCurve *newcu[10]; // if tm_type is matrix, then create 10 curves: 4 rot, 3 loc, 3 scale
|
||||
unsigned int totcu = 10 ;
|
||||
unsigned int totcu = 10;
|
||||
const char *tm_str = NULL;
|
||||
char rna_path[200];
|
||||
for (int i = 0; i < totcu; i++) {
|
||||
@ -1136,9 +1138,10 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
|
||||
const COLLADAFW::UniqueId& listid = transform->getAnimationList();
|
||||
|
||||
//check if transformation has animations
|
||||
if (animlist_map.find(listid) == animlist_map.end()) continue ;
|
||||
else
|
||||
{
|
||||
if (animlist_map.find(listid) == animlist_map.end()) {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
types->transform = types->transform|NODE_TRANSFORM;
|
||||
break;
|
||||
}
|
||||
@ -1868,7 +1871,7 @@ void AnimationImporter::add_bezt(FCurve *fcu, float fra, float value)
|
||||
//float fps = (float)FPS;
|
||||
BezTriple bez;
|
||||
memset(&bez, 0, sizeof(BezTriple));
|
||||
bez.vec[1][0] = fra ;
|
||||
bez.vec[1][0] = fra;
|
||||
bez.vec[1][1] = value;
|
||||
bez.ipo = BEZT_IPO_LIN ;/* use default interpolation mode here... */
|
||||
bez.f1 = bez.f2 = bez.f3 = SELECT;
|
||||
|
@ -148,7 +148,7 @@ public:
|
||||
std::map<COLLADAFW::UniqueId, Object*>& object_map ,
|
||||
std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map);
|
||||
|
||||
AnimMix* get_animation_type( const COLLADAFW::Node * node , std::map<COLLADAFW::UniqueId,const COLLADAFW::Object*> FW_object_map ) ;
|
||||
AnimMix* get_animation_type( const COLLADAFW::Node * node , std::map<COLLADAFW::UniqueId,const COLLADAFW::Object*> FW_object_map );
|
||||
|
||||
void apply_matrix_curves( Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root ,COLLADAFW::Node* node,
|
||||
COLLADAFW::Transformation * tm );
|
||||
|
@ -102,8 +102,8 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
|
||||
|
||||
for(int i = 0; i < 16; ++i)
|
||||
{
|
||||
float f = (i%4 == i/4) ? 1.0f : 0.0f ;
|
||||
add_parinv |= (ob->parentinv[i%4][i/4] != f);
|
||||
float f = (i % 4 == i / 4) ? 1.0f : 0.0f;
|
||||
add_parinv |= (ob->parentinv[i % 4][i / 4] != f);
|
||||
}
|
||||
|
||||
if(add_parinv)
|
||||
|
@ -1101,7 +1101,7 @@ static size_t animfilter_action (bAnimContext *ac, ListBase *anim_data, bDopeShe
|
||||
}
|
||||
|
||||
/* un-grouped F-Curves (only if we're not only considering those channels in the active group) */
|
||||
if (!(filter_mode & ANIMFILTER_ACTGROUPED)) {
|
||||
if (!(filter_mode & ANIMFILTER_ACTGROUPED)) {
|
||||
FCurve *firstfcu = (lastchan)? (lastchan->next) : (act->curves.first);
|
||||
items += animfilter_fcurves(anim_data, ads, firstfcu, NULL, filter_mode, owner_id);
|
||||
}
|
||||
@ -2043,7 +2043,7 @@ static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data,
|
||||
}
|
||||
|
||||
/* check selection and object type filters */
|
||||
if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/) ) {
|
||||
if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/) ) {
|
||||
/* only selected should be shown */
|
||||
continue;
|
||||
}
|
||||
|
@ -1079,7 +1079,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
|
||||
* - the target isn't origArm/newArm itself
|
||||
* - the target is one that can be found in newArm/origArm
|
||||
*/
|
||||
if(ct->subtarget[0] != '\0') {
|
||||
if(ct->subtarget[0] != '\0') {
|
||||
if (ct->tar == origArm) {
|
||||
if(BLI_findstring(npchans, ct->subtarget, offsetof(bPoseChannel, name))) {
|
||||
ct->tar= newArm;
|
||||
@ -3089,7 +3089,7 @@ static int armature_merge_exec (bContext *C, wmOperator *op)
|
||||
(ebo->flag & BONE_SELECTED) )
|
||||
{
|
||||
/* set either end or start (end gets priority, unless it is already set) */
|
||||
if (bend == NULL) {
|
||||
if (bend == NULL) {
|
||||
bend= ebo;
|
||||
bchild= child;
|
||||
}
|
||||
|
@ -1008,7 +1008,7 @@ static void sk_interpolateDepth(bContext *C, SK_Stroke *stk, int start, int end,
|
||||
mul_v3_fl(ray_normal, distance * progress / length);
|
||||
add_v3_v3(stk->points[i].p, ray_normal);
|
||||
|
||||
progress += delta ;
|
||||
progress += delta;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,7 @@ static int poselib_sanitise_exec (bContext *C, wmOperator *op)
|
||||
TimeMarker *marker, *markern;
|
||||
|
||||
/* validate action */
|
||||
if (act == NULL) {
|
||||
if (act == NULL) {
|
||||
BKE_report(op->reports, RPT_WARNING, "No Action to validate");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ static void pose_copy_menu(Scene *scene)
|
||||
if (nr <= 0)
|
||||
return;
|
||||
|
||||
if (nr != 5) {
|
||||
if (nr != 5) {
|
||||
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
|
||||
if ( (arm->layer & pchan->bone->layer) &&
|
||||
(pchan->bone->flag & BONE_SELECTED) &&
|
||||
|
@ -3599,13 +3599,13 @@ void REEB_draw()
|
||||
|
||||
if (GLOBAL_RG->link_up && G.scene->toolsettings->skgen_options & SKGEN_DISP_ORIG)
|
||||
{
|
||||
for (rg = GLOBAL_RG; rg->link_up; rg = rg->link_up) ;
|
||||
for (rg = GLOBAL_RG; rg->link_up; rg = rg->link_up);
|
||||
}
|
||||
else
|
||||
{
|
||||
i = G.scene->toolsettings->skgen_multi_level;
|
||||
|
||||
for (rg = GLOBAL_RG; rg->multi_level != i && rg->link_up; rg = rg->link_up) ;
|
||||
for (rg = GLOBAL_RG; rg->multi_level != i && rg->link_up; rg = rg->link_up);
|
||||
}
|
||||
|
||||
glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE));
|
||||
|
@ -5714,7 +5714,9 @@ static int delete_exec(bContext *C, wmOperator *op)
|
||||
if( BEZSELECTED_HIDDENHANDLES(cu, bezt) ) {
|
||||
bezt1= bezt;
|
||||
bezt2= bezt+1;
|
||||
if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) ;
|
||||
if ((bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT)) {
|
||||
/* pass */
|
||||
}
|
||||
else { /* maybe do not make cyclic */
|
||||
if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) {
|
||||
bezt2= bezt+(nu->pntsu-1);
|
||||
@ -5741,7 +5743,9 @@ static int delete_exec(bContext *C, wmOperator *op)
|
||||
if( bp->f1 & SELECT ) {
|
||||
bp1= bp;
|
||||
bp2= bp+1;
|
||||
if( bp2->f1 & 1 ) ;
|
||||
if (bp2->f1 & 1) {
|
||||
/* pass */
|
||||
}
|
||||
else { /* maybe do not make cyclic */
|
||||
if(a==0 && (nu->flagu & CU_NURB_CYCLIC) ) {
|
||||
bp2= bp+(nu->pntsu-1);
|
||||
|
@ -36,7 +36,7 @@ typedef struct NumInput {
|
||||
float val[3]; /* Direct value of the input */
|
||||
int ctrl[3]; /* Control to indicate what to do with the numbers that are typed */
|
||||
float increment;
|
||||
} NumInput ;
|
||||
} NumInput;
|
||||
|
||||
/* NUMINPUT FLAGS */
|
||||
#define NUM_NULL_ONE 2
|
||||
|
@ -2564,7 +2564,7 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i
|
||||
data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabsf(data->dragstartx-mx)*0.004f);
|
||||
} else {
|
||||
/*no scaling */
|
||||
data->dragf+= ((float)(mx-data->draglastx))/deler ;
|
||||
data->dragf += ((float)(mx - data->draglastx)) / deler;
|
||||
}
|
||||
|
||||
CLAMP(data->dragf, 0.0f, 1.0f);
|
||||
|
@ -1751,7 +1751,7 @@ void init_userdef_do_versions(void)
|
||||
U.dbl_click_time = 350;
|
||||
}
|
||||
if (U.anim_player_preset == 0) {
|
||||
U.anim_player_preset = 1 ;
|
||||
U.anim_player_preset = 1;
|
||||
}
|
||||
if (U.scrcastfps == 0) {
|
||||
U.scrcastfps = 10;
|
||||
|
@ -2510,7 +2510,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 1) {
|
||||
if (i == 1) {
|
||||
if (singlesel)
|
||||
BM_elem_select_set(bm, v, FALSE);
|
||||
else
|
||||
|
@ -1672,7 +1672,7 @@ static void remerge_faces(knifetool_opdata *kcd)
|
||||
idx = BM_elem_index_get(faces[0]);
|
||||
|
||||
f2 = BM_faces_join(bm, faces, BLI_array_count(faces));
|
||||
if (f2) {
|
||||
if (f2) {
|
||||
BMO_elem_flag_enable(bm, f2, FACE_NEW);
|
||||
BM_elem_index_set(f2, idx); /* set_dirty! */ /* BMESH_TODO, check if this is valid or not */
|
||||
}
|
||||
|
@ -499,7 +499,7 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
|
||||
if(targetPolyIdx > 0) {
|
||||
/* set target poly idx to other selected faces */
|
||||
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
|
||||
if(BM_elem_flag_test(efa, BM_ELEM_SELECT) && efa != efa_act) {
|
||||
if(BM_elem_flag_test(efa, BM_ELEM_SELECT) && efa != efa_act) {
|
||||
int* recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_RECAST);
|
||||
*recastDataBlock= targetPolyIdx;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[],
|
||||
data->mface[face_num].v3, data->mface[face_num].v4};
|
||||
const int smoothnormal= (data->mface[face_num].flag & ME_SMOOTH);
|
||||
|
||||
if(!smoothnormal) { /* flat */
|
||||
if(!smoothnormal) { /* flat */
|
||||
if(data->precomputed_normals) {
|
||||
copy_v3_v3(norm, &data->precomputed_normals[3*face_num]);
|
||||
} else {
|
||||
|
@ -729,9 +729,15 @@ static void copy_texture_space(Object *to, Object *ob)
|
||||
|
||||
memcpy(poin1, poin2, 9*sizeof(float)); /* this was noted in DNA_mesh, curve, mball */
|
||||
|
||||
if(to->type==OB_MESH) ;
|
||||
else if(to->type==OB_MBALL) tex_space_mball(to);
|
||||
else tex_space_curve(to->data);
|
||||
if(to->type==OB_MESH) {
|
||||
/* pass */
|
||||
}
|
||||
else if (to->type == OB_MBALL) {
|
||||
tex_space_mball(to);
|
||||
}
|
||||
else {
|
||||
tex_space_curve(to->data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ static int object_shape_key_mirror(bContext *C, Object *ob)
|
||||
float *fp1, *fp2;
|
||||
int u, v, w;
|
||||
/* half but found up odd value */
|
||||
const int pntsu_half = (((lt->pntsu / 2) + (lt->pntsu % 2))) ;
|
||||
const int pntsu_half = (lt->pntsu / 2) + (lt->pntsu % 2);
|
||||
|
||||
/* currently editmode isnt supported by mesh so
|
||||
* ignore here for now too */
|
||||
|
@ -804,7 +804,7 @@ int runSimulationCallback(void *data, int status, int frame)
|
||||
//printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d \n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG
|
||||
}
|
||||
|
||||
if (fluidbake_breakjob(fb)) {
|
||||
if (fluidbake_breakjob(fb)) {
|
||||
return FLUIDSIM_CBRET_ABORT;
|
||||
}
|
||||
|
||||
|
@ -686,7 +686,7 @@ static int envmap_save_exec(bContext *C, wmOperator *op)
|
||||
|
||||
RNA_string_get(op->ptr, "filepath", path);
|
||||
|
||||
if(scene->r.scemode & R_EXTENSION) {
|
||||
if(scene->r.scemode & R_EXTENSION) {
|
||||
BKE_add_image_extension(path, imtype);
|
||||
}
|
||||
|
||||
|
@ -1516,7 +1516,8 @@ static ProjPixel *project_paint_uvpixel_init(
|
||||
projPixel->mask_max = 0;
|
||||
|
||||
/* which bounding box cell are we in?, needed for undo */
|
||||
projPixel->bb_cell_index = ((int)(((float)x_px/(float)ibuf->x) * PROJ_BOUNDBOX_DIV)) + ((int)(((float)y_px/(float)ibuf->y) * PROJ_BOUNDBOX_DIV)) * PROJ_BOUNDBOX_DIV ;
|
||||
projPixel->bb_cell_index = ((int)(((float)x_px / (float)ibuf->x) * PROJ_BOUNDBOX_DIV)) +
|
||||
((int)(((float)y_px / (float)ibuf->y) * PROJ_BOUNDBOX_DIV)) * PROJ_BOUNDBOX_DIV;
|
||||
|
||||
/* done with view3d_project_float inline */
|
||||
if (ps->tool==PAINT_TOOL_CLONE) {
|
||||
|
@ -1045,8 +1045,8 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
|
||||
}
|
||||
|
||||
/* blend with existing coordinates */
|
||||
for(y = 0; y < gridsize; ++y) {
|
||||
for(x = 0; x < gridsize; ++x) {
|
||||
for(y = 0; y < gridsize; ++y) {
|
||||
for(x = 0; x < gridsize; ++x) {
|
||||
float *co;
|
||||
float *fno;
|
||||
int index;
|
||||
|
@ -533,7 +533,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
|
||||
}
|
||||
}
|
||||
|
||||
if (!(file->selflag & EDITING_FILE)) {
|
||||
if (!(file->selflag & EDITING_FILE)) {
|
||||
int tpos = (FILE_IMGDISPLAY == params->display) ? sy - layout->tile_h + layout->textheight : sy;
|
||||
file_draw_string(sx+1, tpos, file->relname, (float)textwidth, textheight, align);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ static FileSelect file_select_do(bContext* C, int selected_idx)
|
||||
|
||||
if(S_ISDIR(file->type)) {
|
||||
/* the path is too long and we are not going up! */
|
||||
if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) {
|
||||
if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) {
|
||||
// XXX error("Path too long, cannot enter this directory");
|
||||
}
|
||||
else {
|
||||
|
@ -341,8 +341,8 @@ int ED_fileselect_layout_offset(FileLayout* layout, int x, int y)
|
||||
offsetx = (x)/(layout->tile_w + 2*layout->tile_border_x);
|
||||
offsety = (y)/(layout->tile_h + 2*layout->tile_border_y);
|
||||
|
||||
if (offsetx > layout->columns-1) return -1 ;
|
||||
if (offsety > layout->rows-1) return -1 ;
|
||||
if (offsetx > layout->columns - 1) return -1;
|
||||
if (offsety > layout->rows - 1) return -1;
|
||||
|
||||
if (layout->flag & FILE_LAYOUT_HOR)
|
||||
active_file = layout->rows*offsetx + offsety;
|
||||
|
@ -245,8 +245,9 @@ void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename)
|
||||
fprintf(fp, "[Recent]\n");
|
||||
nskip = fsmenu_get_nentries(fsmenu, FS_CATEGORY_RECENT) - FSMENU_RECENT_MAX;
|
||||
// skip first entries if list too long
|
||||
for (fsme= fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip>0); fsme= fsme->next, --nskip)
|
||||
;
|
||||
for (fsme= fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip>0); fsme= fsme->next, --nskip) {
|
||||
/* pass */
|
||||
}
|
||||
for (; fsme; fsme= fsme->next) {
|
||||
if (fsme->path && fsme->save) {
|
||||
fprintf(fp, "%s\n", fsme->path);
|
||||
|
@ -5017,7 +5017,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
||||
(is_sensor_linked(block, sens))
|
||||
) {
|
||||
/* should we draw the pin? - for now always draw when there is a state */
|
||||
pin = (slogic->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1:0 ;
|
||||
pin = (slogic->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1 : 0;
|
||||
|
||||
sens->flag |= SENS_VISIBLE;
|
||||
uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Delete Sensor");
|
||||
@ -5097,7 +5097,7 @@ void logic_buttons(bContext *C, ARegion *ar)
|
||||
(act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */
|
||||
(act->flag & ACT_PIN && slogic->scaflag & BUTS_ACT_STATE)) {
|
||||
|
||||
pin = (slogic->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1:0 ;
|
||||
pin = (slogic->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1 : 0;
|
||||
|
||||
act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */
|
||||
uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Delete Actuator");
|
||||
|
@ -3277,7 +3277,7 @@ static void node_delete_reconnect(bNodeTree* tree, bNode* node)
|
||||
the first link evaluated will be used to determine the possible connection.
|
||||
*/
|
||||
for(link= tree->links.first; link; link=link->next) {
|
||||
if (link->tonode == node) { numberOfConnectedInputSockets++; }
|
||||
if (link->tonode == node) { numberOfConnectedInputSockets++; }
|
||||
type = is_connected_to_input_socket(node, link);
|
||||
switch (type) {
|
||||
case SOCK_RGBA:
|
||||
|
@ -483,7 +483,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
|
||||
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
}
|
||||
else if(tselem->type==TSE_MODIFIER) {
|
||||
else if(tselem->type==TSE_MODIFIER) {
|
||||
ModifierData *md= (ModifierData *)te->directdata;
|
||||
ob = (Object *)tselem->id;
|
||||
|
||||
@ -496,7 +496,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
|
||||
(int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, &(md->mode), 0, 0, 0, 0, "Restrict/Allow renderability");
|
||||
uiButSetFunc(bt, restrictbutton_modifier_cb, scene, ob);
|
||||
}
|
||||
else if(tselem->type==TSE_POSE_CHANNEL) {
|
||||
else if(tselem->type==TSE_POSE_CHANNEL) {
|
||||
bPoseChannel *pchan= (bPoseChannel *)te->directdata;
|
||||
Bone *bone = pchan->bone;
|
||||
|
||||
@ -509,7 +509,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
|
||||
(int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, &(bone->flag), 0, 0, 0, 0, "Restrict/Allow selection in the 3D View");
|
||||
uiButSetFunc(bt, restrictbutton_bone_cb, NULL, NULL);
|
||||
}
|
||||
else if(tselem->type==TSE_EBONE) {
|
||||
else if(tselem->type==TSE_EBONE) {
|
||||
EditBone *ebone= (EditBone *)te->directdata;
|
||||
|
||||
uiBlockSetEmboss(block, UI_EMBOSSN);
|
||||
|
@ -248,7 +248,7 @@ void item_rename_cb(bContext *C, Scene *UNUSED(scene), TreeElement *te, TreeStor
|
||||
{
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
ReportList *reports= CTX_wm_reports(C); // XXX
|
||||
do_item_rename(ar, te, tselem, reports) ;
|
||||
do_item_rename(ar, te, tselem, reports);
|
||||
}
|
||||
|
||||
static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, TreeElement *te, const float mval[2])
|
||||
@ -261,7 +261,7 @@ static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, T
|
||||
/* name and first icon */
|
||||
if(mval[0]>te->xs+UI_UNIT_X && mval[0]<te->xend) {
|
||||
|
||||
do_item_rename(ar, te, tselem, reports) ;
|
||||
do_item_rename(ar, te, tselem, reports);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -859,7 +859,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
|
||||
ted->name= "Drivers";
|
||||
|
||||
for (fcu= adt->drivers.first; fcu; fcu= fcu->next) {
|
||||
if (fcu->driver && fcu->driver->variables.first) {
|
||||
if (fcu->driver && fcu->driver->variables.first) {
|
||||
ChannelDriver *driver= fcu->driver;
|
||||
DriverVar *dvar;
|
||||
|
||||
@ -1561,7 +1561,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
|
||||
|
||||
ten= outliner_add_element(soops, &soops->tree, (void*)&mainptr, NULL, TSE_RNA_STRUCT, -1);
|
||||
|
||||
if(show_opened) {
|
||||
if(show_opened) {
|
||||
tselem= TREESTORE(ten);
|
||||
tselem->flag &= ~TSE_CLOSED;
|
||||
}
|
||||
@ -1573,7 +1573,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
|
||||
|
||||
ten= outliner_add_element(soops, &soops->tree, (void*)&userdefptr, NULL, TSE_RNA_STRUCT, -1);
|
||||
|
||||
if(show_opened) {
|
||||
if(show_opened) {
|
||||
tselem= TREESTORE(ten);
|
||||
tselem->flag &= ~TSE_CLOSED;
|
||||
}
|
||||
|
@ -538,7 +538,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
|
||||
*selseq1 = *selseq2 = *selseq3 = NULL;
|
||||
return 1; /* succsess */
|
||||
case 1:
|
||||
if(seq2==NULL) {
|
||||
if(seq2==NULL) {
|
||||
*error_str= "Need at least one selected sequence strip";
|
||||
return 0;
|
||||
}
|
||||
|
@ -1061,9 +1061,9 @@ static void spotvolume(float lvec[3], float vvec[3], const float inp)
|
||||
|
||||
/* translating this comment to english didnt really help me understanding the math! :-) (ton) */
|
||||
|
||||
q[1] = plane[1] ;
|
||||
q[2] = -plane[0] ;
|
||||
q[3] = 0 ;
|
||||
q[1] = plane[1];
|
||||
q[2] = -plane[0];
|
||||
q[3] = 0;
|
||||
normalize_v3(&q[1]);
|
||||
|
||||
angle = saacos(plane[2])/2.0f;
|
||||
|
@ -755,7 +755,7 @@ static void draw_view_icon(RegionView3D *rv3d)
|
||||
icon= ICON_AXIS_FRONT;
|
||||
else if ( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
|
||||
icon= ICON_AXIS_SIDE;
|
||||
else return ;
|
||||
else return;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
@ -2161,7 +2161,7 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
else {
|
||||
Base *base;
|
||||
for (base= FIRSTBASE; base; base = base->next) {
|
||||
if (TESTBASE(v3d, base)) {
|
||||
if (TESTBASE(v3d, base)) {
|
||||
|
||||
if (skip_camera && base->object == v3d->camera) {
|
||||
continue;
|
||||
|
@ -982,7 +982,7 @@ static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op))
|
||||
|
||||
curs = give_cursor(scene, v3d);
|
||||
|
||||
if (obedit) {
|
||||
if (obedit) {
|
||||
if (obedit->type == OB_MESH) {
|
||||
/* check active */
|
||||
Mesh *me= obedit->data;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user