style cleanup: comment blocks
This commit is contained in:
		@@ -197,13 +197,12 @@ AviError AVI_print_error (AviError in_error)
 | 
			
		||||
 | 
			
		||||
	return in_error;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
#if 0
 | 
			
		||||
void AVI_set_debug (int mode)
 | 
			
		||||
{
 | 
			
		||||
	AVI_DEBUG= mode;
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
int AVI_is_avi (char *name)
 | 
			
		||||
{
 | 
			
		||||
	FILE *fp;
 | 
			
		||||
@@ -224,7 +223,7 @@ int AVI_is_avi (char *name)
 | 
			
		||||
	fclose(fp);
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int AVI_is_avi (const char *name)
 | 
			
		||||
{
 | 
			
		||||
@@ -659,7 +658,7 @@ void *AVI_read_frame (AviMovie *movie, AviFormat format, int frame, int stream)
 | 
			
		||||
	void *buffer;
 | 
			
		||||
 | 
			
		||||
	/* Retrieve the record number of the desired frame in the index 
 | 
			
		||||
		If a chunk has Size 0 we need to rewind to previous frame */
 | 
			
		||||
	 * If a chunk has Size 0 we need to rewind to previous frame */
 | 
			
		||||
	while(rewind && frame > -1) {
 | 
			
		||||
		i=0;
 | 
			
		||||
		cur_frame=-1;
 | 
			
		||||
@@ -798,13 +797,13 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
 | 
			
		||||
		movie->streams[i].sh.bottom = 0;
 | 
			
		||||
 | 
			
		||||
		if (movie->streams[i].sh.Type == FCC("vids")) {	
 | 
			
		||||
/*
 | 
			
		||||
#if 0
 | 
			
		||||
			if (movie->streams[i].format == AVI_FORMAT_MJPEG) {
 | 
			
		||||
				movie->streams[i].sf = MEM_mallocN (sizeof(AviBitmapInfoHeader) 
 | 
			
		||||
										+ sizeof(AviMJPEGUnknown),"moviestreamformatL");
 | 
			
		||||
				movie->streams[i].sf_size = sizeof(AviBitmapInfoHeader) + sizeof(AviMJPEGUnknown);
 | 
			
		||||
			} else {
 | 
			
		||||
*/
 | 
			
		||||
#endif
 | 
			
		||||
			movie->streams[i].sf = MEM_mallocN (sizeof(AviBitmapInfoHeader),  "moviestreamformatS");
 | 
			
		||||
			movie->streams[i].sf_size = sizeof(AviBitmapInfoHeader);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -59,12 +59,12 @@ void BLF_size(int fontid, int size, int dpi);
 | 
			
		||||
 * to enable this.
 | 
			
		||||
 *
 | 
			
		||||
 * The order of the matrix is like GL:
 | 
			
		||||
 | 
			
		||||
	| m[0]  m[4]  m[8]  m[12] |
 | 
			
		||||
	| m[1]  m[5]  m[9]  m[13] |
 | 
			
		||||
	| m[2]  m[6]  m[10] m[14] |
 | 
			
		||||
	| m[3]  m[7]  m[11] m[15] |
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 *  | m[0]  m[4]  m[8]  m[12] |
 | 
			
		||||
 *  | m[1]  m[5]  m[9]  m[13] |
 | 
			
		||||
 *  | m[2]  m[6]  m[10] m[14] |
 | 
			
		||||
 *  | m[3]  m[7]  m[11] m[15] |
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
void BLF_matrix(int fontid, const double m[16]);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,7 @@ extern const CustomDataMask CD_MASK_FACECORNERS;
 | 
			
		||||
#define CD_DEFAULT   2  /* allocate and set to default */
 | 
			
		||||
#define CD_REFERENCE 3  /* use data pointers, set layer flag NOFREE */
 | 
			
		||||
#define CD_DUPLICATE 4  /* do a full copy of all layers, only allowed if source
 | 
			
		||||
						   has same number of elements */
 | 
			
		||||
                         * has same number of elements */
 | 
			
		||||
 | 
			
		||||
#define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type))
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -118,11 +118,11 @@ struct SeqEffectHandle {
 | 
			
		||||
	void (*init_plugin)(struct Sequence *seq, const char *fname);
 | 
			
		||||
	
 | 
			
		||||
	/* number of input strips needed 
 | 
			
		||||
		(called directly after construction) */
 | 
			
		||||
	 * (called directly after construction) */
 | 
			
		||||
	int (*num_inputs)(void);
 | 
			
		||||
	
 | 
			
		||||
	/* load is called first time after readblenfile in
 | 
			
		||||
		get_sequence_effect automatically */
 | 
			
		||||
	 * get_sequence_effect automatically */
 | 
			
		||||
	void (*load)(struct Sequence *seq);
 | 
			
		||||
	
 | 
			
		||||
	/* duplicate */
 | 
			
		||||
@@ -132,9 +132,9 @@ struct SeqEffectHandle {
 | 
			
		||||
	void (*free)(struct Sequence *seq);
 | 
			
		||||
	
 | 
			
		||||
	/* returns: -1: no input needed,
 | 
			
		||||
	0: no early out, 
 | 
			
		||||
	1: out = ibuf1, 
 | 
			
		||||
	2: out = ibuf2 */
 | 
			
		||||
	 * 0: no early out,
 | 
			
		||||
	 * 1: out = ibuf1,
 | 
			
		||||
	 * 2: out = ibuf2 */
 | 
			
		||||
	int (*early_out)(struct Sequence *seq, float facf0, float facf1); 
 | 
			
		||||
	
 | 
			
		||||
	/* stores the y-range of the effect IPO */
 | 
			
		||||
@@ -146,9 +146,9 @@ struct SeqEffectHandle {
 | 
			
		||||
                                float * facf0, float * facf1);
 | 
			
		||||
	
 | 
			
		||||
	/* execute the effect
 | 
			
		||||
           sequence effects are only required to either support
 | 
			
		||||
           float-rects or byte-rects 
 | 
			
		||||
           (mixed cases are handled one layer up...) */
 | 
			
		||||
	 * sequence effects are only required to either support
 | 
			
		||||
	 * float-rects or byte-rects
 | 
			
		||||
	 * (mixed cases are handled one layer up...) */
 | 
			
		||||
	
 | 
			
		||||
	struct ImBuf* (*execute)(
 | 
			
		||||
		SeqRenderData context,
 | 
			
		||||
@@ -162,9 +162,9 @@ struct SeqEffectHandle {
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
 * sequence.c
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 * sequencer render functions
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
struct ImBuf *give_ibuf_seq(SeqRenderData context, float cfra, int chanshown);
 | 
			
		||||
struct ImBuf *give_ibuf_seq_threaded(SeqRenderData context, float cfra, int chanshown);
 | 
			
		||||
@@ -209,10 +209,10 @@ void seq_proxy_rebuild_finish(struct SeqIndexBuildContext *context, short stop);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   seqcache.c
 | 
			
		||||
 | 
			
		||||
   Sequencer memory cache management functions
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * seqcache.c
 | 
			
		||||
 *
 | 
			
		||||
 * Sequencer memory cache management functions
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
	SEQ_STRIPELEM_IBUF,
 | 
			
		||||
@@ -230,20 +230,20 @@ struct ImBuf * seq_stripelem_cache_get(
 | 
			
		||||
	float cfra, seq_stripelem_ibuf_t type);
 | 
			
		||||
 | 
			
		||||
/* passed ImBuf is properly refed, so ownership is *not* 
 | 
			
		||||
   transfered to the cache.
 | 
			
		||||
   you can pass the same ImBuf multiple times to the cache without problems.
 | 
			
		||||
*/
 | 
			
		||||
 * transfered to the cache.
 | 
			
		||||
 * you can pass the same ImBuf multiple times to the cache without problems.
 | 
			
		||||
 */
 | 
			
		||||
   
 | 
			
		||||
void seq_stripelem_cache_put(
 | 
			
		||||
	SeqRenderData context, struct Sequence * seq, 
 | 
			
		||||
	float cfra, seq_stripelem_ibuf_t type, struct ImBuf * nval);
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   seqeffects.c 
 | 
			
		||||
 | 
			
		||||
   Sequencer effect strip managment functions
 | 
			
		||||
   **********************************************************************
 | 
			
		||||
*/
 | 
			
		||||
 * seqeffects.c
 | 
			
		||||
 *
 | 
			
		||||
 * Sequencer effect strip managment functions
 | 
			
		||||
 *  **********************************************************************
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* intern */
 | 
			
		||||
struct SeqEffectHandle get_sequence_blend(struct Sequence *seq);
 | 
			
		||||
@@ -255,9 +255,9 @@ int get_sequence_effect_num_inputs(int seq_type);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   Sequencer editing functions
 | 
			
		||||
   **********************************************************************
 | 
			
		||||
*/
 | 
			
		||||
 * Sequencer editing functions
 | 
			
		||||
 * **********************************************************************
 | 
			
		||||
 */
 | 
			
		||||
   
 | 
			
		||||
/* for transform but also could use elsewhere */
 | 
			
		||||
int seq_tx_get_start(struct Sequence *seq);
 | 
			
		||||
 
 | 
			
		||||
@@ -421,7 +421,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/* not all DerivedMeshes store their verts/edges/faces in CustomData, so
 | 
			
		||||
	   we set them here in case they are missing */
 | 
			
		||||
	 * we set them here in case they are missing */
 | 
			
		||||
	if(!CustomData_has_layer(&tmp.vdata, CD_MVERT))
 | 
			
		||||
		CustomData_add_layer(&tmp.vdata, CD_MVERT, CD_ASSIGN, dm->dupVertArray(dm), totvert);
 | 
			
		||||
	if(!CustomData_has_layer(&tmp.edata, CD_MEDGE))
 | 
			
		||||
@@ -455,8 +455,8 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
 | 
			
		||||
	CustomData_free(&me->pdata, me->totpoly);
 | 
			
		||||
 | 
			
		||||
	/* ok, this should now use new CD shapekey data,
 | 
			
		||||
	    which shouuld be fed through the modifier 
 | 
			
		||||
		stack*/
 | 
			
		||||
	 * which shouuld be fed through the modifier
 | 
			
		||||
	 * stack*/
 | 
			
		||||
	if(tmp.totvert != me->totvert && !did_shapekeys && me->key) {
 | 
			
		||||
		printf("YEEK! this should be recoded! Shape key loss!!!\n");
 | 
			
		||||
		if(tmp.key) tmp.key->id.us--;
 | 
			
		||||
@@ -787,7 +787,7 @@ static void *get_orco_coords_dm(Object *ob, BMEditMesh *em, int layer, int *free
 | 
			
		||||
	}
 | 
			
		||||
	else if(layer == CD_CLOTH_ORCO) {
 | 
			
		||||
		/* apply shape key for cloth, this should really be solved
 | 
			
		||||
		   by a more flexible customdata system, but not simple */
 | 
			
		||||
		 * by a more flexible customdata system, but not simple */
 | 
			
		||||
		if(!em) {
 | 
			
		||||
			ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
 | 
			
		||||
			KeyBlock *kb= key_get_keyblock(ob_get_key(ob), clmd->sim_parms->shapekey_rest);
 | 
			
		||||
@@ -2636,8 +2636,9 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
 | 
			
		||||
				attribs->tface[a].glIndex = gattribs->layer[b].glindex;
 | 
			
		||||
				attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
 | 
			
		||||
			}
 | 
			
		||||
			/* BMESH ONLY, may need to get this working?, otherwise remove */
 | 
			
		||||
			/* else {
 | 
			
		||||
			/* BMESH_TODO - BMESH ONLY, may need to get this working?, otherwise remove */
 | 
			
		||||
#if 0
 | 
			
		||||
			else {
 | 
			
		||||
				int player;
 | 
			
		||||
				CustomData *pdata = dm->getPolyDataLayout(dm);
 | 
			
		||||
				
 | 
			
		||||
@@ -2657,7 +2658,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
 | 
			
		||||
					
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			*/
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
		else if(gattribs->layer[b].type == CD_MCOL) {
 | 
			
		||||
			/* vertex colors */
 | 
			
		||||
@@ -2756,13 +2757,14 @@ static void navmesh_drawColored(DerivedMesh *dm)
 | 
			
		||||
	if (!polygonIdx)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
#if 0
 | 
			
		||||
	//UI_ThemeColor(TH_WIRE);
 | 
			
		||||
	glDisable(GL_LIGHTING);
 | 
			
		||||
	glLineWidth(2.0);
 | 
			
		||||
	dm->drawEdges(dm, 0, 1);
 | 
			
		||||
	glLineWidth(1.0);
 | 
			
		||||
	glEnable(GL_LIGHTING);*/
 | 
			
		||||
	glEnable(GL_LIGHTING);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	glDisable(GL_LIGHTING);
 | 
			
		||||
	/*  if(GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@ typedef struct {
 | 
			
		||||
	DerivedMesh dm;
 | 
			
		||||
 | 
			
		||||
	/* these point to data in the DerivedMesh custom data layers,
 | 
			
		||||
	   they are only here for efficiency and convenience **/
 | 
			
		||||
	 * they are only here for efficiency and convenience **/
 | 
			
		||||
	MVert *mvert;
 | 
			
		||||
	MEdge *medge;
 | 
			
		||||
	MFace *mface;
 | 
			
		||||
@@ -237,13 +237,13 @@ static int can_pbvh_draw(Object *ob, DerivedMesh *dm)
 | 
			
		||||
	int deformed= 0;
 | 
			
		||||
 | 
			
		||||
	/* active modifiers means extra deformation, which can't be handled correct
 | 
			
		||||
	   on bith of PBVH and sculpt "layer" levels, so use PBVH only for internal brush
 | 
			
		||||
	   stuff and show final DerivedMesh so user would see actual object shape */
 | 
			
		||||
	 * on bith of PBVH and sculpt "layer" levels, so use PBVH only for internal brush
 | 
			
		||||
	 * stuff and show final DerivedMesh so user would see actual object shape */
 | 
			
		||||
	deformed|= ob->sculpt->modifiers_active;
 | 
			
		||||
 | 
			
		||||
	/* as in case with modifiers, we can't synchronize deformation made against
 | 
			
		||||
	   PBVH and non-locked keyblock, so also use PBVH only for brushes and
 | 
			
		||||
	   final DM to give final result to user */
 | 
			
		||||
	 * PBVH and non-locked keyblock, so also use PBVH only for brushes and
 | 
			
		||||
	 * final DM to give final result to user */
 | 
			
		||||
	deformed|= ob->sculpt->kb && (ob->shapeflag&OB_SHAPE_LOCK) == 0;
 | 
			
		||||
 | 
			
		||||
	if(deformed)
 | 
			
		||||
@@ -269,8 +269,8 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* always build pbvh from original mesh, and only use it for drawing if
 | 
			
		||||
	   this derivedmesh is just original mesh. it's the multires subsurf dm
 | 
			
		||||
	   that this is actually for, to support a pbvh on a modified mesh */
 | 
			
		||||
	 * this derivedmesh is just original mesh. it's the multires subsurf dm
 | 
			
		||||
	 * that this is actually for, to support a pbvh on a modified mesh */
 | 
			
		||||
	if(!cddm->pbvh && ob->type == OB_MESH) {
 | 
			
		||||
		SculptSession *ss= ob->sculpt;
 | 
			
		||||
		Mesh *me= ob->data;
 | 
			
		||||
@@ -297,7 +297,7 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* update vertex normals so that drawing smooth faces works during sculpt
 | 
			
		||||
   TODO: proper fix is to support the pbvh in all drawing modes */
 | 
			
		||||
 * TODO: proper fix is to support the pbvh in all drawing modes */
 | 
			
		||||
static void cdDM_update_normals_from_pbvh(DerivedMesh *dm)
 | 
			
		||||
{
 | 
			
		||||
	CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
 | 
			
		||||
@@ -760,7 +760,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
 | 
			
		||||
 | 
			
		||||
				if(!flush && compareDrawOptions) {
 | 
			
		||||
					/* also compare draw options and flush buffer if they're different
 | 
			
		||||
					   need for face selection highlight in edit mode */
 | 
			
		||||
					 * need for face selection highlight in edit mode */
 | 
			
		||||
					flush|= compareDrawOptions(userData, actualFace, next_actualFace) == 0;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
@@ -931,8 +931,8 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
 | 
			
		||||
						draw_option= setDrawOptions(userData, orig);
 | 
			
		||||
	
 | 
			
		||||
					/* Goal is to draw as long of a contiguous triangle
 | 
			
		||||
					   array as possible, so draw when we hit either an
 | 
			
		||||
					   invisible triangle or at the end of the array */
 | 
			
		||||
					 * array as possible, so draw when we hit either an
 | 
			
		||||
					 * invisible triangle or at the end of the array */
 | 
			
		||||
 | 
			
		||||
					/* flush buffer if current triangle isn't drawable or it's last triangle... */
 | 
			
		||||
					flush= (draw_option == DM_DRAW_OPTION_SKIP) || (i == tottri - 1);
 | 
			
		||||
@@ -1517,7 +1517,7 @@ void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
 | 
			
		||||
	cddm->mface = CustomData_get_layer(&dm->faceData, CD_MFACE);
 | 
			
		||||
 | 
			
		||||
	/* Tessellation recreated faceData, and the active layer indices need to get re-propagated
 | 
			
		||||
	   from loops and polys to faces */
 | 
			
		||||
	 * from loops and polys to faces */
 | 
			
		||||
	CustomData_bmesh_update_active_layers(&dm->faceData, &dm->polyData, &dm->loopData);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1826,8 +1826,8 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
 | 
			
		||||
 | 
			
		||||
	mask = use_mdisps ? CD_MASK_DERIVEDMESH|CD_MASK_MDISPS : CD_MASK_DERIVEDMESH;
 | 
			
		||||
	
 | 
			
		||||
	/*don't process shapekeys, we only feed them through the modifier stack as needed,
 | 
			
		||||
	  e.g. for applying modifiers or the like*/
 | 
			
		||||
	/* don't process shapekeys, we only feed them through the modifier stack as needed,
 | 
			
		||||
	 * e.g. for applying modifiers or the like*/
 | 
			
		||||
	mask &= ~CD_MASK_SHAPEKEY;
 | 
			
		||||
	CustomData_merge(&bm->vdata, &dm->vertData, mask,
 | 
			
		||||
	                 CD_CALLOC, dm->numVertData);
 | 
			
		||||
@@ -1992,7 +1992,7 @@ static DerivedMesh *cddm_copy_ex(DerivedMesh *source, int faces_from_tessfaces)
 | 
			
		||||
	/* any callers that need tessface data can calculate it - campbell */
 | 
			
		||||
#if 0
 | 
			
		||||
	/* BMESH_TODO: Find out why this is necessary (or else find a way to remove
 | 
			
		||||
	   it). If it is necessary, add a comment explaining why. */
 | 
			
		||||
	 * it). If it is necessary, add a comment explaining why. */
 | 
			
		||||
	CDDM_recalc_tessellation((DerivedMesh *)cddm);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -595,8 +595,8 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
 | 
			
		||||
			if(part->ren_as == PART_DRAW_OB && part->dup_ob) {
 | 
			
		||||
				node2 = dag_get_node(dag, part->dup_ob);
 | 
			
		||||
				/* note that this relation actually runs in the wrong direction, the problem
 | 
			
		||||
				   is that dupli system all have this (due to parenting), and the render
 | 
			
		||||
				   engine instancing assumes particular ordering of objects in list */
 | 
			
		||||
				 * is that dupli system all have this (due to parenting), and the render
 | 
			
		||||
				 * engine instancing assumes particular ordering of objects in list */
 | 
			
		||||
				dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualisation");
 | 
			
		||||
				if(part->dup_ob->type == OB_MBALL)
 | 
			
		||||
					dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Object Visualisation");
 | 
			
		||||
@@ -756,8 +756,8 @@ struct DagForest *build_dag(Main *bmain, Scene *sce, short mask)
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/* Now all relations were built, but we need to solve 1 exceptional case;
 | 
			
		||||
	   When objects have multiple "parents" (for example parent + constraint working on same object)
 | 
			
		||||
	   the relation type has to be synced. One of the parents can change, and should give same event to child */
 | 
			
		||||
	 * When objects have multiple "parents" (for example parent + constraint working on same object)
 | 
			
		||||
	 * the relation type has to be synced. One of the parents can change, and should give same event to child */
 | 
			
		||||
	
 | 
			
		||||
	/* nodes were callocced, so we can use node->color for temporal storage */
 | 
			
		||||
	for(node = sce->theDag->DagNode.first; node; node= node->next) {
 | 
			
		||||
@@ -1159,9 +1159,8 @@ void graph_bfs(void)
 | 
			
		||||
			}
 | 
			
		||||
			set_node_xy(node, node->BFS_dist*DEPSX*2, pos[node->BFS_dist]*DEPSY*2);
 | 
			
		||||
			node->color = DAG_BLACK;
 | 
			
		||||
			/*
 | 
			
		||||
			fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
 | 
			
		||||
			*/
 | 
			
		||||
 | 
			
		||||
			// fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	queue_delete(nqueue);
 | 
			
		||||
@@ -1220,9 +1219,8 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
 | 
			
		||||
			}
 | 
			
		||||
			post_func(node->ob,data);
 | 
			
		||||
			node->color = DAG_BLACK;
 | 
			
		||||
			/*
 | 
			
		||||
			fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
 | 
			
		||||
			*/
 | 
			
		||||
 | 
			
		||||
			// fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	queue_delete(nqueue);
 | 
			
		||||
@@ -1337,9 +1335,8 @@ DagNodeQueue * graph_dfs(void)
 | 
			
		||||
				}
 | 
			
		||||
				set_node_xy(node, node->DFS_dist*DEPSX*2, pos[node->DFS_dist]*DEPSY*2);
 | 
			
		||||
				
 | 
			
		||||
				/*
 | 
			
		||||
				fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
 | 
			
		||||
				*/
 | 
			
		||||
				// fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
 | 
			
		||||
 | 
			
		||||
				push_stack(retqueue,node);
 | 
			
		||||
				
 | 
			
		||||
			}
 | 
			
		||||
@@ -1652,7 +1649,7 @@ void graph_print_adj_list(void)
 | 
			
		||||
/* ************************ API *********************** */
 | 
			
		||||
 | 
			
		||||
/* mechanism to allow editors to be informed of depsgraph updates,
 | 
			
		||||
   to do their own updates based on changes... */
 | 
			
		||||
 * to do their own updates based on changes... */
 | 
			
		||||
static void (*EditorsUpdateIDCb)(Main *bmain, ID *id)= NULL;
 | 
			
		||||
static void (*EditorsUpdateSceneCb)(Main *bmain, Scene *scene, int updated)= NULL;
 | 
			
		||||
 | 
			
		||||
@@ -2363,7 +2360,7 @@ static void dag_current_scene_layers(Main *bmain, Scene **sce, unsigned int *lay
 | 
			
		||||
	wmWindow *win;
 | 
			
		||||
 | 
			
		||||
	/* only one scene supported currently, making more scenes work
 | 
			
		||||
	   correctly requires changes beyond just the dependency graph */
 | 
			
		||||
	 * correctly requires changes beyond just the dependency graph */
 | 
			
		||||
 | 
			
		||||
	*sce= NULL;
 | 
			
		||||
	*lay= 0;
 | 
			
		||||
@@ -2383,8 +2380,8 @@ static void dag_current_scene_layers(Main *bmain, Scene **sce, unsigned int *lay
 | 
			
		||||
		if(*sce) *lay= (*sce)->lay;
 | 
			
		||||
 | 
			
		||||
		/* XXX for background mode, we should get the scene
 | 
			
		||||
		   from somewhere, for the -S option, but it's in
 | 
			
		||||
		   the context, how to get it here? */
 | 
			
		||||
		 * from somewhere, for the -S option, but it's in
 | 
			
		||||
		 * the context, how to get it here? */
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -2414,9 +2411,9 @@ void DAG_on_visible_update(Main *bmain, const short do_time)
 | 
			
		||||
	if(scene && scene->theDag) {
 | 
			
		||||
		Scene *sce_iter;
 | 
			
		||||
		/* derivedmeshes and displists are not saved to file so need to be
 | 
			
		||||
		   remade, tag them so they get remade in the scene update loop,
 | 
			
		||||
		   note armature poses or object matrices are preserved and do not
 | 
			
		||||
		   require updates, so we skip those */
 | 
			
		||||
		 * remade, tag them so they get remade in the scene update loop,
 | 
			
		||||
		 * note armature poses or object matrices are preserved and do not
 | 
			
		||||
		 * require updates, so we skip those */
 | 
			
		||||
		dag_scene_flush_layers(scene, lay);
 | 
			
		||||
 | 
			
		||||
		for(SETLOOPER(scene, sce_iter, base)) {
 | 
			
		||||
@@ -2471,7 +2468,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
 | 
			
		||||
	short idtype;
 | 
			
		||||
 | 
			
		||||
	/* here we flush a few things before actual scene wide flush, mostly
 | 
			
		||||
	   due to only objects and not other datablocks being in the depsgraph */
 | 
			
		||||
	 * due to only objects and not other datablocks being in the depsgraph */
 | 
			
		||||
 | 
			
		||||
	/* set flags & pointcache for object */
 | 
			
		||||
	if(GS(id->name) == ID_OB) {
 | 
			
		||||
@@ -2591,8 +2588,8 @@ static void dag_id_flush_update(Scene *sce, ID *id)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* camera's matrix is used to orient reconstructed stuff,
 | 
			
		||||
		   so it should happen tracking-related constraints recalculation
 | 
			
		||||
		   when camera is changing (sergey) */
 | 
			
		||||
		 * so it should happen tracking-related constraints recalculation
 | 
			
		||||
		 * when camera is changing (sergey) */
 | 
			
		||||
		if(sce->camera && &sce->camera->id == id) {
 | 
			
		||||
			MovieClip *clip = object_get_movieclip(sce, sce->camera, 1);
 | 
			
		||||
 | 
			
		||||
@@ -2625,7 +2622,7 @@ void DAG_ids_flush_tagged(Main *bmain)
 | 
			
		||||
		ID *id = lb->first;
 | 
			
		||||
 | 
			
		||||
		/* we tag based on first ID type character to avoid 
 | 
			
		||||
		   looping over all ID's in case there are no tags */
 | 
			
		||||
		 * looping over all ID's in case there are no tags */
 | 
			
		||||
		if(id && bmain->id_tag_update[id->name[0]]) {
 | 
			
		||||
			for(; id; id=id->next) {
 | 
			
		||||
				if(id->flag & (LIB_ID_RECALC|LIB_ID_RECALC_DATA)) {
 | 
			
		||||
@@ -2654,7 +2651,7 @@ void DAG_ids_check_recalc(Main *bmain, Scene *scene, int time)
 | 
			
		||||
		ID *id = lb->first;
 | 
			
		||||
 | 
			
		||||
		/* we tag based on first ID type character to avoid 
 | 
			
		||||
		   looping over all ID's in case there are no tags */
 | 
			
		||||
		 * looping over all ID's in case there are no tags */
 | 
			
		||||
		if(id && bmain->id_tag_update[id->name[0]]) {
 | 
			
		||||
			updated= 1;
 | 
			
		||||
			break;
 | 
			
		||||
@@ -2677,7 +2674,7 @@ void DAG_ids_clear_recalc(Main *bmain)
 | 
			
		||||
		ID *id = lb->first;
 | 
			
		||||
 | 
			
		||||
		/* we tag based on first ID type character to avoid 
 | 
			
		||||
		   looping over all ID's in case there are no tags */
 | 
			
		||||
		 * looping over all ID's in case there are no tags */
 | 
			
		||||
		if(id && bmain->id_tag_update[id->name[0]]) {
 | 
			
		||||
			for(; id; id=id->next)
 | 
			
		||||
				if(id->flag & (LIB_ID_RECALC|LIB_ID_RECALC_DATA))
 | 
			
		||||
 
 | 
			
		||||
@@ -613,10 +613,10 @@ static void curve_to_filledpoly(Curve *cu, ListBase *UNUSED(nurb), ListBase *dis
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* taper rules:
 | 
			
		||||
  - only 1 curve
 | 
			
		||||
  - first point left, last point right
 | 
			
		||||
  - based on subdivided points in original curve, not on points in taper curve (still)
 | 
			
		||||
*/
 | 
			
		||||
 * - only 1 curve
 | 
			
		||||
 * - first point left, last point right
 | 
			
		||||
 * - based on subdivided points in original curve, not on points in taper curve (still)
 | 
			
		||||
 */
 | 
			
		||||
float calc_taper(Scene *scene, Object *taperobj, int cur, int tot)
 | 
			
		||||
{
 | 
			
		||||
	DispList *dl;
 | 
			
		||||
@@ -710,8 +710,8 @@ static ModifierData *curve_get_tesselate_point(Scene *scene, Object *ob, int for
 | 
			
		||||
			preTesselatePoint = md;
 | 
			
		||||
 | 
			
		||||
			/* this modifiers are moving point of tessellation automatically
 | 
			
		||||
			   (some of them even can't be applied on tesselated curve), set flag
 | 
			
		||||
			   for incformation button in modifier's header */
 | 
			
		||||
			 * (some of them even can't be applied on tesselated curve), set flag
 | 
			
		||||
			 * for incformation button in modifier's header */
 | 
			
		||||
			md->mode |= eModifierMode_ApplyOnSpline;
 | 
			
		||||
		} else if(md->mode&eModifierMode_ApplyOnSpline) {
 | 
			
		||||
			preTesselatePoint = md;
 | 
			
		||||
@@ -746,9 +746,9 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, int forRender, fl
 | 
			
		||||
 | 
			
		||||
		if(keyVerts) {
 | 
			
		||||
			/* split coords from key data, the latter also includes
 | 
			
		||||
			   tilts, which is passed through in the modifier stack.
 | 
			
		||||
			   this is also the reason curves do not use a virtual
 | 
			
		||||
			   shape key modifier yet. */
 | 
			
		||||
			 * tilts, which is passed through in the modifier stack.
 | 
			
		||||
			 * this is also the reason curves do not use a virtual
 | 
			
		||||
			 * shape key modifier yet. */
 | 
			
		||||
			deformedVerts= curve_getKeyVertexCos(cu, nurb, keyVerts);
 | 
			
		||||
			originalVerts= MEM_dupallocN(deformedVerts);
 | 
			
		||||
		}
 | 
			
		||||
@@ -1168,8 +1168,8 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* make copy of 'undeformed" displist for texture space calculation
 | 
			
		||||
	   actually, it's not totally undeformed -- pre-tessellation modifiers are
 | 
			
		||||
	   already applied, thats how it worked for years, so keep for compatibility (sergey) */
 | 
			
		||||
	 * actually, it's not totally undeformed -- pre-tessellation modifiers are
 | 
			
		||||
	 * already applied, thats how it worked for years, so keep for compatibility (sergey) */
 | 
			
		||||
	copy_displist(&cu->disp, dispbase);
 | 
			
		||||
 | 
			
		||||
	if (!forRender) {
 | 
			
		||||
@@ -1394,8 +1394,8 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
 | 
			
		||||
		if(cu->flag & CU_PATH) calc_curvepath(ob);
 | 
			
		||||
 | 
			
		||||
		/* make copy of 'undeformed" displist for texture space calculation
 | 
			
		||||
		   actually, it's not totally undeformed -- pre-tessellation modifiers are
 | 
			
		||||
		   already applied, thats how it worked for years, so keep for compatibility (sergey) */
 | 
			
		||||
		 * actually, it's not totally undeformed -- pre-tessellation modifiers are
 | 
			
		||||
		 * already applied, thats how it worked for years, so keep for compatibility (sergey) */
 | 
			
		||||
		copy_displist(&cu->disp, dispbase);
 | 
			
		||||
 | 
			
		||||
		if (!forRender) {
 | 
			
		||||
@@ -1416,8 +1416,8 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
 | 
			
		||||
	ListBase *dispbase;
 | 
			
		||||
 | 
			
		||||
	/* The same check for duplis as in do_makeDispListCurveTypes.
 | 
			
		||||
	   Happens when curve used for constraint/bevel was converted to mesh.
 | 
			
		||||
	   check there is still needed for render displist and orco displists. */
 | 
			
		||||
	 * Happens when curve used for constraint/bevel was converted to mesh.
 | 
			
		||||
	 * check there is still needed for render displist and orco displists. */
 | 
			
		||||
	if(!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
 | 
			
		||||
 | 
			
		||||
	freedisplist(&(ob->disp));
 | 
			
		||||
 
 | 
			
		||||
@@ -4145,9 +4145,9 @@ static int dynamicPaint_prepareEffectStep(DynamicPaintSurface *surface, Scene *s
 | 
			
		||||
	return steps;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	Processes active effect step.
 | 
			
		||||
*/
 | 
			
		||||
/**
 | 
			
		||||
 *	Processes active effect step.
 | 
			
		||||
 */
 | 
			
		||||
static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force, PaintPoint *prevPoint, float timescale, float steps)
 | 
			
		||||
{
 | 
			
		||||
	PaintSurfaceData *sData = surface->data;
 | 
			
		||||
 
 | 
			
		||||
@@ -106,8 +106,8 @@ MultiresModifierData *find_multires_modifier_before(Scene *scene, ModifierData *
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* used for applying scale on mdisps layer and syncing subdivide levels when joining objects
 | 
			
		||||
   use_first - return first multires modifier if all multires'es are disabled
 | 
			
		||||
*/
 | 
			
		||||
 * use_first - return first multires modifier if all multires'es are disabled
 | 
			
		||||
 */
 | 
			
		||||
MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, int use_first)
 | 
			
		||||
{
 | 
			
		||||
	ModifierData *md;
 | 
			
		||||
@@ -128,7 +128,7 @@ MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, int use_fi
 | 
			
		||||
 | 
			
		||||
	if (!mmd && use_first) {
 | 
			
		||||
		/* active multires have not been found
 | 
			
		||||
		   try to use first one */
 | 
			
		||||
		 * try to use first one */
 | 
			
		||||
		return firstmmd;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -491,7 +491,7 @@ static DerivedMesh *subsurf_dm_create_local(Object *ob, DerivedMesh *dm, int lvl
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* assumes no is normalized; return value's sign is negative if v is on
 | 
			
		||||
   the other side of the plane */
 | 
			
		||||
 * the other side of the plane */
 | 
			
		||||
static float v3_dist_from_plane(float v[3], float center[3], float no[3])
 | 
			
		||||
{
 | 
			
		||||
	float s[3];
 | 
			
		||||
@@ -572,7 +572,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob)
 | 
			
		||||
			float no[3];
 | 
			
		||||
 | 
			
		||||
			/* set up poly, loops, and coords in order to call
 | 
			
		||||
			   mesh_calc_poly_normal_coords() */
 | 
			
		||||
			 * mesh_calc_poly_normal_coords() */
 | 
			
		||||
			fake_poly.totloop = p->totloop;
 | 
			
		||||
			fake_poly.loopstart = 0;
 | 
			
		||||
			fake_loops = MEM_mallocN(sizeof(MLoop) * p->totloop, "fake_loops");
 | 
			
		||||
@@ -813,20 +813,20 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm
 | 
			
		||||
					switch(op) {
 | 
			
		||||
					case APPLY_DISPLACEMENTS:
 | 
			
		||||
						/* Convert displacement to object space
 | 
			
		||||
						   and add to grid points */
 | 
			
		||||
						 * and add to grid points */
 | 
			
		||||
						mul_v3_m3v3(disp, mat, data);
 | 
			
		||||
						add_v3_v3v3(co, sco, disp);
 | 
			
		||||
						break;
 | 
			
		||||
					case CALC_DISPLACEMENTS:
 | 
			
		||||
						/* Calculate displacement between new and old
 | 
			
		||||
						   grid points and convert to tangent space */
 | 
			
		||||
						 * grid points and convert to tangent space */
 | 
			
		||||
						sub_v3_v3v3(disp, co, sco);
 | 
			
		||||
						invert_m3(mat);
 | 
			
		||||
						mul_v3_m3v3(data, mat, disp);
 | 
			
		||||
						break;
 | 
			
		||||
					case ADD_DISPLACEMENTS:
 | 
			
		||||
						/* Convert subdivided displacements to tangent
 | 
			
		||||
						   space and add to the original displacements */
 | 
			
		||||
						 * space and add to the original displacements */
 | 
			
		||||
						invert_m3(mat);
 | 
			
		||||
						mul_v3_m3v3(d, mat, co);
 | 
			
		||||
						add_v3_v3(data, d);
 | 
			
		||||
@@ -1138,7 +1138,7 @@ DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int loca
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**** Old Multires code ****
 | 
			
		||||
***************************/
 | 
			
		||||
 ***************************/
 | 
			
		||||
 | 
			
		||||
/* Adapted from sculptmode.c */
 | 
			
		||||
void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v)
 | 
			
		||||
@@ -1669,7 +1669,7 @@ static void multires_load_old_vcols(Mesh *me)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	/* older multires format never supported multiple vcol layers,
 | 
			
		||||
	   so we can assume the active vcol layer is the correct one */
 | 
			
		||||
	 * so we can assume the active vcol layer is the correct one */
 | 
			
		||||
	if (!(mcol = CustomData_get_layer(&me->fdata, CD_MCOL)))
 | 
			
		||||
		return;
 | 
			
		||||
	
 | 
			
		||||
@@ -1776,9 +1776,9 @@ static void multires_sync_levels(Scene *scene, Object *ob, Object *to_ob)
 | 
			
		||||
 | 
			
		||||
	if (!mmd) {
 | 
			
		||||
		/* object could have MDISP even when there is no multires modifier
 | 
			
		||||
		   this could lead to troubles due to i've got no idea how mdisp could be
 | 
			
		||||
		   upsampled correct without modifier data.
 | 
			
		||||
		   just remove mdisps if no multires present (nazgul) */
 | 
			
		||||
		 * this could lead to troubles due to i've got no idea how mdisp could be
 | 
			
		||||
		 * upsampled correct without modifier data.
 | 
			
		||||
		 * just remove mdisps if no multires present (nazgul) */
 | 
			
		||||
 | 
			
		||||
		Mesh *me= (Mesh*)ob->data;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -119,8 +119,8 @@ static struct ImBuf * prepare_effect_imbufs(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   PLUGINS
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * PLUGINS
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void open_plugin_seq(PluginSeq *pis, const char *seqname)
 | 
			
		||||
{
 | 
			
		||||
@@ -288,8 +288,8 @@ static struct ImBuf * do_plugin_effect(
 | 
			
		||||
	char *cp;
 | 
			
		||||
	int float_rendering;
 | 
			
		||||
	int use_temp_bufs = 0; /* Are needed since blur.c (and maybe some other
 | 
			
		||||
				  old plugins) do very bad stuff
 | 
			
		||||
				  with imbuf-internals */
 | 
			
		||||
	                        * old plugins) do very bad stuff
 | 
			
		||||
	                        * with imbuf-internals */
 | 
			
		||||
 | 
			
		||||
	struct ImBuf * out = prepare_effect_imbufs(context,ibuf1, ibuf2, ibuf3);
 | 
			
		||||
	int x = context.rectx;
 | 
			
		||||
@@ -394,8 +394,8 @@ static void free_plugin(struct Sequence * seq)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   ALPHA OVER
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * ALPHA OVER
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void init_alpha_over_or_under(Sequence * seq)
 | 
			
		||||
{
 | 
			
		||||
@@ -558,8 +558,8 @@ static struct ImBuf * do_alphaover_effect(
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   ALPHA UNDER
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * ALPHA UNDER
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void do_alphaunder_effect_byte(
 | 
			
		||||
	float facf0, float facf1, int x, int y, char *rect1, 
 | 
			
		||||
@@ -730,8 +730,8 @@ static struct ImBuf* do_alphaunder_effect(
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   CROSS
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * CROSS
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void do_cross_effect_byte(float facf0, float facf1, int x, int y, 
 | 
			
		||||
			  char *rect1, char *rect2, 
 | 
			
		||||
@@ -855,8 +855,8 @@ static struct ImBuf* do_cross_effect(
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   GAMMA CROSS
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * GAMMA CROSS
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
/* copied code from initrender.c */
 | 
			
		||||
static unsigned short gamtab[65536];
 | 
			
		||||
@@ -1124,8 +1124,8 @@ static struct ImBuf * do_gammacross_effect(
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   ADD
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * ADD
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void do_add_effect_byte(float facf0, float facf1, int x, int y, 
 | 
			
		||||
				   unsigned char *rect1, unsigned char *rect2, 
 | 
			
		||||
@@ -1240,8 +1240,8 @@ static struct ImBuf * do_add_effect(SeqRenderData context,
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   SUB
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * SUB
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void do_sub_effect_byte(float facf0, float facf1, 
 | 
			
		||||
				   int x, int y, 
 | 
			
		||||
@@ -1355,8 +1355,8 @@ static struct ImBuf * do_sub_effect(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   DROP
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * DROP
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
/* Must be > 0 or add precopy, etc to the function */
 | 
			
		||||
#define XOFF	8
 | 
			
		||||
@@ -1444,8 +1444,8 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   MUL
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * MUL
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void do_mul_effect_byte(float facf0, float facf1, int x, int y, 
 | 
			
		||||
				   unsigned char *rect1, unsigned char *rect2, 
 | 
			
		||||
@@ -1464,7 +1464,7 @@ static void do_mul_effect_byte(float facf0, float facf1, int x, int y,
 | 
			
		||||
 | 
			
		||||
	/* formula:
 | 
			
		||||
	 *		fac*(a*b) + (1-fac)*a  => fac*a*(b-1)+axaux= c*px + py*s ;//+centx
 | 
			
		||||
			yaux= -s*px + c*py;//+centy
 | 
			
		||||
	 *		yaux= -s*px + c*py;//+centy
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	while(y--) {
 | 
			
		||||
@@ -1569,8 +1569,8 @@ static struct ImBuf * do_mul_effect(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   WIPE
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * WIPE
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
typedef struct WipeZone {
 | 
			
		||||
	float angle;
 | 
			
		||||
@@ -1616,9 +1616,8 @@ static float check_zone(WipeZone *wipezone, int x, int y,
 | 
			
		||||
	Sequence *seq, float facf0) 
 | 
			
		||||
{
 | 
			
		||||
	float posx, posy,hyp,hyp2,angle,hwidth,b1,b2,b3,pointdist;
 | 
			
		||||
/*some future stuff
 | 
			
		||||
float hyp3,hyp4,b4,b5	   
 | 
			
		||||
*/
 | 
			
		||||
	/* some future stuff */
 | 
			
		||||
	// float hyp3,hyp4,b4,b5
 | 
			
		||||
	float temp1,temp2,temp3,temp4; //some placeholder variables
 | 
			
		||||
	int xo = wipezone->xo;
 | 
			
		||||
	int yo = wipezone->yo;
 | 
			
		||||
@@ -1715,10 +1714,10 @@ float hyp3,hyp4,b4,b5
 | 
			
		||||
		break;
 | 
			
		||||
		case DO_CLOCK_WIPE:
 | 
			
		||||
			/*
 | 
			
		||||
				  temp1: angle of effect center in rads
 | 
			
		||||
				  temp2: angle of line through (halfx,halfy) and (x,y) in rads
 | 
			
		||||
				  temp3: angle of low side of blur
 | 
			
		||||
				  temp4: angle of high side of blur
 | 
			
		||||
			 *  temp1: angle of effect center in rads
 | 
			
		||||
			 *  temp2: angle of line through (halfx,halfy) and (x,y) in rads
 | 
			
		||||
			 *  temp3: angle of low side of blur
 | 
			
		||||
			 *  temp4: angle of high side of blur
 | 
			
		||||
			 */
 | 
			
		||||
			output = 1.0f - facf0;
 | 
			
		||||
			widthf = wipe->edgeWidth*2.0f*(float)M_PI;
 | 
			
		||||
@@ -2002,8 +2001,8 @@ static struct ImBuf * do_wipe_effect(
 | 
			
		||||
	return out;
 | 
			
		||||
}
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   TRANSFORM
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * TRANSFORM
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
static void init_transform_effect(Sequence *seq)
 | 
			
		||||
{
 | 
			
		||||
	TransformVars *transform;
 | 
			
		||||
@@ -2140,8 +2139,8 @@ static struct ImBuf * do_transform_effect(
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   GLOW
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * GLOW
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
 | 
			
		||||
				 float blur,
 | 
			
		||||
@@ -2667,8 +2666,8 @@ static struct ImBuf * do_glow_effect(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   SOLID COLOR
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * SOLID COLOR
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static void init_solid_color(Sequence *seq)
 | 
			
		||||
{
 | 
			
		||||
@@ -2786,8 +2785,8 @@ static struct ImBuf * do_solid_color(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   MULTICAM
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * MULTICAM
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
/* no effect inputs for multicam, we use give_ibuf_seq */
 | 
			
		||||
static int num_inputs_multicam(void)
 | 
			
		||||
@@ -2840,8 +2839,8 @@ static struct ImBuf * do_multicam(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   ADJUSTMENT
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * ADJUSTMENT
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
/* no effect inputs for adjustment, we use give_ibuf_seq */
 | 
			
		||||
static int num_inputs_adjustment(void)
 | 
			
		||||
@@ -2871,8 +2870,8 @@ static struct ImBuf * do_adjustment_impl(SeqRenderData context, Sequence * seq,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* found nothing? so let's work the way up the metastrip stack, so
 | 
			
		||||
	   that it is possible to group a bunch of adjustment strips into
 | 
			
		||||
	   a metastrip and have that work on everything below the metastrip
 | 
			
		||||
	 *  that it is possible to group a bunch of adjustment strips into
 | 
			
		||||
	 *  a metastrip and have that work on everything below the metastrip
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	if (!i) {
 | 
			
		||||
@@ -2917,8 +2916,8 @@ static struct ImBuf * do_adjustment(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   SPEED
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * SPEED
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
static void init_speed_effect(Sequence *seq)
 | 
			
		||||
{
 | 
			
		||||
	SpeedControlVars * v;
 | 
			
		||||
@@ -3010,8 +3009,7 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
 | 
			
		||||
	}
 | 
			
		||||
	if (	(seq->seq1 == NULL) ||
 | 
			
		||||
	        (seq->len < 1)
 | 
			
		||||
	) { /* make coverity happy and check for (CID 598)
 | 
			
		||||
						 input strip ... */
 | 
			
		||||
	) { /* make coverity happy and check for (CID 598) input strip ... */
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -124,8 +124,8 @@ int seq_recursive_apply(Sequence *seq, int (*apply_func)(Sequence *, void *), vo
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   alloc / free functions
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * alloc / free functions
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -282,7 +282,7 @@ void seq_free_editing(Scene *scene)
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
 * sequencer pipeline functions
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
SeqRenderData seq_new_render_data(
 | 
			
		||||
	struct Main * bmain, struct Scene * scene,
 | 
			
		||||
@@ -456,13 +456,13 @@ void seq_end(SeqIterator *iter)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
  **********************************************************************
 | 
			
		||||
 * **********************************************************************
 | 
			
		||||
 * build_seqar
 | 
			
		||||
  **********************************************************************
 | 
			
		||||
 * *********************************************************************
 | 
			
		||||
 * Build a complete array of _all_ sequencies (including those
 | 
			
		||||
 * in metastrips!)
 | 
			
		||||
  **********************************************************************
 | 
			
		||||
*/
 | 
			
		||||
 * *********************************************************************
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static void do_seq_count_cb(ListBase *seqbase, int *totseq,
 | 
			
		||||
				int (*test_func)(Sequence * seq))
 | 
			
		||||
@@ -1049,10 +1049,10 @@ StripElem *give_stripelem(Sequence *seq, int cfra)
 | 
			
		||||
	StripElem *se= seq->strip->stripdata;
 | 
			
		||||
 | 
			
		||||
	if(seq->type == SEQ_IMAGE) { /* only
 | 
			
		||||
					IMAGE strips use the whole array,
 | 
			
		||||
					MOVIE strips use only 
 | 
			
		||||
					the first element, all other strips
 | 
			
		||||
					don't use this... */
 | 
			
		||||
		                          * IMAGE strips use the whole array,
 | 
			
		||||
		                          * MOVIE strips use only
 | 
			
		||||
		                          * the first element, all other strips
 | 
			
		||||
		                          * don't use this... */
 | 
			
		||||
		int nr = (int) give_stripelem_index(seq, cfra);
 | 
			
		||||
 | 
			
		||||
		if (nr == -1 || se == NULL) return NULL;
 | 
			
		||||
@@ -1137,8 +1137,8 @@ static int get_shown_sequences(	ListBase * seqbasep, int cfra, int chanshown, Se
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   proxy management
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * proxy management
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
typedef struct SeqIndexBuildContext {
 | 
			
		||||
	struct IndexBuildContext *index_context;
 | 
			
		||||
@@ -1214,12 +1214,12 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, int render_size, char *
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* MOVIE tracks (only exception: custom files) are now handled 
 | 
			
		||||
	   internally by ImBuf module for various reasons: proper time code 
 | 
			
		||||
	   support, quicker index build, using one file instead 
 | 
			
		||||
	   of a full directory of jpeg files, etc. Trying to support old
 | 
			
		||||
	   and new method at once could lead to funny effects, if people
 | 
			
		||||
	   have both, a directory full of jpeg files and proxy avis, so
 | 
			
		||||
	   sorry folks, please rebuild your proxies... */
 | 
			
		||||
	 * internally by ImBuf module for various reasons: proper time code
 | 
			
		||||
	 * support, quicker index build, using one file instead
 | 
			
		||||
	 * of a full directory of jpeg files, etc. Trying to support old
 | 
			
		||||
	 * and new method at once could lead to funny effects, if people
 | 
			
		||||
	 * have both, a directory full of jpeg files and proxy avis, so
 | 
			
		||||
	 * sorry folks, please rebuild your proxies... */
 | 
			
		||||
 | 
			
		||||
	if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) {
 | 
			
		||||
		BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir));
 | 
			
		||||
@@ -1339,7 +1339,7 @@ static void seq_proxy_build_frame(SeqRenderData context,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* depth = 32 is intentionally left in, otherwise ALPHA channels
 | 
			
		||||
	   won't work... */
 | 
			
		||||
	 * won't work... */
 | 
			
		||||
	quality = seq->strip->proxy->quality;
 | 
			
		||||
	ibuf->ftype= JPG | quality;
 | 
			
		||||
 | 
			
		||||
@@ -1465,8 +1465,8 @@ void seq_proxy_rebuild_finish(SeqIndexBuildContext *context, short stop)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   color balance 
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * color balance
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static StripColorBalance calc_cb(StripColorBalance * cb_)
 | 
			
		||||
{
 | 
			
		||||
@@ -1628,23 +1628,22 @@ static void color_balance(Sequence * seq, ImBuf* ibuf, float mul)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
  input preprocessing for SEQ_IMAGE, SEQ_MOVIE and SEQ_SCENE
 | 
			
		||||
 | 
			
		||||
  Do all the things you can't really do afterwards using sequence effects
 | 
			
		||||
  (read: before rescaling to render resolution has been done)
 | 
			
		||||
 | 
			
		||||
  Order is important!
 | 
			
		||||
 | 
			
		||||
  - Deinterlace
 | 
			
		||||
  - Crop and transform in image source coordinate space
 | 
			
		||||
  - Flip X + Flip Y (could be done afterwards, backward compatibility)
 | 
			
		||||
  - Promote image to float data (affects pipeline operations afterwards)
 | 
			
		||||
  - Color balance (is most efficient in the byte -> float 
 | 
			
		||||
	(future: half -> float should also work fine!)
 | 
			
		||||
	case, if done on load, since we can use lookup tables)
 | 
			
		||||
  - Premultiply
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 *  input preprocessing for SEQ_IMAGE, SEQ_MOVIE and SEQ_SCENE
 | 
			
		||||
 *
 | 
			
		||||
 *  Do all the things you can't really do afterwards using sequence effects
 | 
			
		||||
 *  (read: before rescaling to render resolution has been done)
 | 
			
		||||
 *
 | 
			
		||||
 *  Order is important!
 | 
			
		||||
 *
 | 
			
		||||
 *  - Deinterlace
 | 
			
		||||
 *  - Crop and transform in image source coordinate space
 | 
			
		||||
 *  - Flip X + Flip Y (could be done afterwards, backward compatibility)
 | 
			
		||||
 *  - Promote image to float data (affects pipeline operations afterwards)
 | 
			
		||||
 *  - Color balance (is most efficient in the byte -> float
 | 
			
		||||
 *    (future: half -> float should also work fine!)
 | 
			
		||||
 *    case, if done on load, since we can use lookup tables)
 | 
			
		||||
 *  - Premultiply
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
int input_have_to_preprocess(
 | 
			
		||||
	SeqRenderData UNUSED(context), Sequence * seq, float UNUSED(cfra))
 | 
			
		||||
@@ -1824,8 +1823,8 @@ static void copy_to_ibuf_still(SeqRenderData context, Sequence * seq, float nr,
 | 
			
		||||
{
 | 
			
		||||
	if (nr == 0 || nr == seq->len - 1) {
 | 
			
		||||
		/* we have to store a copy, since the passed ibuf
 | 
			
		||||
		   could be preprocessed afterwards (thereby silently
 | 
			
		||||
		   changing the cached image... */
 | 
			
		||||
		 * could be preprocessed afterwards (thereby silently
 | 
			
		||||
		 * changing the cached image... */
 | 
			
		||||
		ibuf = IMB_dupImBuf(ibuf);
 | 
			
		||||
 | 
			
		||||
		if (nr == 0) {
 | 
			
		||||
@@ -1845,8 +1844,8 @@ static void copy_to_ibuf_still(SeqRenderData context, Sequence * seq, float nr,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   strip rendering functions
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * strip rendering functions
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static ImBuf* seq_render_strip_stack( 
 | 
			
		||||
	SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
 | 
			
		||||
@@ -1964,34 +1963,34 @@ static ImBuf * seq_render_scene_strip_impl(
 | 
			
		||||
	ListBase oldmarkers;
 | 
			
		||||
	
 | 
			
		||||
	/* Old info:
 | 
			
		||||
	   Hack! This function can be called from do_render_seq(), in that case
 | 
			
		||||
	   the seq->scene can already have a Render initialized with same name,
 | 
			
		||||
	   so we have to use a default name. (compositor uses scene name to
 | 
			
		||||
	   find render).
 | 
			
		||||
	   However, when called from within the UI (image preview in sequencer)
 | 
			
		||||
	   we do want to use scene Render, that way the render result is defined
 | 
			
		||||
	   for display in render/imagewindow
 | 
			
		||||
	   
 | 
			
		||||
	   Hmm, don't see, why we can't do that all the time,
 | 
			
		||||
	   and since G.rendering is uhm, gone... (Peter)
 | 
			
		||||
	 * Hack! This function can be called from do_render_seq(), in that case
 | 
			
		||||
	 * the seq->scene can already have a Render initialized with same name,
 | 
			
		||||
	 * so we have to use a default name. (compositor uses scene name to
 | 
			
		||||
	 * find render).
 | 
			
		||||
	 * However, when called from within the UI (image preview in sequencer)
 | 
			
		||||
	 * we do want to use scene Render, that way the render result is defined
 | 
			
		||||
	 * for display in render/imagewindow
 | 
			
		||||
	 *
 | 
			
		||||
	 * Hmm, don't see, why we can't do that all the time,
 | 
			
		||||
	 * and since G.rendering is uhm, gone... (Peter)
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	/* New info:
 | 
			
		||||
	   Using the same name for the renders works just fine as the do_render_seq()
 | 
			
		||||
	   render is not used while the scene strips are rendered.
 | 
			
		||||
	   
 | 
			
		||||
	   However rendering from UI (through sequencer_preview_area_draw) can crash in
 | 
			
		||||
	   very many cases since other renders (material preview, an actual render etc.)
 | 
			
		||||
	   can be started while this sequence preview render is running. The only proper
 | 
			
		||||
	   solution is to make the sequencer preview render a proper job, which can be
 | 
			
		||||
	   stopped when needed. This would also give a nice progress bar for the preview
 | 
			
		||||
	   space so that users know there's something happening.
 | 
			
		||||
 | 
			
		||||
	   As a result the active scene now only uses OpenGL rendering for the sequencer
 | 
			
		||||
	   preview. This is far from nice, but is the only way to prevent crashes at this
 | 
			
		||||
	   time. 
 | 
			
		||||
 | 
			
		||||
	   -jahka
 | 
			
		||||
	 * Using the same name for the renders works just fine as the do_render_seq()
 | 
			
		||||
	 * render is not used while the scene strips are rendered.
 | 
			
		||||
	 *
 | 
			
		||||
	 * However rendering from UI (through sequencer_preview_area_draw) can crash in
 | 
			
		||||
	 * very many cases since other renders (material preview, an actual render etc.)
 | 
			
		||||
	 * can be started while this sequence preview render is running. The only proper
 | 
			
		||||
	 * solution is to make the sequencer preview render a proper job, which can be
 | 
			
		||||
	 * stopped when needed. This would also give a nice progress bar for the preview
 | 
			
		||||
	 * space so that users know there's something happening.
 | 
			
		||||
	 *
 | 
			
		||||
	 * As a result the active scene now only uses OpenGL rendering for the sequencer
 | 
			
		||||
	 * preview. This is far from nice, but is the only way to prevent crashes at this
 | 
			
		||||
	 * time.
 | 
			
		||||
	 *
 | 
			
		||||
	 * -jahka
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	int rendering = G.rendering;
 | 
			
		||||
@@ -2120,7 +2119,7 @@ static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfr
 | 
			
		||||
	ibuf = seq_stripelem_cache_get(context, seq, cfra, SEQ_STRIPELEM_IBUF);
 | 
			
		||||
 | 
			
		||||
	/* currently, we cache preprocessed images in SEQ_STRIPELEM_IBUF,
 | 
			
		||||
	   but not(!) on SEQ_STRIPELEM_IBUF_ENDSTILL and ..._STARTSTILL */
 | 
			
		||||
	 * but not(!) on SEQ_STRIPELEM_IBUF_ENDSTILL and ..._STARTSTILL */
 | 
			
		||||
	if (ibuf)
 | 
			
		||||
		use_preprocess = FALSE;
 | 
			
		||||
 | 
			
		||||
@@ -2263,15 +2262,15 @@ static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfr
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* **********************************************************************
 | 
			
		||||
   strip stack rendering functions
 | 
			
		||||
   ********************************************************************** */
 | 
			
		||||
 * strip stack rendering functions
 | 
			
		||||
 * ********************************************************************** */
 | 
			
		||||
 | 
			
		||||
static int seq_must_swap_input_in_blend_mode(Sequence * seq)
 | 
			
		||||
{
 | 
			
		||||
	int swap_input = FALSE;
 | 
			
		||||
 | 
			
		||||
	/* bad hack, to fix crazy input ordering of 
 | 
			
		||||
	   those two effects */
 | 
			
		||||
	 * those two effects */
 | 
			
		||||
 | 
			
		||||
	if (ELEM3(seq->blend_mode, SEQ_ALPHAOVER, SEQ_ALPHAUNDER, SEQ_OVERDROP)) {
 | 
			
		||||
		swap_input = TRUE;
 | 
			
		||||
@@ -2808,12 +2807,12 @@ void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage,
 | 
			
		||||
	if (check_mem_usage) {
 | 
			
		||||
		/* Let the cache limitor take care of this (schlaile) */
 | 
			
		||||
		/* While render let's keep all memory available for render 
 | 
			
		||||
		   (ton)
 | 
			
		||||
		   At least if free memory is tight...
 | 
			
		||||
		   This can make a big difference in encoding speed
 | 
			
		||||
		   (it is around 4 times(!) faster, if we do not waste time
 | 
			
		||||
		   on freeing _all_ buffers every time on long timelines...)
 | 
			
		||||
		   (schlaile)
 | 
			
		||||
		 * (ton)
 | 
			
		||||
		 * At least if free memory is tight...
 | 
			
		||||
		 * This can make a big difference in encoding speed
 | 
			
		||||
		 * (it is around 4 times(!) faster, if we do not waste time
 | 
			
		||||
		 * on freeing _all_ buffers every time on long timelines...)
 | 
			
		||||
		 * (schlaile)
 | 
			
		||||
		 */
 | 
			
		||||
	
 | 
			
		||||
		uintptr_t mem_in_use;
 | 
			
		||||
@@ -2905,11 +2904,11 @@ void update_changed_seq_and_deps(Scene *scene, Sequence *changed_seq, int len_ch
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* seq funcs's for transforming internally
 | 
			
		||||
 notice the difference between start/end and left/right.
 | 
			
		||||
 | 
			
		||||
 left and right are the bounds at which the sequence is rendered,
 | 
			
		||||
start and end are from the start and fixed length of the sequence.
 | 
			
		||||
*/
 | 
			
		||||
 * notice the difference between start/end and left/right.
 | 
			
		||||
 *
 | 
			
		||||
 * left and right are the bounds at which the sequence is rendered,
 | 
			
		||||
 * start and end are from the start and fixed length of the sequence.
 | 
			
		||||
 */
 | 
			
		||||
int seq_tx_get_start(Sequence *seq)
 | 
			
		||||
{
 | 
			
		||||
	return seq->start;
 | 
			
		||||
@@ -2962,7 +2961,7 @@ void seq_tx_set_final_right(Sequence *seq, int val)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* used so we can do a quick check for single image seq
 | 
			
		||||
   since they work a bit differently to normal image seq's (during transform) */
 | 
			
		||||
 * since they work a bit differently to normal image seq's (during transform) */
 | 
			
		||||
int seq_single_check(Sequence *seq)
 | 
			
		||||
{
 | 
			
		||||
	return (seq->len==1 && (
 | 
			
		||||
 
 | 
			
		||||
@@ -3800,17 +3800,17 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
 | 
			
		||||
 | 
			
		||||
/* void SB_estimate_transform */
 | 
			
		||||
/* input   Object *ob out (says any object that can do SB like mesh,lattice,curve )
 | 
			
		||||
   output  float lloc[3],float lrot[3][3],float lscale[3][3]
 | 
			
		||||
   that is:
 | 
			
		||||
   a precise position vector denoting the motion of the center of mass
 | 
			
		||||
   give a rotation/scale matrix using averaging method, that's why estimate and not calculate
 | 
			
		||||
   see: this is kind of reverse engeneering: having to states of a point cloud and recover what happend
 | 
			
		||||
   our advantage here we know the identity of the vertex
 | 
			
		||||
   there are others methods giving other results.
 | 
			
		||||
   lloc,lrot,lscale are allowed to be NULL, just in case you don't need it.
 | 
			
		||||
   should be pretty useful for pythoneers :)
 | 
			
		||||
   not! velocity .. 2nd order stuff
 | 
			
		||||
   vcloud_estimate_transform see
 | 
			
		||||
 * output  float lloc[3],float lrot[3][3],float lscale[3][3]
 | 
			
		||||
 * that is:
 | 
			
		||||
 * a precise position vector denoting the motion of the center of mass
 | 
			
		||||
 * give a rotation/scale matrix using averaging method, that's why estimate and not calculate
 | 
			
		||||
 * see: this is kind of reverse engeneering: having to states of a point cloud and recover what happend
 | 
			
		||||
 * our advantage here we know the identity of the vertex
 | 
			
		||||
 * there are others methods giving other results.
 | 
			
		||||
 * lloc,lrot,lscale are allowed to be NULL, just in case you don't need it.
 | 
			
		||||
 * should be pretty useful for pythoneers :)
 | 
			
		||||
 * not! velocity .. 2nd order stuff
 | 
			
		||||
 * vcloud_estimate_transform see
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscale[3][3])
 | 
			
		||||
 
 | 
			
		||||
@@ -65,68 +65,67 @@
 | 
			
		||||
#include "BPY_extern.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/***************/ /*
 | 
			
		||||
 | 
			
		||||
How Texts should work
 | 
			
		||||
--
 | 
			
		||||
A text should relate to a file as follows -
 | 
			
		||||
(Text *)->name should be the place where the 
 | 
			
		||||
	file will or has been saved.
 | 
			
		||||
	
 | 
			
		||||
(Text *)->flags has the following bits
 | 
			
		||||
	TXT_ISDIRTY - should always be set if the file in mem. differs from
 | 
			
		||||
					the file on disk, or if there is no file on disk.
 | 
			
		||||
	TXT_ISMEM - should always be set if the Text has not been mapped to
 | 
			
		||||
					a file, in which case (Text *)->name may be NULL or garbage.			
 | 
			
		||||
	TXT_ISEXT - should always be set if the Text is not to be written into
 | 
			
		||||
					the .blend
 | 
			
		||||
	TXT_ISSCRIPT - should be set if the user has designated the text
 | 
			
		||||
					as a script. (NEW: this was unused, but now it is needed by
 | 
			
		||||
					space handler script links (see header_view3d.c, for example)
 | 
			
		||||
 | 
			
		||||
->>> see also: /makesdna/DNA_text_types.h
 | 
			
		||||
 | 
			
		||||
Display
 | 
			
		||||
--
 | 
			
		||||
The st->top determines at what line the top of the text is displayed.
 | 
			
		||||
If the user moves the cursor the st containing that cursor should
 | 
			
		||||
be popped ... other st's retain their own top location.
 | 
			
		||||
 | 
			
		||||
Markers
 | 
			
		||||
--
 | 
			
		||||
The mrk->flags define the behavior and relationships between markers. The
 | 
			
		||||
upper two bytes are used to hold a group ID, the lower two are normal flags. If
 | 
			
		||||
TMARK_EDITALL is set the group ID defines which other markers should be edited.
 | 
			
		||||
 | 
			
		||||
The mrk->clr field is used to visually group markers where the flags may not
 | 
			
		||||
match. A template system, for example, may allow editing of repeating tokens
 | 
			
		||||
(in one group) but include other marked positions (in another group) all in the
 | 
			
		||||
same template with the same color.
 | 
			
		||||
 | 
			
		||||
Undo
 | 
			
		||||
--
 | 
			
		||||
Undo/Redo works by storing
 | 
			
		||||
events in a queue, and a pointer
 | 
			
		||||
to the current position in the
 | 
			
		||||
queue...
 | 
			
		||||
 | 
			
		||||
Events are stored using an
 | 
			
		||||
arbitrary op-code system
 | 
			
		||||
to keep track of
 | 
			
		||||
a) the two cursors (normal and selected)
 | 
			
		||||
b) input (visible and control (ie backspace))
 | 
			
		||||
 | 
			
		||||
input data is stored as its
 | 
			
		||||
ASCII value, the opcodes are
 | 
			
		||||
then selected to not conflict.
 | 
			
		||||
 | 
			
		||||
opcodes with data in between are
 | 
			
		||||
written at the beginning and end
 | 
			
		||||
of the data to allow undo and redo
 | 
			
		||||
to simply check the code at the current
 | 
			
		||||
undo position
 | 
			
		||||
 | 
			
		||||
*/ /***************/
 | 
			
		||||
/*
 | 
			
		||||
 * How Texts should work
 | 
			
		||||
 * --
 | 
			
		||||
 * A text should relate to a file as follows -
 | 
			
		||||
 * (Text *)->name should be the place where the
 | 
			
		||||
 *     file will or has been saved.
 | 
			
		||||
 *
 | 
			
		||||
 * (Text *)->flags has the following bits
 | 
			
		||||
 *     TXT_ISDIRTY - should always be set if the file in mem. differs from
 | 
			
		||||
 *                     the file on disk, or if there is no file on disk.
 | 
			
		||||
 *     TXT_ISMEM - should always be set if the Text has not been mapped to
 | 
			
		||||
 *                     a file, in which case (Text *)->name may be NULL or garbage.
 | 
			
		||||
 *     TXT_ISEXT - should always be set if the Text is not to be written into
 | 
			
		||||
 *                     the .blend
 | 
			
		||||
 *     TXT_ISSCRIPT - should be set if the user has designated the text
 | 
			
		||||
 *                     as a script. (NEW: this was unused, but now it is needed by
 | 
			
		||||
 *                     space handler script links (see header_view3d.c, for example)
 | 
			
		||||
 *
 | 
			
		||||
 * ->>> see also: /makesdna/DNA_text_types.h
 | 
			
		||||
 *
 | 
			
		||||
 * Display
 | 
			
		||||
 * --
 | 
			
		||||
 * The st->top determines at what line the top of the text is displayed.
 | 
			
		||||
 * If the user moves the cursor the st containing that cursor should
 | 
			
		||||
 * be popped ... other st's retain their own top location.
 | 
			
		||||
 *
 | 
			
		||||
 * Markers
 | 
			
		||||
 * --
 | 
			
		||||
 * The mrk->flags define the behavior and relationships between markers. The
 | 
			
		||||
 * upper two bytes are used to hold a group ID, the lower two are normal flags. If
 | 
			
		||||
 * TMARK_EDITALL is set the group ID defines which other markers should be edited.
 | 
			
		||||
 *
 | 
			
		||||
 * The mrk->clr field is used to visually group markers where the flags may not
 | 
			
		||||
 * match. A template system, for example, may allow editing of repeating tokens
 | 
			
		||||
 * (in one group) but include other marked positions (in another group) all in the
 | 
			
		||||
 * same template with the same color.
 | 
			
		||||
 *
 | 
			
		||||
 * Undo
 | 
			
		||||
 * --
 | 
			
		||||
 * Undo/Redo works by storing
 | 
			
		||||
 * events in a queue, and a pointer
 | 
			
		||||
 * to the current position in the
 | 
			
		||||
 * queue...
 | 
			
		||||
 *
 | 
			
		||||
 * Events are stored using an
 | 
			
		||||
 * arbitrary op-code system
 | 
			
		||||
 * to keep track of
 | 
			
		||||
 * a) the two cursors (normal and selected)
 | 
			
		||||
 * b) input (visible and control (ie backspace))
 | 
			
		||||
 *
 | 
			
		||||
 * input data is stored as its
 | 
			
		||||
 * ASCII value, the opcodes are
 | 
			
		||||
 * then selected to not conflict.
 | 
			
		||||
 *
 | 
			
		||||
 * opcodes with data in between are
 | 
			
		||||
 * written at the beginning and end
 | 
			
		||||
 * of the data to allow undo and redo
 | 
			
		||||
 * to simply check the code at the current
 | 
			
		||||
 * undo position
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/***/
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -263,7 +263,7 @@
 | 
			
		||||
/* BLI_assert(), default only to print
 | 
			
		||||
 * for aborting need to define WITH_ASSERT_ABORT
 | 
			
		||||
 */
 | 
			
		||||
#if !defined NDEBUG
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
#  ifdef WITH_ASSERT_ABORT
 | 
			
		||||
#    define _BLI_DUMMY_ABORT abort
 | 
			
		||||
#  else
 | 
			
		||||
 
 | 
			
		||||
@@ -143,7 +143,6 @@ set(SRC
 | 
			
		||||
	BLI_voxel.h
 | 
			
		||||
	BLI_winstuff.h
 | 
			
		||||
	PIL_time.h
 | 
			
		||||
	intern/dynamiclist.h
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
if(WITH_BINRELOC)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,58 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ***** BEGIN GPL LICENSE BLOCK *****
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU General Public License
 | 
			
		||||
 * as published by the Free Software Foundation; either version 2
 | 
			
		||||
 * of the License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software Foundation,
 | 
			
		||||
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 | 
			
		||||
 *
 | 
			
		||||
 * Contributor(s): Jiri Hnidek.
 | 
			
		||||
 *
 | 
			
		||||
 * Documentation of Two way dynamic list with access array can be found at:
 | 
			
		||||
 *
 | 
			
		||||
 * http://wiki.blender.org/bin/view.pl/Blenderwiki/DynamicListWithAccessArray
 | 
			
		||||
 *
 | 
			
		||||
 * ***** END GPL LICENSE BLOCK *****
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** \file blender/blenlib/intern/dynamiclist.h
 | 
			
		||||
 *  \ingroup bli
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef __DYNAMICLIST_H__
 | 
			
		||||
#define __DYNAMICLIST_H__
 | 
			
		||||
 | 
			
		||||
#define PAGE_SIZE 4
 | 
			
		||||
 | 
			
		||||
struct ListBase;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Access array using realloc 
 | 
			
		||||
 */
 | 
			
		||||
typedef struct DynamicArray{
 | 
			
		||||
	unsigned int count;		/* count of items in list */
 | 
			
		||||
	unsigned int max_item_index;	/* max available index */
 | 
			
		||||
	unsigned int last_item_index;	/* max used index */
 | 
			
		||||
	void **items;			/* dynamicaly allocated array of pointers
 | 
			
		||||
					   pointing at items in list */
 | 
			
		||||
} DynamicArray;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Two way dynamic list with access array
 | 
			
		||||
 */
 | 
			
		||||
typedef struct DynamicList {
 | 
			
		||||
	struct DynamicArray da;		/* access array */
 | 
			
		||||
	struct ListBase lb;		/* two way linked dynamic list */
 | 
			
		||||
} DynamicList;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -476,7 +476,7 @@ static void build_leaf(PBVH *bvh, int node_index, BBC *prim_bbc,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Return zero if all primitives in the node can be drawn with the
 | 
			
		||||
   same material (including flat/smooth shading), non-zerootherwise */
 | 
			
		||||
 * same material (including flat/smooth shading), non-zerootherwise */
 | 
			
		||||
int leaf_needs_material_split(PBVH *bvh, int offset, int count)
 | 
			
		||||
{
 | 
			
		||||
	int i, prim;
 | 
			
		||||
 
 | 
			
		||||
@@ -57,9 +57,9 @@ typedef struct ImBuf {
 | 
			
		||||
	unsigned int   encodedsize;       /**< Size of data written to encodedbuffer */
 | 
			
		||||
	unsigned int   encodedbuffersize; /**< Size of encodedbuffer */
 | 
			
		||||
 | 
			
		||||
	float *rect_float;		/**< floating point Rect equivalent
 | 
			
		||||
								Linear RGB color space - may need gamma correction to 
 | 
			
		||||
								sRGB when generating 8bit representations */
 | 
			
		||||
	float *rect_float;		/** < floating point Rect equivalent
 | 
			
		||||
							 * Linear RGB color space - may need gamma correction to
 | 
			
		||||
							 * sRGB when generating 8bit representations */
 | 
			
		||||
	int channels;			/**< amount of channels in rect_float (0 = 4 channel default) */
 | 
			
		||||
	float dither;			/**< random dither value, for conversion from float -> byte rect */
 | 
			
		||||
	short profile;			/** color space/profile preset that the byte rect buffer represents */
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define PLUGIN_INTERN /* This tells the LIBEXPORT macro to compile with
 | 
			
		||||
	dll export set on windows */
 | 
			
		||||
                       * dll export set on windows */
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
#include "blenpluginapi/util.h"
 | 
			
		||||
 
 | 
			
		||||
@@ -103,15 +103,15 @@ static void compute_poly_normal(float normal[3], float (*verts)[3], int nverts)
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
		/* newell's method
 | 
			
		||||
 | 
			
		||||
		so thats?:
 | 
			
		||||
		(a[1] - b[1]) * (a[2] + b[2]);
 | 
			
		||||
		a[1] * b[2] - b[1] * a[2] - b[1] * b[2] + a[1] * a[2]
 | 
			
		||||
 | 
			
		||||
		odd.  half of that is the cross product. . .what's the
 | 
			
		||||
		other half?
 | 
			
		||||
 | 
			
		||||
		also could be like a[1] * (b[2] + a[2]) - b[1] * (a[2] - b[2])
 | 
			
		||||
		 *
 | 
			
		||||
		 * so thats?:
 | 
			
		||||
		 * (a[1] - b[1]) * (a[2] + b[2]);
 | 
			
		||||
		 * a[1] * b[2] - b[1] * a[2] - b[1] * b[2] + a[1] * a[2]
 | 
			
		||||
		 *
 | 
			
		||||
		 * odd.  half of that is the cross product. . .what's the
 | 
			
		||||
		 * other half?
 | 
			
		||||
		 *
 | 
			
		||||
		 * also could be like a[1] * (b[2] + a[2]) - b[1] * (a[2] - b[2])
 | 
			
		||||
		 */
 | 
			
		||||
 | 
			
		||||
		n[0] += (u[1] - v[1]) * (u[2] + v[2]);
 | 
			
		||||
@@ -126,11 +126,11 @@ static void compute_poly_normal(float normal[3], float (*verts)[3], int nverts)
 | 
			
		||||
#if 0
 | 
			
		||||
	l = len_v3(n);
 | 
			
		||||
	/* fast square root, newton/babylonian method:
 | 
			
		||||
	l2 = l * 0.1;
 | 
			
		||||
 | 
			
		||||
	l2 = (l / l2 + l2) * 0.5;
 | 
			
		||||
	l2 = (l / l2 + l2) * 0.5;
 | 
			
		||||
	l2 = (l / l2 + l2) * 0.5;
 | 
			
		||||
	 * l2 = l * 0.1;
 | 
			
		||||
	 *
 | 
			
		||||
	 * l2 = (l / l2 + l2) * 0.5;
 | 
			
		||||
	 * l2 = (l / l2 + l2) * 0.5;
 | 
			
		||||
	 * l2 = (l / l2 + l2) * 0.5;
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	if (l == 0.0) {
 | 
			
		||||
 
 | 
			
		||||
@@ -111,14 +111,14 @@ void TransformBase::decompose(float mat[][4], float *loc, float eul[3], float qu
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
Translation map.
 | 
			
		||||
Used to translate every COLLADA id to a valid id, no matter what "wrong" letters may be
 | 
			
		||||
included. Look at the IDREF XSD declaration for more.
 | 
			
		||||
Follows strictly the COLLADA XSD declaration which explicitly allows non-english chars,
 | 
			
		||||
like special chars (e.g. micro sign), umlauts and so on.
 | 
			
		||||
The COLLADA spec also allows additional chars for member access ('.'), these
 | 
			
		||||
must obviously be removed too, otherwise they would be heavily misinterpreted.
 | 
			
		||||
*/
 | 
			
		||||
 * Translation map.
 | 
			
		||||
 * Used to translate every COLLADA id to a valid id, no matter what "wrong" letters may be
 | 
			
		||||
 * included. Look at the IDREF XSD declaration for more.
 | 
			
		||||
 * Follows strictly the COLLADA XSD declaration which explicitly allows non-english chars,
 | 
			
		||||
 * like special chars (e.g. micro sign), umlauts and so on.
 | 
			
		||||
 * The COLLADA spec also allows additional chars for member access ('.'), these
 | 
			
		||||
 * must obviously be removed too, otherwise they would be heavily misinterpreted.
 | 
			
		||||
 */
 | 
			
		||||
const unsigned char translate_start_name_map[256] = {
 | 
			
		||||
95,  95,  95,  95,  95,  95,  95,  95,  95,
 | 
			
		||||
95,  95,  95,  95,  95,  95,  95,  95,
 | 
			
		||||
 
 | 
			
		||||
@@ -1743,7 +1743,7 @@ void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync,
 | 
			
		||||
		
 | 
			
		||||
		sad->ar= CTX_wm_region(C);
 | 
			
		||||
		/* if startframe is larger than current frame, we put currentframe on startframe.
 | 
			
		||||
		   note: first frame then is not drawn! (ton) */
 | 
			
		||||
		 * note: first frame then is not drawn! (ton) */
 | 
			
		||||
		if(scene->r.sfra > scene->r.cfra) {
 | 
			
		||||
			sad->sfra= scene->r.cfra;
 | 
			
		||||
			scene->r.cfra= scene->r.sfra;
 | 
			
		||||
 
 | 
			
		||||
@@ -62,20 +62,20 @@ typedef struct GPUBufferMaterial {
 | 
			
		||||
} GPUBufferMaterial;
 | 
			
		||||
 | 
			
		||||
/* meshes are split up by material since changing materials requires
 | 
			
		||||
   GL state changes that can't occur in the middle of drawing an
 | 
			
		||||
   array.
 | 
			
		||||
 | 
			
		||||
   some simplifying assumptions are made:
 | 
			
		||||
   * all quads are treated as two triangles.
 | 
			
		||||
   * no vertex sharing is used; each triangle gets its own copy of the
 | 
			
		||||
     vertices it uses (this makes it easy to deal with a vertex used
 | 
			
		||||
     by faces with different properties, such as smooth/solid shading,
 | 
			
		||||
     different MCols, etc.)
 | 
			
		||||
 | 
			
		||||
   to avoid confusion between the original MVert vertices and the
 | 
			
		||||
   arrays of OpenGL vertices, the latter are referred to here and in
 | 
			
		||||
   the source as `points'. similarly, the OpenGL triangles generated
 | 
			
		||||
   for MFaces are referred to as triangles rather than faces.
 | 
			
		||||
 * GL state changes that can't occur in the middle of drawing an
 | 
			
		||||
 * array.
 | 
			
		||||
 *
 | 
			
		||||
 * some simplifying assumptions are made:
 | 
			
		||||
 * - all quads are treated as two triangles.
 | 
			
		||||
 * - no vertex sharing is used; each triangle gets its own copy of the
 | 
			
		||||
 *   vertices it uses (this makes it easy to deal with a vertex used
 | 
			
		||||
 *   by faces with different properties, such as smooth/solid shading,
 | 
			
		||||
 *   different MCols, etc.)
 | 
			
		||||
 *
 | 
			
		||||
 * to avoid confusion between the original MVert vertices and the
 | 
			
		||||
 * arrays of OpenGL vertices, the latter are referred to here and in
 | 
			
		||||
 * the source as `points'. similarly, the OpenGL triangles generated
 | 
			
		||||
 * for MFaces are referred to as triangles rather than faces.
 | 
			
		||||
 */
 | 
			
		||||
typedef struct GPUDrawObject {
 | 
			
		||||
	GPUBuffer *points;
 | 
			
		||||
@@ -107,7 +107,7 @@ typedef struct GPUDrawObject {
 | 
			
		||||
	int totedge;
 | 
			
		||||
 | 
			
		||||
	/* if there was a failure allocating some buffer, use old
 | 
			
		||||
	   rendering code */
 | 
			
		||||
	 * rendering code */
 | 
			
		||||
	int legacy;
 | 
			
		||||
} GPUDrawObject;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -92,18 +92,18 @@ typedef enum GPUDriverType {
 | 
			
		||||
int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver);
 | 
			
		||||
 | 
			
		||||
/* GPU Texture
 | 
			
		||||
   - always returns unsigned char RGBA textures
 | 
			
		||||
   - if texture with non square dimensions is created, depending on the
 | 
			
		||||
	 graphics card capabilities the texture may actually be stored in a
 | 
			
		||||
	 larger texture with power of two dimensions. the actual dimensions
 | 
			
		||||
	 may be queried with GPU_texture_opengl_width/height. GPU_texture_coord_2f
 | 
			
		||||
	 calls glTexCoord2f with the coordinates adjusted for this.
 | 
			
		||||
   - can use reference counting:
 | 
			
		||||
	   - reference counter after GPU_texture_create is 1
 | 
			
		||||
	   - GPU_texture_ref increases by one
 | 
			
		||||
	   - GPU_texture_free decreases by one, and frees if 0
 | 
			
		||||
	- if created with from_blender, will not free the texture
 | 
			
		||||
*/
 | 
			
		||||
 * - always returns unsigned char RGBA textures
 | 
			
		||||
 * - if texture with non square dimensions is created, depending on the
 | 
			
		||||
 *   graphics card capabilities the texture may actually be stored in a
 | 
			
		||||
 *   larger texture with power of two dimensions. the actual dimensions
 | 
			
		||||
 *   may be queried with GPU_texture_opengl_width/height. GPU_texture_coord_2f
 | 
			
		||||
 *   calls glTexCoord2f with the coordinates adjusted for this.
 | 
			
		||||
 * - can use reference counting:
 | 
			
		||||
 *     - reference counter after GPU_texture_create is 1
 | 
			
		||||
 *     - GPU_texture_ref increases by one
 | 
			
		||||
 *     - GPU_texture_free decreases by one, and frees if 0
 | 
			
		||||
 *  - if created with from_blender, will not free the texture
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
GPUTexture *GPU_texture_create_1D(int w, float *pixels, char err_out[256]);
 | 
			
		||||
GPUTexture *GPU_texture_create_2D(int w, int h, float *pixels, char err_out[256]);
 | 
			
		||||
@@ -126,11 +126,11 @@ int GPU_texture_opengl_height(GPUTexture *tex);
 | 
			
		||||
int GPU_texture_opengl_bindcode(GPUTexture *tex);
 | 
			
		||||
 | 
			
		||||
/* GPU Framebuffer
 | 
			
		||||
   - this is a wrapper for an OpenGL framebuffer object (FBO). in practice
 | 
			
		||||
	 multiple FBO's may be created, to get around limitations on the number
 | 
			
		||||
	 of attached textures and the dimension requirements.
 | 
			
		||||
   - after any of the GPU_framebuffer_* functions, GPU_framebuffer_restore must
 | 
			
		||||
	 be called before rendering to the window framebuffer again */
 | 
			
		||||
 * - this is a wrapper for an OpenGL framebuffer object (FBO). in practice
 | 
			
		||||
 *   multiple FBO's may be created, to get around limitations on the number
 | 
			
		||||
 *   of attached textures and the dimension requirements.
 | 
			
		||||
 * - after any of the GPU_framebuffer_* functions, GPU_framebuffer_restore must
 | 
			
		||||
 *   be called before rendering to the window framebuffer again */
 | 
			
		||||
 | 
			
		||||
GPUFrameBuffer *GPU_framebuffer_create(void);
 | 
			
		||||
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err_out[256]);
 | 
			
		||||
@@ -142,8 +142,8 @@ void GPU_framebuffer_free(GPUFrameBuffer *fb);
 | 
			
		||||
void GPU_framebuffer_restore(void);
 | 
			
		||||
 | 
			
		||||
/* GPU OffScreen
 | 
			
		||||
   - wrapper around framebuffer and texture for simple offscreen drawing 
 | 
			
		||||
   - changes size if graphics card can't support it */
 | 
			
		||||
 * - wrapper around framebuffer and texture for simple offscreen drawing
 | 
			
		||||
 * - changes size if graphics card can't support it */
 | 
			
		||||
 | 
			
		||||
GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256]);
 | 
			
		||||
void GPU_offscreen_free(GPUOffScreen *ofs);
 | 
			
		||||
@@ -152,8 +152,8 @@ void GPU_offscreen_unbind(GPUOffScreen *ofs);
 | 
			
		||||
void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels);
 | 
			
		||||
 | 
			
		||||
/* GPU Shader
 | 
			
		||||
   - only for fragment shaders now
 | 
			
		||||
   - must call texture bind before setting a texture as uniform! */
 | 
			
		||||
 * - only for fragment shaders now
 | 
			
		||||
 * - must call texture bind before setting a texture as uniform! */
 | 
			
		||||
 | 
			
		||||
GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, const char *libcode); /*GPUShader *lib);*/
 | 
			
		||||
/*GPUShader *GPU_shader_create_lib(const char *code);*/
 | 
			
		||||
 
 | 
			
		||||
@@ -72,8 +72,8 @@ static const char* GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4",
 | 
			
		||||
 * These are stored in a hash for lookup when creating a material. */
 | 
			
		||||
 | 
			
		||||
static GHash *FUNCTION_HASH= NULL;
 | 
			
		||||
/*static char *FUNCTION_PROTOTYPES= NULL;
 | 
			
		||||
static GPUShader *FUNCTION_LIB= NULL;*/
 | 
			
		||||
/* static char *FUNCTION_PROTOTYPES= NULL;
 | 
			
		||||
 * static GPUShader *FUNCTION_LIB= NULL;*/
 | 
			
		||||
 | 
			
		||||
static int gpu_str_prefix(const char *str, const char *prefix)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -61,10 +61,10 @@ typedef struct GPUFunction {
 | 
			
		||||
GPUFunction *GPU_lookup_function(const char *name);
 | 
			
		||||
 | 
			
		||||
/* Pass Generation
 | 
			
		||||
   - Takes a list of nodes and a desired output, and makes a pass. This
 | 
			
		||||
	 will take ownership of the nodes and free them early if unused or
 | 
			
		||||
	 at the end if used.
 | 
			
		||||
*/
 | 
			
		||||
 *  - Takes a list of nodes and a desired output, and makes a pass. This
 | 
			
		||||
 *    will take ownership of the nodes and free them early if unused or
 | 
			
		||||
 *    at the end if used.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef enum GPUDataSource {
 | 
			
		||||
	GPU_SOURCE_VEC_UNIFORM,
 | 
			
		||||
 
 | 
			
		||||
@@ -193,9 +193,11 @@ static int is_pow2_limit(int num)
 | 
			
		||||
{
 | 
			
		||||
	/* take texture clamping into account */
 | 
			
		||||
 | 
			
		||||
	/* XXX: texturepaint not global!
 | 
			
		||||
	/* XXX: texturepaint not global! */
 | 
			
		||||
#if 0
 | 
			
		||||
	if (G.f & G_TEXTUREPAINT)
 | 
			
		||||
		return 1;*/
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (U.glreslimit != 0 && num > U.glreslimit)
 | 
			
		||||
		return 0;
 | 
			
		||||
@@ -205,9 +207,11 @@ static int is_pow2_limit(int num)
 | 
			
		||||
 | 
			
		||||
static int smaller_pow2_limit(int num)
 | 
			
		||||
{
 | 
			
		||||
	/* XXX: texturepaint not global!
 | 
			
		||||
	/* XXX: texturepaint not global! */
 | 
			
		||||
#if 0
 | 
			
		||||
	if (G.f & G_TEXTUREPAINT)
 | 
			
		||||
		return 1;*/
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	/* take texture clamping into account */
 | 
			
		||||
	if (U.glreslimit != 0 && num > U.glreslimit)
 | 
			
		||||
@@ -467,7 +471,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
 | 
			
		||||
	if(ibuf->rect_float) {
 | 
			
		||||
		if(U.use_16bit_textures) {
 | 
			
		||||
			/* use high precision textures. This is relatively harmless because OpenGL gives us
 | 
			
		||||
			   a high precision format only if it is available */
 | 
			
		||||
			 * a high precision format only if it is available */
 | 
			
		||||
			use_high_bit_depth = TRUE;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -593,7 +597,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* scale if not a power of two. this is not strictly necessary for newer 
 | 
			
		||||
	   GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures */
 | 
			
		||||
	 * GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures */
 | 
			
		||||
	if (!is_pow2_limit(rectw) || !is_pow2_limit(recth)) {
 | 
			
		||||
		rectw= smaller_pow2_limit(rectw);
 | 
			
		||||
		recth= smaller_pow2_limit(recth);
 | 
			
		||||
@@ -714,9 +718,9 @@ int GPU_set_tpage(MTFace *tface, int mipmap, int alphablend)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* these two functions are called on entering and exiting texture paint mode,
 | 
			
		||||
   temporary disabling/enabling mipmapping on all images for quick texture
 | 
			
		||||
   updates with glTexSubImage2D. images that didn't change don't have to be
 | 
			
		||||
   re-uploaded to OpenGL */
 | 
			
		||||
 * temporary disabling/enabling mipmapping on all images for quick texture
 | 
			
		||||
 * updates with glTexSubImage2D. images that didn't change don't have to be
 | 
			
		||||
 * re-uploaded to OpenGL */
 | 
			
		||||
void GPU_paint_set_mipmap(int mipmap)
 | 
			
		||||
{
 | 
			
		||||
	Image* ima;
 | 
			
		||||
@@ -1086,10 +1090,10 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
 | 
			
		||||
	GMS.gviewinv= rv3d->viewinv;
 | 
			
		||||
 | 
			
		||||
	/* alpha pass setup. there's various cases to handle here:
 | 
			
		||||
	   * object transparency on: only solid materials draw in the first pass,
 | 
			
		||||
	   and only transparent in the second 'alpha' pass.
 | 
			
		||||
	   * object transparency off: for glsl we draw both in a single pass, and
 | 
			
		||||
	   for solid we don't use transparency at all. */
 | 
			
		||||
	 * - object transparency on: only solid materials draw in the first pass,
 | 
			
		||||
	 * and only transparent in the second 'alpha' pass.
 | 
			
		||||
	 * - object transparency off: for glsl we draw both in a single pass, and
 | 
			
		||||
	 * for solid we don't use transparency at all. */
 | 
			
		||||
	GMS.use_alpha_pass = (do_alpha_after != NULL);
 | 
			
		||||
	GMS.is_alpha_pass = (v3d && v3d->transp);
 | 
			
		||||
	if(GMS.use_alpha_pass)
 | 
			
		||||
@@ -1236,7 +1240,7 @@ int GPU_enable_material(int nr, void *attribs)
 | 
			
		||||
			GMS.gboundmat= mat;
 | 
			
		||||
 | 
			
		||||
			/* for glsl use alpha blend mode, unless it's set to solid and
 | 
			
		||||
			   we are already drawing in an alpha pass */
 | 
			
		||||
			 * we are already drawing in an alpha pass */
 | 
			
		||||
			if(mat->game.alpha_blend != GPU_BLEND_SOLID)
 | 
			
		||||
				alphablend= mat->game.alpha_blend;
 | 
			
		||||
 | 
			
		||||
@@ -1525,8 +1529,8 @@ void GPU_state_init(void)
 | 
			
		||||
	glDisable(GL_CULL_FACE);
 | 
			
		||||
 | 
			
		||||
	/* calling this makes drawing very slow when AA is not set up in ghost
 | 
			
		||||
	   on Linux/NVIDIA.
 | 
			
		||||
	glDisable(GL_MULTISAMPLE); */
 | 
			
		||||
	 * on Linux/NVIDIA. */
 | 
			
		||||
	// glDisable(GL_MULTISAMPLE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* debugging aid */
 | 
			
		||||
 
 | 
			
		||||
@@ -56,14 +56,14 @@
 | 
			
		||||
/* Extensions support */
 | 
			
		||||
 | 
			
		||||
/* extensions used:
 | 
			
		||||
	- texture border clamp: 1.3 core
 | 
			
		||||
	- fragement shader: 2.0 core
 | 
			
		||||
	- framebuffer object: ext specification
 | 
			
		||||
	- multitexture 1.3 core
 | 
			
		||||
	- arb non power of two: 2.0 core
 | 
			
		||||
	- pixel buffer objects? 2.1 core
 | 
			
		||||
	- arb draw buffers? 2.0 core
 | 
			
		||||
*/
 | 
			
		||||
 * - texture border clamp: 1.3 core
 | 
			
		||||
 * - fragement shader: 2.0 core
 | 
			
		||||
 * - framebuffer object: ext specification
 | 
			
		||||
 * - multitexture 1.3 core
 | 
			
		||||
 * - arb non power of two: 2.0 core
 | 
			
		||||
 * - pixel buffer objects? 2.1 core
 | 
			
		||||
 * - arb draw buffers? 2.0 core
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static struct GPUGlobal {
 | 
			
		||||
	GLint maxtextures;
 | 
			
		||||
@@ -850,7 +850,7 @@ struct GPUOffScreen {
 | 
			
		||||
	GPUTexture *depth;
 | 
			
		||||
 | 
			
		||||
	/* requested width/height, may be smaller than actual texture size due
 | 
			
		||||
	   to missing non-power of two support, so we compensate for that */
 | 
			
		||||
	 * to missing non-power of two support, so we compensate for that */
 | 
			
		||||
	int w, h;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -1021,8 +1021,10 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*if(lib && lib->lib)
 | 
			
		||||
		glAttachObjectARB(shader->object, lib->lib);*/
 | 
			
		||||
#if 0
 | 
			
		||||
	if(lib && lib->lib)
 | 
			
		||||
		glAttachObjectARB(shader->object, lib->lib);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	glLinkProgramARB(shader->object);
 | 
			
		||||
	glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status);
 | 
			
		||||
 
 | 
			
		||||
@@ -672,9 +672,10 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
 | 
			
		||||
	i = is;
 | 
			
		||||
	GPU_link(mat, "shade_visifac", i, visifac, shi->refl, &i);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/*if(ma->mode & MA_TANGENT_VN)
 | 
			
		||||
		GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);*/
 | 
			
		||||
#if 0
 | 
			
		||||
	if(ma->mode & MA_TANGENT_VN)
 | 
			
		||||
		GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	/* this replaces if(i > 0.0) conditional until that is supported */
 | 
			
		||||
	// done in shade_visifac now, GPU_link(mat, "mtex_value_clamp_positive", i, &i);
 | 
			
		||||
@@ -1461,8 +1462,8 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma)
 | 
			
		||||
	GPU_material_construct_end(mat);
 | 
			
		||||
 | 
			
		||||
	/* note that even if building the shader fails in some way, we still keep
 | 
			
		||||
	   it to avoid trying to compile again and again, and simple do not use
 | 
			
		||||
	   the actual shader on drawing */
 | 
			
		||||
	 * it to avoid trying to compile again and again, and simple do not use
 | 
			
		||||
	 * the actual shader on drawing */
 | 
			
		||||
 | 
			
		||||
	link = MEM_callocN(sizeof(LinkData), "GPUMaterialLink");
 | 
			
		||||
	link->data = mat;
 | 
			
		||||
 
 | 
			
		||||
@@ -230,7 +230,7 @@ static void where_is_ik_bone(bPoseChannel *pchan, float ik_mat[][3])   // nr = t
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* called from within the core where_is_pose loop, all animsystems and constraints
 | 
			
		||||
were executed & assigned. Now as last we do an IK pass */
 | 
			
		||||
 * were executed & assigned. Now as last we do an IK pass */
 | 
			
		||||
static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
 | 
			
		||||
{
 | 
			
		||||
	float R_parmat[3][3], identity[3][3];
 | 
			
		||||
@@ -349,8 +349,8 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
 | 
			
		||||
	pchan= tree->pchan[0];
 | 
			
		||||
	if (pchan->parent)
 | 
			
		||||
		/* transform goal by parent mat, so this rotation is not part of the
 | 
			
		||||
		   segment's basis. otherwise rotation limits do not work on the
 | 
			
		||||
		   local transform of the segment itself. */
 | 
			
		||||
		 * segment's basis. otherwise rotation limits do not work on the
 | 
			
		||||
		 * local transform of the segment itself. */
 | 
			
		||||
		copy_m4_m4(rootmat, pchan->parent->pose_mat);
 | 
			
		||||
	else
 | 
			
		||||
		unit_m4(rootmat);
 | 
			
		||||
@@ -539,7 +539,7 @@ void iksolver_execute_tree(struct Scene *scene, struct Object *ob,  struct bPose
 | 
			
		||||
		execute_posetree(scene, ob, tree);
 | 
			
		||||
		
 | 
			
		||||
		/* 6. apply the differences to the channels, 
 | 
			
		||||
			  we need to calculate the original differences first */
 | 
			
		||||
		 *    we need to calculate the original differences first */
 | 
			
		||||
		for(a=0; a<tree->totchannel; a++) {
 | 
			
		||||
			make_dmats(tree->pchan[a]);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -890,32 +890,31 @@ static int convert_channels(IK_Scene *ikscene, PoseTree *tree)
 | 
			
		||||
			flag |= IK_TRANSY;
 | 
			
		||||
		}
 | 
			
		||||
		/*
 | 
			
		||||
		Logic to create the segments:
 | 
			
		||||
		RX,RY,RZ = rotational joints with no length
 | 
			
		||||
		RY(tip) = rotational joints with a fixed length arm = (0,length,0)
 | 
			
		||||
		TY = translational joint on Y axis
 | 
			
		||||
		F(pos) = fixed joint with an arm at position pos 
 | 
			
		||||
		Conversion rule of the above flags:
 | 
			
		||||
		-   ==> F(tip)
 | 
			
		||||
		X   ==> RX(tip)
 | 
			
		||||
		Y   ==> RY(tip)
 | 
			
		||||
		Z   ==> RZ(tip)
 | 
			
		||||
		XY  ==> RX+RY(tip)
 | 
			
		||||
		XZ  ==> RX+RZ(tip)
 | 
			
		||||
		YZ  ==> RZ+RY(tip)
 | 
			
		||||
		XYZ ==> full spherical unless there are limits, in which case RX+RZ+RY(tip)
 | 
			
		||||
		In case of stretch, tip=(0,0,0) and there is an additional TY joint
 | 
			
		||||
		The frame at last of these joints represents the tail of the bone. 
 | 
			
		||||
		The head is computed by a reverse translation on Y axis of the bone length
 | 
			
		||||
		or in case of TY joint, by the frame at previous joint.
 | 
			
		||||
		In case of separation of bones, there is an additional F(head) joint
 | 
			
		||||
 | 
			
		||||
		Computing rest pose and length is complicated: the solver works in world space
 | 
			
		||||
		Here is the logic:
 | 
			
		||||
		rest position is computed only from bone->bone_mat.
 | 
			
		||||
		bone length is computed from bone->length multiplied by the scaling factor of
 | 
			
		||||
		the armature. Non-uniform scaling will give bad result!
 | 
			
		||||
 | 
			
		||||
		 * Logic to create the segments:
 | 
			
		||||
		 * RX,RY,RZ = rotational joints with no length
 | 
			
		||||
		 * RY(tip) = rotational joints with a fixed length arm = (0,length,0)
 | 
			
		||||
		 * TY = translational joint on Y axis
 | 
			
		||||
		 * F(pos) = fixed joint with an arm at position pos
 | 
			
		||||
		 * Conversion rule of the above flags:
 | 
			
		||||
		 * -   ==> F(tip)
 | 
			
		||||
		 * X   ==> RX(tip)
 | 
			
		||||
		 * Y   ==> RY(tip)
 | 
			
		||||
		 * Z   ==> RZ(tip)
 | 
			
		||||
		 * XY  ==> RX+RY(tip)
 | 
			
		||||
		 * XZ  ==> RX+RZ(tip)
 | 
			
		||||
		 * YZ  ==> RZ+RY(tip)
 | 
			
		||||
		 * XYZ ==> full spherical unless there are limits, in which case RX+RZ+RY(tip)
 | 
			
		||||
		 * In case of stretch, tip=(0,0,0) and there is an additional TY joint
 | 
			
		||||
		 * The frame at last of these joints represents the tail of the bone.
 | 
			
		||||
		 * The head is computed by a reverse translation on Y axis of the bone length
 | 
			
		||||
		 * or in case of TY joint, by the frame at previous joint.
 | 
			
		||||
		 * In case of separation of bones, there is an additional F(head) joint
 | 
			
		||||
		 *
 | 
			
		||||
		 * Computing rest pose and length is complicated: the solver works in world space
 | 
			
		||||
		 * Here is the logic:
 | 
			
		||||
		 * rest position is computed only from bone->bone_mat.
 | 
			
		||||
		 * bone length is computed from bone->length multiplied by the scaling factor of
 | 
			
		||||
		 * the armature. Non-uniform scaling will give bad result!
 | 
			
		||||
		 */
 | 
			
		||||
		switch (flag & (IK_XDOF|IK_YDOF|IK_ZDOF))
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -185,18 +185,17 @@ void IMB_rectblend(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx,
 | 
			
		||||
 | 
			
		||||
typedef enum IMB_Timecode_Type {
 | 
			
		||||
	IMB_TC_NONE       = 0, /* don't use timecode files at all */
 | 
			
		||||
 | 
			
		||||
	IMB_TC_RECORD_RUN = 1, /* use images in the order as they are recorded
 | 
			
		||||
				  (currently, this is the only one implemented
 | 
			
		||||
				  and is a sane default)
 | 
			
		||||
			       */
 | 
			
		||||
	                        * (currently, this is the only one implemented
 | 
			
		||||
	                        * and is a sane default) */
 | 
			
		||||
 | 
			
		||||
	IMB_TC_FREE_RUN   = 2, /* use global timestamp written by recording
 | 
			
		||||
				  device (prosumer camcorders e.g. can do
 | 
			
		||||
				  that) */
 | 
			
		||||
	IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN = 4, 
 | 
			
		||||
                               /* interpolate a global timestamp using the
 | 
			
		||||
				  record date and time written by recording
 | 
			
		||||
				  device (*every* consumer camcorder can do
 | 
			
		||||
				  that :) )*/
 | 
			
		||||
                            * device (prosumer camcorders e.g. can do that) */
 | 
			
		||||
	IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN = 4, /* interpolate a global timestamp using the
 | 
			
		||||
	                                            * record date and time written by recording
 | 
			
		||||
	                                            * device (*every* consumer camcorder can do
 | 
			
		||||
	                                            * that :) )*/
 | 
			
		||||
	IMB_TC_RECORD_RUN_NO_GAPS = 8,
 | 
			
		||||
	IMB_TC_MAX_SLOT   = 4
 | 
			
		||||
} IMB_Timecode_Type;
 | 
			
		||||
@@ -367,8 +366,8 @@ void IMB_interlace(struct ImBuf *ibuf);
 | 
			
		||||
 | 
			
		||||
/* create char buffer, color corrected if necessary, for ImBufs that lack one */ 
 | 
			
		||||
void IMB_rect_from_float(struct ImBuf *ibuf);
 | 
			
		||||
/* create char buffer for part of the image, color corrected if necessary,
 | 
			
		||||
   Changed part will be stored in buffer. This is expected to be used for texture painting updates */ 
 | 
			
		||||
/* Create char buffer for part of the image, color corrected if necessary,
 | 
			
		||||
 * Changed part will be stored in buffer. This is expected to be used for texture painting updates */
 | 
			
		||||
void IMB_partial_rect_from_float(struct ImBuf *ibuf, float *buffer, int x, int y, int w, int h);
 | 
			
		||||
void IMB_float_from_rect(struct ImBuf *ibuf);
 | 
			
		||||
void IMB_float_from_rect_simple(struct ImBuf *ibuf); /* no profile conversion */
 | 
			
		||||
 
 | 
			
		||||
@@ -84,8 +84,8 @@ typedef struct ImBuf {
 | 
			
		||||
	/* pixels */
 | 
			
		||||
	unsigned int *rect;		/* pixel values stored here */
 | 
			
		||||
	float *rect_float;		/* floating point Rect equivalent
 | 
			
		||||
							Linear RGB color space - may need gamma correction to 
 | 
			
		||||
							sRGB when generating 8bit representations */
 | 
			
		||||
	                         * Linear RGB color space - may need gamma correction to
 | 
			
		||||
	                         * sRGB when generating 8bit representations */
 | 
			
		||||
 | 
			
		||||
	/* resolution - pixels per meter */
 | 
			
		||||
	double ppm[2];
 | 
			
		||||
 
 | 
			
		||||
@@ -36,8 +36,8 @@
 | 
			
		||||
#include "BLI_ghash.h"
 | 
			
		||||
 | 
			
		||||
/* Cache system for movie data - now supports stoting ImBufs only
 | 
			
		||||
   Supposed to provide unified cache system for movie clips, sequencer and
 | 
			
		||||
   other movie-related areas */
 | 
			
		||||
 * Supposed to provide unified cache system for movie clips, sequencer and
 | 
			
		||||
 * other movie-related areas */
 | 
			
		||||
 | 
			
		||||
struct ImBuf;
 | 
			
		||||
struct MovieCache;
 | 
			
		||||
 
 | 
			
		||||
@@ -33,26 +33,24 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include "BKE_utildefines.h"
 | 
			
		||||
#include "IMB_anim.h"
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
  separate animation index files to solve the following problems:
 | 
			
		||||
 | 
			
		||||
  a) different timecodes within one file (like DTS/PTS, Timecode-Track, 
 | 
			
		||||
     "implicit" timecodes within DV-files and HDV-files etc.)
 | 
			
		||||
  b) seeking difficulties within ffmpeg for files with timestamp holes
 | 
			
		||||
  c) broken files that miss several frames / have varying framerates
 | 
			
		||||
  d) use proxies accordingly
 | 
			
		||||
 | 
			
		||||
  ... we need index files, that provide us with 
 | 
			
		||||
  
 | 
			
		||||
  the binary(!) position, where we have to seek into the file *and*
 | 
			
		||||
  the continuous frame number (ignoring the holes) starting from the 
 | 
			
		||||
  beginning of the file, so that we know, which proxy frame to serve.
 | 
			
		||||
 | 
			
		||||
  This index has to be only built once for a file and is written into
 | 
			
		||||
  the BL_proxy directory structure for later reuse in different blender files.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 * separate animation index files to solve the following problems:
 | 
			
		||||
 *
 | 
			
		||||
 * a) different timecodes within one file (like DTS/PTS, Timecode-Track,
 | 
			
		||||
 *    "implicit" timecodes within DV-files and HDV-files etc.)
 | 
			
		||||
 * b) seeking difficulties within ffmpeg for files with timestamp holes
 | 
			
		||||
 * c) broken files that miss several frames / have varying framerates
 | 
			
		||||
 * d) use proxies accordingly
 | 
			
		||||
 *
 | 
			
		||||
 * ... we need index files, that provide us with
 | 
			
		||||
 *
 | 
			
		||||
 * the binary(!) position, where we have to seek into the file *and*
 | 
			
		||||
 * the continuous frame number (ignoring the holes) starting from the
 | 
			
		||||
 * beginning of the file, so that we know, which proxy frame to serve.
 | 
			
		||||
 *
 | 
			
		||||
 * This index has to be only built once for a file and is written into
 | 
			
		||||
 * the BL_proxy directory structure for later reuse in different blender files.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct anim_index_entry {
 | 
			
		||||
	int frameno;
 | 
			
		||||
 
 | 
			
		||||
@@ -43,12 +43,12 @@ typedef struct ImMetaData {
 | 
			
		||||
} ImMetaData;
 | 
			
		||||
 | 
			
		||||
/** The metadata is a list of key/value pairs (both char*) that can me
 | 
			
		||||
	saved in the header of several image formats.
 | 
			
		||||
	Apart from some common keys like 
 | 
			
		||||
	'Software' and 'Description' (png standard) we'll use keys within the 
 | 
			
		||||
	Blender namespace, so should be called 'Blender::StampInfo' or 'Blender::FrameNum'
 | 
			
		||||
	etc... 
 | 
			
		||||
*/
 | 
			
		||||
 * saved in the header of several image formats.
 | 
			
		||||
 * Apart from some common keys like
 | 
			
		||||
 * 'Software' and 'Description' (png standard) we'll use keys within the
 | 
			
		||||
 * Blender namespace, so should be called 'Blender::StampInfo' or 'Blender::FrameNum'
 | 
			
		||||
 * etc...
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* free blender ImMetaData struct */
 | 
			
		||||
@@ -58,7 +58,7 @@ void IMB_metadata_free(struct ImBuf* img);
 | 
			
		||||
 *  \param img - the ImBuf that contains the image data
 | 
			
		||||
 *  \param key - the key of the field
 | 
			
		||||
 *  \param value - the data in the field, first one found with key is returned, 
 | 
			
		||||
				  memory has to be allocated by user.
 | 
			
		||||
 *                 memory has to be allocated by user.
 | 
			
		||||
 *  \param len - length of value buffer allocated by user.
 | 
			
		||||
 *  \return    - 1 (true) if ImageInfo present and value for the key found, 0 (false) otherwise
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail
 | 
			
		||||
							BLI_countlist BLI_stringdec */
 | 
			
		||||
                          * BLI_countlist BLI_stringdec */
 | 
			
		||||
#include "BLI_utildefines.h"
 | 
			
		||||
#include "BLI_math_base.h"
 | 
			
		||||
 | 
			
		||||
@@ -603,10 +603,10 @@ static int startffmpeg(struct anim * anim)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* postprocess the image in anim->pFrame and do color conversion
 | 
			
		||||
   and deinterlacing stuff.
 | 
			
		||||
 | 
			
		||||
   Output is anim->last_frame
 | 
			
		||||
*/
 | 
			
		||||
 * and deinterlacing stuff.
 | 
			
		||||
 *
 | 
			
		||||
 * Output is anim->last_frame
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static void ffmpeg_postprocess(struct anim * anim)
 | 
			
		||||
{
 | 
			
		||||
@@ -621,7 +621,7 @@ static void ffmpeg_postprocess(struct anim * anim)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* This means the data wasnt read properly, 
 | 
			
		||||
	   this check stops crashing */
 | 
			
		||||
	 * this check stops crashing */
 | 
			
		||||
	if (input->data[0]==0 && input->data[1]==0 
 | 
			
		||||
	    && input->data[2]==0 && input->data[3]==0){
 | 
			
		||||
		fprintf(stderr, "ffmpeg_fetchibuf: "
 | 
			
		||||
 
 | 
			
		||||
@@ -40,9 +40,9 @@
 | 
			
		||||
#include "IMB_filetype.h"
 | 
			
		||||
 | 
			
		||||
/* some code copied from article on microsoft.com, copied
 | 
			
		||||
  here for enhanced BMP support in the future
 | 
			
		||||
  http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0197/mfcp1/mfcp1.htm&nav=/msj/0197/newnav.htm
 | 
			
		||||
*/
 | 
			
		||||
 * here for enhanced BMP support in the future
 | 
			
		||||
 * http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0197/mfcp1/mfcp1.htm&nav=/msj/0197/newnav.htm
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct BMPINFOHEADER{
 | 
			
		||||
	unsigned int	biSize;
 | 
			
		||||
@@ -129,10 +129,13 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags)
 | 
			
		||||
	y = LITTLE_LONG(bmi.biHeight);
 | 
			
		||||
	depth = LITTLE_SHORT(bmi.biBitCount);
 | 
			
		||||
 | 
			
		||||
	/* printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y, 
 | 
			
		||||
		depth, bmi.biBitCount); */
 | 
			
		||||
	/* printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y, 
 | 
			
		||||
		depth, bmi.biBitCount); */
 | 
			
		||||
#if 0
 | 
			
		||||
	printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y,
 | 
			
		||||
	       depth, bmi.biBitCount);
 | 
			
		||||
	printf("skip: %d, x: %d y: %d, depth: %d (%x)\n", skip, x, y,
 | 
			
		||||
	       depth, bmi.biBitCount);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (flags & IB_test) {
 | 
			
		||||
		ibuf = IMB_allocImBuf(x, y, depth, 0);
 | 
			
		||||
	} else {
 | 
			
		||||
 
 | 
			
		||||
@@ -40,13 +40,13 @@
 | 
			
		||||
#include "imbuf.h"
 | 
			
		||||
 | 
			
		||||
/* We use a two level cache here. A per-thread cache with limited number of
 | 
			
		||||
   tiles. This can be accessed without locking and so is hoped to lead to most
 | 
			
		||||
   tile access being lock-free. The global cache is shared between all threads
 | 
			
		||||
   and requires slow locking to access, and contains all tiles.
 | 
			
		||||
   
 | 
			
		||||
   The per-thread cache should be big enough that one might hope to not fall
 | 
			
		||||
   back to the global cache every pixel, but not to big to keep too many tiles
 | 
			
		||||
   locked and using memory. */
 | 
			
		||||
 * tiles. This can be accessed without locking and so is hoped to lead to most
 | 
			
		||||
 * tile access being lock-free. The global cache is shared between all threads
 | 
			
		||||
 * and requires slow locking to access, and contains all tiles.
 | 
			
		||||
 *
 | 
			
		||||
 * The per-thread cache should be big enough that one might hope to not fall
 | 
			
		||||
 * back to the global cache every pixel, but not to big to keep too many tiles
 | 
			
		||||
 * locked and using memory. */
 | 
			
		||||
 | 
			
		||||
#define IB_THREAD_CACHE_SIZE	100
 | 
			
		||||
 | 
			
		||||
@@ -207,7 +207,7 @@ void imb_tile_cache_init(void)
 | 
			
		||||
	BLI_mutex_init(&GLOBAL_CACHE.mutex);
 | 
			
		||||
 | 
			
		||||
	/* initialize for one thread, for places that access textures
 | 
			
		||||
	   outside of rendering (displace modifier, painting, ..) */
 | 
			
		||||
	 * outside of rendering (displace modifier, painting, ..) */
 | 
			
		||||
	IMB_tile_cache_params(0, 0);
 | 
			
		||||
 | 
			
		||||
	GLOBAL_CACHE.initialized = 1;
 | 
			
		||||
@@ -286,8 +286,8 @@ static ImGlobalTile *imb_global_cache_get_tile(ImBuf *ibuf, int tx, int ty, ImGl
 | 
			
		||||
	
 | 
			
		||||
	if(gtile) {
 | 
			
		||||
		/* found tile. however it may be in the process of being loaded
 | 
			
		||||
		   by another thread, in that case we do stupid busy loop waiting
 | 
			
		||||
		   for the other thread to load the tile */
 | 
			
		||||
		 * by another thread, in that case we do stupid busy loop waiting
 | 
			
		||||
		 * for the other thread to load the tile */
 | 
			
		||||
		gtile->refcount++;
 | 
			
		||||
 | 
			
		||||
		BLI_mutex_unlock(&GLOBAL_CACHE.mutex);
 | 
			
		||||
@@ -428,7 +428,7 @@ void IMB_tiles_to_rect(ImBuf *ibuf)
 | 
			
		||||
		for(ty=0; ty<mipbuf->ytiles; ty++) {
 | 
			
		||||
			for(tx=0; tx<mipbuf->xtiles; tx++) {
 | 
			
		||||
				/* acquire tile through cache, this assumes cache is initialized,
 | 
			
		||||
				   which it is always now but it's a weak assumption ... */
 | 
			
		||||
				 * which it is always now but it's a weak assumption ... */
 | 
			
		||||
				gtile= imb_global_cache_get_tile(mipbuf, tx, ty, NULL);
 | 
			
		||||
 | 
			
		||||
				/* setup pointers */
 | 
			
		||||
 
 | 
			
		||||
@@ -68,8 +68,8 @@ int logimage_fread(void *buffer, unsigned int size, unsigned int count, void *lo
 | 
			
		||||
	if (file->file) return fread(buffer, size, count, file->file);
 | 
			
		||||
	else { /*we're reading from memory*/
 | 
			
		||||
		int i;
 | 
			
		||||
		/*we convert ot uchar just on the off chance some platform can't handle
 | 
			
		||||
		  pointer arithmetic with type (void*). */
 | 
			
		||||
		/* we convert ot uchar just on the off chance some platform can't handle
 | 
			
		||||
		 * pointer arithmetic with type (void*). */
 | 
			
		||||
		unsigned char *buf = (unsigned char *) buffer; 
 | 
			
		||||
		
 | 
			
		||||
		for (i=0; i<count; i++) {
 | 
			
		||||
 
 | 
			
		||||
@@ -55,12 +55,12 @@ public:
 | 
			
		||||
	~Image();
 | 
			
		||||
	
 | 
			
		||||
	void allocate(uint w, uint h);
 | 
			
		||||
	/*
 | 
			
		||||
#if 0
 | 
			
		||||
	bool load(const char * name);
 | 
			
		||||
	
 | 
			
		||||
	void wrap(void * data, uint w, uint h);
 | 
			
		||||
	void unwrap();
 | 
			
		||||
	*/
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
	uint width() const;
 | 
			
		||||
	uint height() const;
 | 
			
		||||
 
 | 
			
		||||
@@ -372,11 +372,14 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
 | 
			
		||||
 | 
			
		||||
	/* build a weights buffer */
 | 
			
		||||
	n= 1;
 | 
			
		||||
	/*k= 0;
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
	k= 0;
 | 
			
		||||
	for(i = -n; i <= n; i++)
 | 
			
		||||
		for(j = -n; j <= n; j++)
 | 
			
		||||
			weight[k++] = sqrt((float) i * i + j * j);
 | 
			
		||||
			*/
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	weight[0]=1; weight[1]=2; weight[2]=1;
 | 
			
		||||
	weight[3]=2; weight[4]=0; weight[5]=2;
 | 
			
		||||
	weight[6]=1; weight[7]=2; weight[8]=1;
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@
 | 
			
		||||
#include "math.h"
 | 
			
		||||
 | 
			
		||||
/* This define should be relocated to a global header some where  Kent Mein 
 | 
			
		||||
I stole it from util.h in the plugins api */
 | 
			
		||||
 * I stole it from util.h in the plugins api */
 | 
			
		||||
#define MAX2(x,y)                ( (x)>(y) ? (x) : (y) )
 | 
			
		||||
 | 
			
		||||
/* Only this one is used liberally here, and in imbuf */
 | 
			
		||||
@@ -100,16 +100,15 @@ static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float **
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**************************************************************************
 | 
			
		||||
*                            INTERPOLATIONS 
 | 
			
		||||
*
 | 
			
		||||
* Reference and docs:
 | 
			
		||||
* http://wiki.blender.org/index.php/User:Damiles#Interpolations_Algorithms
 | 
			
		||||
***************************************************************************/
 | 
			
		||||
 *                            INTERPOLATIONS
 | 
			
		||||
 *
 | 
			
		||||
 * Reference and docs:
 | 
			
		||||
 * http://wiki.blender.org/index.php/User:Damiles#Interpolations_Algorithms
 | 
			
		||||
 ***************************************************************************/
 | 
			
		||||
 | 
			
		||||
/* BICUBIC Interpolation functions */
 | 
			
		||||
/*  More info: http://wiki.blender.org/index.php/User:Damiles#Bicubic_pixel_interpolation
 | 
			
		||||
*/
 | 
			
		||||
/* function assumes out to be zero'ed, only does RGBA */
 | 
			
		||||
/* BICUBIC Interpolation functions
 | 
			
		||||
 *  More info: http://wiki.blender.org/index.php/User:Damiles#Bicubic_pixel_interpolation
 | 
			
		||||
 * function assumes out to be zero'ed, only does RGBA */
 | 
			
		||||
 | 
			
		||||
static float P(float k)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -68,24 +68,24 @@ int imb_is_a_jp2(unsigned char *buf)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
sample error callback expecting a FILE* client object
 | 
			
		||||
*/
 | 
			
		||||
 * sample error callback expecting a FILE* client object
 | 
			
		||||
 */
 | 
			
		||||
static void error_callback(const char *msg, void *client_data)
 | 
			
		||||
{
 | 
			
		||||
	FILE *stream = (FILE*)client_data;
 | 
			
		||||
	fprintf(stream, "[ERROR] %s", msg);
 | 
			
		||||
}
 | 
			
		||||
/**
 | 
			
		||||
sample warning callback expecting a FILE* client object
 | 
			
		||||
*/
 | 
			
		||||
 * sample warning callback expecting a FILE* client object
 | 
			
		||||
 */
 | 
			
		||||
static void warning_callback(const char *msg, void *client_data)
 | 
			
		||||
{
 | 
			
		||||
	FILE *stream = (FILE*)client_data;
 | 
			
		||||
	fprintf(stream, "[WARNING] %s", msg);
 | 
			
		||||
}
 | 
			
		||||
/**
 | 
			
		||||
sample debug callback expecting no client object
 | 
			
		||||
*/
 | 
			
		||||
 * sample debug callback expecting no client object
 | 
			
		||||
 */
 | 
			
		||||
static void info_callback(const char *msg, void *client_data)
 | 
			
		||||
{
 | 
			
		||||
	(void)client_data;
 | 
			
		||||
@@ -292,11 +292,11 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
2048x1080 (2K) at 24 fps or 48 fps, or 4096x2160 (4K) at 24 fps; 3x12 bits per pixel, XYZ color space
 | 
			
		||||
 | 
			
		||||
	* In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the imager is used
 | 
			
		||||
	* In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the imager is used
 | 
			
		||||
*/
 | 
			
		||||
 * 2048x1080 (2K) at 24 fps or 48 fps, or 4096x2160 (4K) at 24 fps; 3x12 bits per pixel, XYZ color space
 | 
			
		||||
 *
 | 
			
		||||
 * - In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the imager is used
 | 
			
		||||
 * - In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the imager is used
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ****************************** COPIED FROM image_to_j2k.c */
 | 
			
		||||
 | 
			
		||||
@@ -679,8 +679,8 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags)
 | 
			
		||||
	(void)flags; /* unused */
 | 
			
		||||
	
 | 
			
		||||
	/*
 | 
			
		||||
	configure the event callbacks (not required)
 | 
			
		||||
	setting of each callback is optionnal
 | 
			
		||||
	 * configure the event callbacks (not required)
 | 
			
		||||
	 * setting of each callback is optionnal
 | 
			
		||||
	 */
 | 
			
		||||
	memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
 | 
			
		||||
	event_mgr.error_handler = error_callback;
 | 
			
		||||
 
 | 
			
		||||
@@ -69,11 +69,11 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f
 | 
			
		||||
 *
 | 
			
		||||
 * 1. jpeg - standard printing, u & v at quarter of resulution
 | 
			
		||||
 * 2. jvid - standaard video, u & v half resolution, frame not interlaced
 | 
			
		||||
 | 
			
		||||
type 3 is unsupported as of jul 05 2000 Frank.
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 * type 3 is unsupported as of jul 05 2000 Frank.
 | 
			
		||||
 *
 | 
			
		||||
 * 3. jstr - as 2, but written in 2 separate fields
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 * 4. jmax - no scaling in the components
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,4 @@
 | 
			
		||||
/** \file blender/imbuf/intern/openexr/openexr_api.cpp
 | 
			
		||||
 *  \ingroup openexr
 | 
			
		||||
 */
 | 
			
		||||
/*
 | 
			
		||||
*
 | 
			
		||||
 * ***** BEGIN GPLLICENSE BLOCK *****
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
@@ -29,6 +25,10 @@
 | 
			
		||||
 * ***** END GPL LICENSE BLOCK *****
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** \file blender/imbuf/intern/openexr/openexr_api.cpp
 | 
			
		||||
 *  \ingroup openexr
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
@@ -384,11 +384,11 @@ int imb_save_openexr(struct ImBuf *ibuf, const char *name, int flags)
 | 
			
		||||
/* ********************* Nicer API, MultiLayer and with Tile file support ************************************ */
 | 
			
		||||
 | 
			
		||||
/* naming rules:
 | 
			
		||||
   - parse name from right to left
 | 
			
		||||
   - last character is channel ID, 1 char like 'A' 'R' 'G' 'B' 'X' 'Y' 'Z' 'W' 'U' 'V'
 | 
			
		||||
   - separated with a dot; the Pass name (like "Depth", "Color", "Diffuse" or "Combined")
 | 
			
		||||
   - separated with a dot: the Layer name (like "Lamp1" or "Walls" or "Characters")
 | 
			
		||||
*/
 | 
			
		||||
 * - parse name from right to left
 | 
			
		||||
 * - last character is channel ID, 1 char like 'A' 'R' 'G' 'B' 'X' 'Y' 'Z' 'W' 'U' 'V'
 | 
			
		||||
 * - separated with a dot; the Pass name (like "Depth", "Color", "Diffuse" or "Combined")
 | 
			
		||||
 * - separated with a dot: the Layer name (like "Lamp1" or "Walls" or "Characters")
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static ListBase exrhandles= {NULL, NULL};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ extern "C" {
 | 
			
		||||
  
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
  
 | 
			
		||||
  /**
 | 
			
		||||
/**
 | 
			
		||||
 * Test presence of OpenEXR file.
 | 
			
		||||
 * \param mem pointer to loaded OpenEXR bitstream
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
/* experiment with more advanced exr api */
 | 
			
		||||
 | 
			
		||||
/* Note: as for now openexr only supports 32 chars in channel names.
 | 
			
		||||
   This api also supports max 8 channels per pass now. easy to fix! */
 | 
			
		||||
 * This api also supports max 8 channels per pass now. easy to fix! */
 | 
			
		||||
#define EXR_LAY_MAXNAME		19
 | 
			
		||||
#define EXR_PASS_MAXNAME	11
 | 
			
		||||
#define EXR_TOT_MAXNAME		32
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,4 @@
 | 
			
		||||
/** \file blender/imbuf/intern/openexr/openexr_stub.cpp
 | 
			
		||||
 *  \ingroup openexr
 | 
			
		||||
 */
 | 
			
		||||
/*
 | 
			
		||||
*
 | 
			
		||||
 * ***** BEGIN GPLLICENSE BLOCK *****
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
@@ -29,6 +25,9 @@
 | 
			
		||||
 * ***** END GPL LICENSE BLOCK *****
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** \file blender/imbuf/intern/openexr/openexr_stub.cpp
 | 
			
		||||
 *  \ingroup openexr
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "openexr_api.h"
 | 
			
		||||
#include "openexr_multi.h"
 | 
			
		||||
 
 | 
			
		||||
@@ -205,7 +205,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
 | 
			
		||||
		png_init_io(png_ptr, fp);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
#if 0
 | 
			
		||||
	png_set_filter(png_ptr, 0,
 | 
			
		||||
	               PNG_FILTER_NONE  | PNG_FILTER_VALUE_NONE |
 | 
			
		||||
	               PNG_FILTER_SUB   | PNG_FILTER_VALUE_SUB  |
 | 
			
		||||
@@ -213,7 +213,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
 | 
			
		||||
	               PNG_FILTER_AVG   | PNG_FILTER_VALUE_AVG  |
 | 
			
		||||
	               PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH|
 | 
			
		||||
	               PNG_ALL_FILTERS);
 | 
			
		||||
	*/
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	png_set_compression_level(png_ptr, compression);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -30,12 +30,12 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------------
 | 
			
		||||
  Radiance High Dynamic Range image file IO
 | 
			
		||||
  For description and code for reading/writing of radiance hdr files 
 | 
			
		||||
	by Greg Ward, refer to:
 | 
			
		||||
  http://radsite.lbl.gov/radiance/refer/Notes/picture_format.html
 | 
			
		||||
----------------------------------------------------------------------
 | 
			
		||||
*/
 | 
			
		||||
 * Radiance High Dynamic Range image file IO
 | 
			
		||||
 * For description and code for reading/writing of radiance hdr files
 | 
			
		||||
 * by Greg Ward, refer to:
 | 
			
		||||
 * http://radsite.lbl.gov/radiance/refer/Notes/picture_format.html
 | 
			
		||||
 * ----------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
#  include <io.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -47,8 +47,8 @@
 | 
			
		||||
static void blend_color_mix(char *cp, char *cp1, char *cp2, int fac)
 | 
			
		||||
{
 | 
			
		||||
	/* this and other blending modes previously used >>8 instead of /255. both
 | 
			
		||||
	   are not equivalent (>>8 is /256), and the former results in rounding
 | 
			
		||||
	   errors that can turn colors black fast after repeated blending */
 | 
			
		||||
	 * are not equivalent (>>8 is /256), and the former results in rounding
 | 
			
		||||
	 * errors that can turn colors black fast after repeated blending */
 | 
			
		||||
	int mfac= 255-fac;
 | 
			
		||||
 | 
			
		||||
	cp[0]= (mfac*cp1[0]+fac*cp2[0])/255;
 | 
			
		||||
@@ -93,7 +93,7 @@ static void blend_color_mul(char *cp, char *cp1, char *cp2, int fac)
 | 
			
		||||
static void blend_color_lighten(char *cp, char *cp1, char *cp2, int fac)
 | 
			
		||||
{
 | 
			
		||||
	/* See if are lighter, if so mix, else dont do anything.
 | 
			
		||||
	if the paint col is darker then the original, then ignore */
 | 
			
		||||
	 * if the paint col is darker then the original, then ignore */
 | 
			
		||||
	if (cp1[0]+cp1[1]+cp1[2] > cp2[0]+cp2[1]+cp2[2]) {
 | 
			
		||||
		cp[0]= cp1[0];
 | 
			
		||||
		cp[1]= cp1[1];
 | 
			
		||||
@@ -106,7 +106,7 @@ static void blend_color_lighten(char *cp, char *cp1, char *cp2, int fac)
 | 
			
		||||
static void blend_color_darken(char *cp, char *cp1, char *cp2, int fac)
 | 
			
		||||
{
 | 
			
		||||
	/* See if were darker, if so mix, else dont do anything.
 | 
			
		||||
	if the paint col is brighter then the original, then ignore */
 | 
			
		||||
	 * if the paint col is brighter then the original, then ignore */
 | 
			
		||||
	if (cp1[0]+cp1[1]+cp1[2] < cp2[0]+cp2[1]+cp2[2]) {
 | 
			
		||||
		cp[0]= cp1[0];
 | 
			
		||||
		cp[1]= cp1[1];
 | 
			
		||||
@@ -202,7 +202,7 @@ static void blend_color_mul_float(float *cp, float *cp1, float *cp2, float fac)
 | 
			
		||||
static void blend_color_lighten_float(float *cp, float *cp1, float *cp2, float fac)
 | 
			
		||||
{
 | 
			
		||||
	/* See if are lighter, if so mix, else dont do anything.
 | 
			
		||||
	if the pafloat col is darker then the original, then ignore */
 | 
			
		||||
	 * if the pafloat col is darker then the original, then ignore */
 | 
			
		||||
	if (cp1[0]+cp1[1]+cp1[2] > cp2[0]+cp2[1]+cp2[2]) {
 | 
			
		||||
		cp[0]= cp1[0];
 | 
			
		||||
		cp[1]= cp1[1];
 | 
			
		||||
@@ -215,7 +215,7 @@ static void blend_color_lighten_float(float *cp, float *cp1, float *cp2, float f
 | 
			
		||||
static void blend_color_darken_float(float *cp, float *cp1, float *cp2, float fac)
 | 
			
		||||
{
 | 
			
		||||
	/* See if were darker, if so mix, else dont do anything.
 | 
			
		||||
	if the pafloat col is brighter then the original, then ignore */
 | 
			
		||||
	 * if the pafloat col is brighter then the original, then ignore */
 | 
			
		||||
	if (cp1[0]+cp1[1]+cp1[2] < cp2[0]+cp2[1]+cp2[2]) {
 | 
			
		||||
		cp[0]= cp1[0];
 | 
			
		||||
		cp[1]= cp1[1];
 | 
			
		||||
 
 | 
			
		||||
@@ -773,27 +773,27 @@ static void q_scale_float(float* in, float* out, int in_width,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* q_scale_linear_interpolation (derived from ppmqscale, http://libdv.sf.net)
 | 
			
		||||
 | 
			
		||||
   q stands for quick _and_ quality :)
 | 
			
		||||
 | 
			
		||||
   only handles common cases when we either
 | 
			
		||||
 | 
			
		||||
   scale  both, x and y or
 | 
			
		||||
   shrink both, x and y
 | 
			
		||||
 | 
			
		||||
   but that is pretty fast:
 | 
			
		||||
   * does only blit once instead of two passes like the old code
 | 
			
		||||
	 (fewer cache misses)
 | 
			
		||||
   * uses fixed point integer arithmetic for byte buffers
 | 
			
		||||
   * doesn't branch in tight loops
 | 
			
		||||
 | 
			
		||||
   Should be comparable in speed to the ImBuf ..._fast functions at least 
 | 
			
		||||
   for byte-buffers.
 | 
			
		||||
 | 
			
		||||
   NOTE: disabled, due to inacceptable inaccuracy and quality loss, see bug #18609 (ton)
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
/**
 | 
			
		||||
 * q_scale_linear_interpolation (derived from ppmqscale, http://libdv.sf.net)
 | 
			
		||||
 *
 | 
			
		||||
 * q stands for quick _and_ quality :)
 | 
			
		||||
 *
 | 
			
		||||
 * only handles common cases when we either
 | 
			
		||||
 *
 | 
			
		||||
 * scale  both, x and y or
 | 
			
		||||
 * shrink both, x and y
 | 
			
		||||
 *
 | 
			
		||||
 * but that is pretty fast:
 | 
			
		||||
 * - does only blit once instead of two passes like the old code
 | 
			
		||||
 *   (fewer cache misses)
 | 
			
		||||
 * - uses fixed point integer arithmetic for byte buffers
 | 
			
		||||
 * - doesn't branch in tight loops
 | 
			
		||||
 *
 | 
			
		||||
 * Should be comparable in speed to the ImBuf ..._fast functions at least
 | 
			
		||||
 * for byte-buffers.
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE: disabled, due to inacceptable inaccuracy and quality loss, see bug #18609 (ton)
 | 
			
		||||
 */
 | 
			
		||||
static int q_scale_linear_interpolation(
 | 
			
		||||
	struct ImBuf *ibuf, int newx, int newy)
 | 
			
		||||
{
 | 
			
		||||
@@ -1473,7 +1473,7 @@ struct ImBuf *IMB_scaleImBuf(struct ImBuf * ibuf, unsigned int newx, unsigned in
 | 
			
		||||
	if (newx == ibuf->x && newy == ibuf->y) { return ibuf; }
 | 
			
		||||
 | 
			
		||||
	/* scaleup / scaledown functions below change ibuf->x and ibuf->y
 | 
			
		||||
	   so we first scale the Z-buffer (if any) */
 | 
			
		||||
	 * so we first scale the Z-buffer (if any) */
 | 
			
		||||
	scalefast_Z_ImBuf(ibuf, newx, newy);
 | 
			
		||||
 | 
			
		||||
	/* try to scale common cases in a fast way */
 | 
			
		||||
 
 | 
			
		||||
@@ -554,7 +554,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* detect if we are reading a tiled/mipmapped texture, in that case
 | 
			
		||||
	   we don't read pixels but leave it to the cache to load tiles */
 | 
			
		||||
	 * we don't read pixels but leave it to the cache to load tiles */
 | 
			
		||||
	if(flags & IB_tilecache) {
 | 
			
		||||
		format= NULL;
 | 
			
		||||
		TIFFGetField(image, TIFFTAG_PIXAR_TEXTUREFORMAT, &format);
 | 
			
		||||
 
 | 
			
		||||
@@ -54,15 +54,14 @@ typedef struct IDProperty {
 | 
			
		||||
	char type, subtype;
 | 
			
		||||
	short flag;
 | 
			
		||||
	char name[64];	/* MAX_IDPROP_NAME */
 | 
			
		||||
	int saved; /*saved is used to indicate if this struct has been saved yet.
 | 
			
		||||
				seemed like a good idea as a pad var was needed anyway :)*/
 | 
			
		||||
	int saved; /* saved is used to indicate if this struct has been saved yet.
 | 
			
		||||
	            * seemed like a good idea as a pad var was needed anyway :)*/
 | 
			
		||||
	IDPropertyData data;	/* note, alignment for 64 bits */
 | 
			
		||||
	int len; /* array length, also (this is important!) string length + 1.
 | 
			
		||||
	          * the idea is to be able to reuse array realloc functions on strings.*/
 | 
			
		||||
	/* totallen is total length of allocated array/string, including a buffer.
 | 
			
		||||
	 * Note that the buffering is mild; the code comes from python's list implementation.*/
 | 
			
		||||
	int totallen; /*strings and arrays are both buffered, though the buffer isn't
 | 
			
		||||
					saved.*/
 | 
			
		||||
	int totallen; /*strings and arrays are both buffered, though the buffer isn't saved.*/
 | 
			
		||||
} IDProperty;
 | 
			
		||||
 | 
			
		||||
#define MAX_IDPROP_NAME	64
 | 
			
		||||
 
 | 
			
		||||
@@ -416,7 +416,7 @@ typedef enum eItasc_Solver {
 | 
			
		||||
/* Groups -------------------------------------- */
 | 
			
		||||
 | 
			
		||||
/* Action-Channel Group (agrp)
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 * These are stored as a list per-Action, and are only used to 
 | 
			
		||||
 * group that Action's channels in an Animation Editor. 
 | 
			
		||||
 *
 | 
			
		||||
 
 | 
			
		||||
@@ -199,7 +199,7 @@ typedef struct bTwoDFilterActuator {
 | 
			
		||||
	/* Tells what type of 2D Filter */
 | 
			
		||||
	short type;
 | 
			
		||||
	/* (flag == 0) means 2D filter is activate and
 | 
			
		||||
	   (flag != 0) means 2D filter is inactive */
 | 
			
		||||
	 * (flag != 0) means 2D filter is inactive */
 | 
			
		||||
	short flag;
 | 
			
		||||
	int   int_arg;
 | 
			
		||||
	/* a float argument */
 | 
			
		||||
 
 | 
			
		||||
@@ -36,13 +36,13 @@
 | 
			
		||||
struct AnimData;
 | 
			
		||||
 | 
			
		||||
/* this system works on different transformation space levels;
 | 
			
		||||
 | 
			
		||||
1) Bone Space;		with each Bone having own (0,0,0) origin
 | 
			
		||||
2) Armature Space;  the rest position, in Object space, Bones Spaces are applied hierarchical
 | 
			
		||||
3) Pose Space;		the animation position, in Object space
 | 
			
		||||
4) World Space;		Object matrix applied to Pose or Armature space
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 *
 | 
			
		||||
 * 1) Bone Space;      with each Bone having own (0,0,0) origin
 | 
			
		||||
 * 2) Armature Space;  the rest position, in Object space, Bones Spaces are applied hierarchical
 | 
			
		||||
 * 3) Pose Space;      the animation position, in Object space
 | 
			
		||||
 * 4) World Space;     Object matrix applied to Pose or Armature space
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct Bone {
 | 
			
		||||
	struct Bone		*next, *prev;	/*	Next/prev elements within this list	*/
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ typedef struct Camera {
 | 
			
		||||
	
 | 
			
		||||
	/* yafray: dof params */
 | 
			
		||||
	/* qdn: yafray var 'YF_dofdist' now enabled for defocus composite node as well.
 | 
			
		||||
			The name was not changed so that no other files need to be modified */
 | 
			
		||||
	 * The name was not changed so that no other files need to be modified */
 | 
			
		||||
	float YF_dofdist;
 | 
			
		||||
 | 
			
		||||
	struct Ipo *ipo  DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
 | 
			
		||||
 
 | 
			
		||||
@@ -33,16 +33,16 @@
 | 
			
		||||
#define __DNA_CLOTH_TYPES_H__
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
* This struct contains all the global data required to run a simulation.
 | 
			
		||||
* At the time of this writing, this structure contains data appropriate
 | 
			
		||||
* to run a simulation as described in Deformation Constraints in a
 | 
			
		||||
* Mass-Spring Model to Describe Rigid Cloth Behavior by Xavier Provot.
 | 
			
		||||
*
 | 
			
		||||
* I've tried to keep similar, if not exact names for the variables as
 | 
			
		||||
* are presented in the paper.  Where I've changed the concept slightly,
 | 
			
		||||
* as in stepsPerFrame comapred to the time step in the paper, I've used
 | 
			
		||||
* variables with different names to minimize confusion.
 | 
			
		||||
**/
 | 
			
		||||
 * This struct contains all the global data required to run a simulation.
 | 
			
		||||
 * At the time of this writing, this structure contains data appropriate
 | 
			
		||||
 * to run a simulation as described in Deformation Constraints in a
 | 
			
		||||
 * Mass-Spring Model to Describe Rigid Cloth Behavior by Xavier Provot.
 | 
			
		||||
 *
 | 
			
		||||
 * I've tried to keep similar, if not exact names for the variables as
 | 
			
		||||
 * are presented in the paper.  Where I've changed the concept slightly,
 | 
			
		||||
 * as in stepsPerFrame comapred to the time step in the paper, I've used
 | 
			
		||||
 * variables with different names to minimize confusion.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct ClothSimSettings
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -92,16 +92,16 @@ typedef struct BevPoint {
 | 
			
		||||
 */
 | 
			
		||||
/* note: alfa location in struct is abused by Key system */
 | 
			
		||||
/* vec in BezTriple looks like this:
 | 
			
		||||
	vec[0][0]=x location of handle 1
 | 
			
		||||
	vec[0][1]=y location of handle 1
 | 
			
		||||
	vec[0][2]=z location of handle 1 (not used for FCurve Points(2d))
 | 
			
		||||
	vec[1][0]=x location of control point
 | 
			
		||||
	vec[1][1]=y location of control point
 | 
			
		||||
	vec[1][2]=z location of control point
 | 
			
		||||
	vec[2][0]=x location of handle 2
 | 
			
		||||
	vec[2][1]=y location of handle 2
 | 
			
		||||
	vec[2][2]=z location of handle 2 (not used for FCurve Points(2d))
 | 
			
		||||
*/
 | 
			
		||||
 * - vec[0][0]=x location of handle 1
 | 
			
		||||
 * - vec[0][1]=y location of handle 1
 | 
			
		||||
 * - vec[0][2]=z location of handle 1 (not used for FCurve Points(2d))
 | 
			
		||||
 * - vec[1][0]=x location of control point
 | 
			
		||||
 * - vec[1][1]=y location of control point
 | 
			
		||||
 * - vec[1][2]=z location of control point
 | 
			
		||||
 * - vec[2][0]=x location of handle 2
 | 
			
		||||
 * - vec[2][1]=y location of handle 2
 | 
			
		||||
 * - vec[2][2]=z location of handle 2 (not used for FCurve Points(2d))
 | 
			
		||||
 */
 | 
			
		||||
typedef struct BezTriple {
 | 
			
		||||
	float vec[3][3];
 | 
			
		||||
	float alfa, weight, radius;	/* alfa: tilt in 3D View, weight: used for softbody goal weight, radius: for bevel tapering */
 | 
			
		||||
 
 | 
			
		||||
@@ -60,14 +60,14 @@
 | 
			
		||||
 *
 | 
			
		||||
 * DNA has no external dependencies (except for a few system
 | 
			
		||||
 * includes).
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 * \section dnanote NOTE
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 * PLEASE READ INSTRUCTIONS ABOUT ADDING VARIABLES IN 'DNA' STRUCTS IN
 | 
			
		||||
 *
 | 
			
		||||
 * intern/dna_genfile.c
 | 
			
		||||
 * (ton)
 | 
			
		||||
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -159,7 +159,7 @@ typedef struct DynamicPaintCanvasSettings {
 | 
			
		||||
#define MOD_DPAINT_PART_RAD (1<<0) /* use particle radius */
 | 
			
		||||
#define MOD_DPAINT_USE_MATERIAL (1<<1) /* use object material */
 | 
			
		||||
#define MOD_DPAINT_ABS_ALPHA (1<<2) /* don't increase alpha unless
 | 
			
		||||
									paint alpha is higher than existing */
 | 
			
		||||
                                     * paint alpha is higher than existing */
 | 
			
		||||
#define MOD_DPAINT_ERASE (1<<3) /* removes paint */
 | 
			
		||||
 | 
			
		||||
#define MOD_DPAINT_RAMP_ALPHA (1<<4) /* only read falloff ramp alpha */
 | 
			
		||||
 
 | 
			
		||||
@@ -136,7 +136,7 @@ typedef struct Material {
 | 
			
		||||
	short diff_shader, spec_shader;
 | 
			
		||||
	float roughness, refrac;
 | 
			
		||||
	/* XXX param[4] needs review and improvement (shader system as whole anyway)
 | 
			
		||||
	   This is nasty reused variable for different goals and not easy to RNAify nicely. -jesterKing */
 | 
			
		||||
	 * This is nasty reused variable for different goals and not easy to RNAify nicely. -jesterKing */
 | 
			
		||||
	float param[4];		/* size, smooth, size, smooth, for toonshader, 0 (fac) and 1 (fresnel) also for fresnel shader */
 | 
			
		||||
	float rms;
 | 
			
		||||
	float darkness;
 | 
			
		||||
 
 | 
			
		||||
@@ -77,8 +77,8 @@ typedef struct Mesh {
 | 
			
		||||
	struct MLoopCol *mloopcol;
 | 
			
		||||
/* END BMESH ONLY */
 | 
			
		||||
 | 
			
		||||
	/*mface stores the tessellation (triangulation) of the mesh,
 | 
			
		||||
	  real faces are now stored in nface.*/
 | 
			
		||||
	/* mface stores the tessellation (triangulation) of the mesh,
 | 
			
		||||
	 * real faces are now stored in nface.*/
 | 
			
		||||
	struct MFace *mface;	/* array of mesh object mode faces for tessellation */
 | 
			
		||||
	struct MTFace *mtface;	/* store tessellation face UV's and texture here */
 | 
			
		||||
	struct TFace *tface;	/* depecrated, use mtface */
 | 
			
		||||
@@ -87,7 +87,7 @@ typedef struct Mesh {
 | 
			
		||||
	struct MDeformVert *dvert;	/* deformgroup vertices */
 | 
			
		||||
 | 
			
		||||
	/* array of colors for the tesselated faces, must be number of tesselated
 | 
			
		||||
	   faces * 4 in length */
 | 
			
		||||
	 * faces * 4 in length */
 | 
			
		||||
	struct MCol *mcol;		
 | 
			
		||||
	struct MSticky *msticky;
 | 
			
		||||
	struct Mesh *texcomesh;
 | 
			
		||||
@@ -194,27 +194,6 @@ typedef struct TFace {
 | 
			
		||||
/* debug only option */
 | 
			
		||||
#define ME_DRAWEXTRA_INDICES (1 << 13)
 | 
			
		||||
 | 
			
		||||
/* old global flags:
 | 
			
		||||
#define G_DRAWEDGES		(1 << 18)
 | 
			
		||||
#define G_DRAWFACES		(1 <<  7)
 | 
			
		||||
#define G_DRAWNORMALS	(1 <<  6)
 | 
			
		||||
#define G_DRAW_VNORMALS	(1 << 14)
 | 
			
		||||
 | 
			
		||||
#define G_ALLEDGES		(1 << 11)
 | 
			
		||||
#define G_HIDDENEDGES   (1 << 21)
 | 
			
		||||
 | 
			
		||||
#define G_DRAWCREASES	(1 << 19)
 | 
			
		||||
#define G_DRAWSEAMS     (1 << 20)
 | 
			
		||||
#define G_DRAWSHARP     (1 << 28)
 | 
			
		||||
#define G_DRAWBWEIGHTS	(1 << 31)
 | 
			
		||||
 | 
			
		||||
#define G_DRAW_EDGELEN  (1 << 22) 
 | 
			
		||||
#define G_DRAW_FACEAREA (1 << 23)
 | 
			
		||||
#define G_DRAW_EDGEANG  (1 << 24)
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Subsurf Type */
 | 
			
		||||
#define ME_CC_SUBSURF 		0
 | 
			
		||||
#define ME_SIMPLE_SUBSURF 	1
 | 
			
		||||
 
 | 
			
		||||
@@ -75,8 +75,8 @@ typedef struct MCol {
 | 
			
		||||
	char a, r, g, b;	
 | 
			
		||||
} MCol;
 | 
			
		||||
 | 
			
		||||
/*new face structure, replaces MFace, which is now
 | 
			
		||||
  only used for storing tessellations.*/
 | 
			
		||||
/* new face structure, replaces MFace, which is now
 | 
			
		||||
 * only used for storing tessellations.*/
 | 
			
		||||
typedef struct MPoly {
 | 
			
		||||
	/* offset into loop array and number of loops in the face */
 | 
			
		||||
	int loopstart;
 | 
			
		||||
@@ -85,8 +85,8 @@ typedef struct MPoly {
 | 
			
		||||
	char flag, pad;
 | 
			
		||||
} MPoly;
 | 
			
		||||
 | 
			
		||||
/*the e here is because we want to move away from
 | 
			
		||||
  relying on edge hashes.*/
 | 
			
		||||
/* the e here is because we want to move away from
 | 
			
		||||
 * relying on edge hashes.*/
 | 
			
		||||
typedef struct MLoop {
 | 
			
		||||
	unsigned int v; /*vertex index*/
 | 
			
		||||
	unsigned int e; /*edge index*/
 | 
			
		||||
 
 | 
			
		||||
@@ -87,8 +87,8 @@ typedef struct MetaBall {
 | 
			
		||||
	float wiresize, rendersize; /* display and render res */
 | 
			
		||||
	
 | 
			
		||||
	/* bias elements to have an offset volume.
 | 
			
		||||
	mother ball changes will effect other objects thresholds,
 | 
			
		||||
	but these may also have their own thresh as an offset */
 | 
			
		||||
	 * mother ball changes will effect other objects thresholds,
 | 
			
		||||
	 * but these may also have their own thresh as an offset */
 | 
			
		||||
	float thresh;
 | 
			
		||||
 | 
			
		||||
	/* used in editmode */
 | 
			
		||||
 
 | 
			
		||||
@@ -191,11 +191,11 @@ typedef struct ArrayModifierData {
 | 
			
		||||
	/* the object to use for object offset */
 | 
			
		||||
	struct Object *offset_ob;
 | 
			
		||||
	/* a constant duplicate offset;
 | 
			
		||||
	   1 means the duplicates are 1 unit apart
 | 
			
		||||
	 * 1 means the duplicates are 1 unit apart
 | 
			
		||||
	 */
 | 
			
		||||
	float offset[3];
 | 
			
		||||
	/* a scaled factor for duplicate offsets;
 | 
			
		||||
	   1 means the duplicates are 1 object-width apart
 | 
			
		||||
	 * 1 means the duplicates are 1 object-width apart
 | 
			
		||||
	 */
 | 
			
		||||
	float scale[3];
 | 
			
		||||
	/* the length over which to distribute the duplicates */
 | 
			
		||||
@@ -203,20 +203,20 @@ typedef struct ArrayModifierData {
 | 
			
		||||
	/* the limit below which to merge vertices in adjacent duplicates */
 | 
			
		||||
	float merge_dist;
 | 
			
		||||
	/* determines how duplicate count is calculated; one of:
 | 
			
		||||
		  MOD_ARR_FIXEDCOUNT -> fixed
 | 
			
		||||
		  MOD_ARR_FITLENGTH  -> calculated to fit a set length
 | 
			
		||||
		  MOD_ARR_FITCURVE   -> calculated to fit the length of a Curve object
 | 
			
		||||
	 * - MOD_ARR_FIXEDCOUNT -> fixed
 | 
			
		||||
	 * - MOD_ARR_FITLENGTH  -> calculated to fit a set length
 | 
			
		||||
	 * - MOD_ARR_FITCURVE   -> calculated to fit the length of a Curve object
 | 
			
		||||
	 */
 | 
			
		||||
	int fit_type;
 | 
			
		||||
	/* flags specifying how total offset is calculated; binary OR of:
 | 
			
		||||
		 MOD_ARR_OFF_CONST    -> total offset += offset
 | 
			
		||||
		 MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
 | 
			
		||||
		 MOD_ARR_OFF_OBJ      -> total offset += offset_ob's matrix
 | 
			
		||||
	   total offset is the sum of the individual enabled offsets
 | 
			
		||||
	 * - MOD_ARR_OFF_CONST    -> total offset += offset
 | 
			
		||||
	 * - MOD_ARR_OFF_RELATIVE -> total offset += relative * object width
 | 
			
		||||
	 * - MOD_ARR_OFF_OBJ      -> total offset += offset_ob's matrix
 | 
			
		||||
	 * total offset is the sum of the individual enabled offsets
 | 
			
		||||
	 */
 | 
			
		||||
	int offset_type;
 | 
			
		||||
	/* general flags:
 | 
			
		||||
		  MOD_ARR_MERGE -> merge vertices in adjacent duplicates
 | 
			
		||||
	 * MOD_ARR_MERGE -> merge vertices in adjacent duplicates
 | 
			
		||||
	 */
 | 
			
		||||
	int flags;
 | 
			
		||||
	/* the number of duplicates to generate for MOD_ARR_FIXEDCOUNT */
 | 
			
		||||
@@ -1045,7 +1045,7 @@ typedef struct RemeshModifierData {
 | 
			
		||||
	ModifierData modifier;
 | 
			
		||||
 | 
			
		||||
	/* floodfill option, controls how small components can be
 | 
			
		||||
	   before they are removed */
 | 
			
		||||
	 * before they are removed */
 | 
			
		||||
	float threshold;
 | 
			
		||||
 | 
			
		||||
	/* ratio between size of model and grid */
 | 
			
		||||
 
 | 
			
		||||
@@ -78,8 +78,8 @@ typedef struct MovieClip {
 | 
			
		||||
 | 
			
		||||
	struct MovieTracking tracking;		/* data for SfM tracking */
 | 
			
		||||
	void *tracking_context;				/* context of tracking job
 | 
			
		||||
										   used to synchronize data like framenumber
 | 
			
		||||
										   in SpaceClip clip user */
 | 
			
		||||
										 * used to synchronize data like framenumber
 | 
			
		||||
										 * in SpaceClip clip user */
 | 
			
		||||
 | 
			
		||||
	struct MovieClipProxy proxy;		/* proxy to clip data */
 | 
			
		||||
	int flag, pad;
 | 
			
		||||
 
 | 
			
		||||
@@ -238,7 +238,7 @@ typedef struct bNodeTree {
 | 
			
		||||
	
 | 
			
		||||
	int type, init;					/* set init on fileread */
 | 
			
		||||
	int cur_index;					/* sockets in groups have unique identifiers, adding new sockets always 
 | 
			
		||||
									   will increase this counter */
 | 
			
		||||
									 * will increase this counter */
 | 
			
		||||
	int flag;
 | 
			
		||||
	int update;						/* update flags */
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
@@ -130,7 +130,7 @@ typedef struct EffectorWeights {
 | 
			
		||||
 * - to add new data types update:
 | 
			
		||||
 *		* BKE_ptcache_data_size()
 | 
			
		||||
 *		* ptcache_file_init_pointers()
 | 
			
		||||
*/
 | 
			
		||||
 */
 | 
			
		||||
#define BPHYS_DATA_INDEX		0
 | 
			
		||||
#define BPHYS_DATA_LOCATION		1
 | 
			
		||||
#define BPHYS_DATA_SMOKE_LOW	1
 | 
			
		||||
@@ -276,9 +276,10 @@ typedef struct SoftBody {
 | 
			
		||||
	
 | 
			
		||||
	/* general options */
 | 
			
		||||
	float nodemass;		/* softbody mass of *vertex* */
 | 
			
		||||
	char  namedVG_Mass[64]; /* MAX_VGROUP_NAME */ /* along with it introduce mass painting
 | 
			
		||||
							starting to fix old bug .. nastyness that VG are indexes 
 | 
			
		||||
								rather find them by name tag to find it -> jow20090613 */
 | 
			
		||||
	char  namedVG_Mass[64]; /* MAX_VGROUP_NAME */
 | 
			
		||||
	                        /* along with it introduce mass painting
 | 
			
		||||
	                         * starting to fix old bug .. nastyness that VG are indexes
 | 
			
		||||
	                         * rather find them by name tag to find it -> jow20090613 */
 | 
			
		||||
	float grav;			/* softbody amount of gravitaion to apply */
 | 
			
		||||
	float mediafrict;	/* friction to env */
 | 
			
		||||
	float rklimit;		/* error limit for ODE solver */
 | 
			
		||||
@@ -291,17 +292,19 @@ typedef struct SoftBody {
 | 
			
		||||
	float maxgoal;
 | 
			
		||||
	float defgoal;		/* default goal for vertices without vgroup */
 | 
			
		||||
	short vertgroup;	/* index starting at 1 */
 | 
			
		||||
	char  namedVG_Softgoal[64]; /* MAX_VGROUP_NAME */ /* starting to fix old bug .. nastyness that VG are indexes 
 | 
			
		||||
								rather find them by name tag to find it -> jow20090613 */
 | 
			
		||||
	char  namedVG_Softgoal[64]; /* MAX_VGROUP_NAME */
 | 
			
		||||
	                            /* starting to fix old bug .. nastyness that VG are indexes
 | 
			
		||||
	                             * rather find them by name tag to find it -> jow20090613 */
 | 
			
		||||
  
 | 
			
		||||
	short fuzzyness;      /* */
 | 
			
		||||
	
 | 
			
		||||
	/* springs */
 | 
			
		||||
	float inspring;		/* softbody inner springs */
 | 
			
		||||
	float infrict;		/* softbody inner springs friction */
 | 
			
		||||
	char  namedVG_Spring_K[64]; /* MAX_VGROUP_NAME */ /* along with it introduce Spring_K painting
 | 
			
		||||
	                               starting to fix old bug .. nastyness that VG are indexes
 | 
			
		||||
	                               rather find them by name tag to find it -> jow20090613 */
 | 
			
		||||
	char  namedVG_Spring_K[64]; /* MAX_VGROUP_NAME */
 | 
			
		||||
	                            /* along with it introduce Spring_K painting
 | 
			
		||||
	                             * starting to fix old bug .. nastyness that VG are indexes
 | 
			
		||||
	                             * rather find them by name tag to find it -> jow20090613 */
 | 
			
		||||
	
 | 
			
		||||
	/* baking */
 | 
			
		||||
	int sfra, efra;
 | 
			
		||||
 
 | 
			
		||||
@@ -837,11 +837,12 @@ typedef struct TransformOrientation {
 | 
			
		||||
} TransformOrientation;
 | 
			
		||||
 | 
			
		||||
/* *************************************************************** */
 | 
			
		||||
/* Unified Paint Settings */
 | 
			
		||||
/* Unified Paint Settings
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* These settings can override the equivalent fields in the active
 | 
			
		||||
   Brush for any paint mode; the flag field controls whether these
 | 
			
		||||
   values are used */
 | 
			
		||||
 * Brush for any paint mode; the flag field controls whether these
 | 
			
		||||
 * values are used */
 | 
			
		||||
typedef struct UnifiedPaintSettings {
 | 
			
		||||
	/* unified radius of brush in pixels */
 | 
			
		||||
	int size;
 | 
			
		||||
@@ -861,12 +862,12 @@ typedef enum {
 | 
			
		||||
	UNIFIED_PAINT_ALPHA = (1<<1),
 | 
			
		||||
 | 
			
		||||
	/* only used if unified size is enabled, mirros the brush flags
 | 
			
		||||
	   BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
 | 
			
		||||
	 * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
 | 
			
		||||
	UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1<<2),
 | 
			
		||||
	UNIFIED_PAINT_BRUSH_SIZE_PRESSURE   = (1<<3),
 | 
			
		||||
 | 
			
		||||
	/* only used if unified alpha is enabled, mirrors the brush flag
 | 
			
		||||
	   BRUSH_ALPHA_PRESSURE */
 | 
			
		||||
	 * BRUSH_ALPHA_PRESSURE */
 | 
			
		||||
	UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE  = (1<<4)
 | 
			
		||||
} UnifiedPaintSettingsFlags;
 | 
			
		||||
 | 
			
		||||
@@ -995,7 +996,7 @@ typedef struct ToolSettings {
 | 
			
		||||
	int uv_sculpt_tool;
 | 
			
		||||
	int uv_relax_method;
 | 
			
		||||
	/* XXX: these sculpt_paint_* fields are deprecated, use the
 | 
			
		||||
	   unified_paint_settings field instead! */
 | 
			
		||||
	 * unified_paint_settings field instead! */
 | 
			
		||||
	short sculpt_paint_settings DNA_DEPRECATED;	short pad1;
 | 
			
		||||
	int sculpt_paint_unified_size DNA_DEPRECATED;
 | 
			
		||||
	float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED;
 | 
			
		||||
 
 | 
			
		||||
@@ -48,14 +48,14 @@ typedef struct SDNA {
 | 
			
		||||
	short *typelens;	/* type lengths */
 | 
			
		||||
 | 
			
		||||
	int nr_structs;		/* number of struct types */
 | 
			
		||||
	short **structs;	/* sp= structs[a] is the address of a struct definintion
 | 
			
		||||
						   sp[0] is struct type number, sp[1] amount of members
 | 
			
		||||
 | 
			
		||||
						   (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
 | 
			
		||||
						   type and name numbers respectively */
 | 
			
		||||
	short **structs;	/* sp = structs[a] is the address of a struct definintion
 | 
			
		||||
	                     * sp[0] is struct type number, sp[1] amount of members
 | 
			
		||||
	                     *
 | 
			
		||||
	                     * (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
 | 
			
		||||
	                     * type and name numbers respectively */
 | 
			
		||||
 | 
			
		||||
	struct GHash *structs_map; /* ghash for faster lookups,
 | 
			
		||||
								  requires WITH_DNA_GHASH to be used for now */
 | 
			
		||||
	                            * requires WITH_DNA_GHASH to be used for now */
 | 
			
		||||
 | 
			
		||||
		/* wrong place for this really, its a simple
 | 
			
		||||
		 * cache for findstruct_nr.
 | 
			
		||||
 
 | 
			
		||||
@@ -109,8 +109,7 @@ typedef struct SmokeDomainSettings {
 | 
			
		||||
 | 
			
		||||
/* flags */
 | 
			
		||||
#define MOD_SMOKE_FLOW_ABSOLUTE (1<<1) /*old style emission*/
 | 
			
		||||
#define MOD_SMOKE_FLOW_INITVELOCITY (1<<2) /* passes particles speed to
 | 
			
		||||
										 the smoke*/
 | 
			
		||||
#define MOD_SMOKE_FLOW_INITVELOCITY (1<<2) /* passes particles speed to the smoke */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef struct SmokeFlowSettings {
 | 
			
		||||
@@ -128,11 +127,10 @@ typedef struct SmokeFlowSettings {
 | 
			
		||||
	int flags; /* absolute emission etc*/
 | 
			
		||||
} SmokeFlowSettings;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	struct BVHTreeFromMesh *bvh;
 | 
			
		||||
	float mat[4][4];
 | 
			
		||||
	float mat_old[4][4];
 | 
			
		||||
	*/
 | 
			
		||||
 | 
			
		||||
// struct BVHTreeFromMesh *bvh;
 | 
			
		||||
// float mat[4][4];
 | 
			
		||||
// float mat_old[4][4];
 | 
			
		||||
 | 
			
		||||
/* collision objects (filled with smoke) */
 | 
			
		||||
typedef struct SmokeCollSettings {
 | 
			
		||||
 
 | 
			
		||||
@@ -75,8 +75,8 @@ typedef struct bSound {
 | 
			
		||||
	int flags;
 | 
			
		||||
	int pad;
 | 
			
		||||
 | 
			
		||||
/**	currently	int type;
 | 
			
		||||
	struct bSound *child_sound;*/
 | 
			
		||||
//	currently	int type;
 | 
			
		||||
//	struct bSound *child_sound;*/
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * The audaspace handle for cache.
 | 
			
		||||
@@ -94,17 +94,19 @@ typedef struct bSound {
 | 
			
		||||
	 */
 | 
			
		||||
	void *playback_handle;
 | 
			
		||||
 | 
			
		||||
/**	XXX unused currently	// SOUND_TYPE_LIMITER
 | 
			
		||||
	float start, end;*/
 | 
			
		||||
//	XXX unused currently	// SOUND_TYPE_LIMITER
 | 
			
		||||
//	float start, end;*/
 | 
			
		||||
} bSound;
 | 
			
		||||
 | 
			
		||||
/* XXX unused currently
 | 
			
		||||
/* XXX unused currently */
 | 
			
		||||
#if 0
 | 
			
		||||
typedef enum eSound_Type {
 | 
			
		||||
	SOUND_TYPE_INVALID = -1,
 | 
			
		||||
	SOUND_TYPE_FILE = 0,
 | 
			
		||||
	SOUND_TYPE_BUFFER,
 | 
			
		||||
	SOUND_TYPE_LIMITER
 | 
			
		||||
} eSound_Type;*/
 | 
			
		||||
} eSound_Type;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* spacesound->flag */
 | 
			
		||||
#define SND_DRAWFRAMES	1
 | 
			
		||||
 
 | 
			
		||||
@@ -215,9 +215,9 @@ typedef struct SpaceFile {
 | 
			
		||||
	ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
 | 
			
		||||
 | 
			
		||||
	/* operator that is invoking fileselect 
 | 
			
		||||
	   op->exec() will be called on the 'Load' button.
 | 
			
		||||
	   if operator provides op->cancel(), then this will be invoked
 | 
			
		||||
	   on the cancel button.
 | 
			
		||||
	 * op->exec() will be called on the 'Load' button.
 | 
			
		||||
	 * if operator provides op->cancel(), then this will be invoked
 | 
			
		||||
	 * on the cancel button.
 | 
			
		||||
	 */
 | 
			
		||||
	struct wmOperator *op; 
 | 
			
		||||
 | 
			
		||||
@@ -517,7 +517,7 @@ typedef struct SpaceClip {
 | 
			
		||||
	float loc[2], scale, angle;	/* pre-composed stabilization data */
 | 
			
		||||
	int pad;
 | 
			
		||||
	float stabmat[4][4], unistabmat[4][4];  /* current stabilization matrix and the same matrix in unified space,
 | 
			
		||||
												   defined when drawing and used for mouse position calculation */
 | 
			
		||||
	                                         * defined when drawing and used for mouse position calculation */
 | 
			
		||||
 | 
			
		||||
	/* movie postprocessing */
 | 
			
		||||
	int postproc_flag;
 | 
			
		||||
 
 | 
			
		||||
@@ -619,11 +619,11 @@ extern UserDef U; /* from blenkernel blender.c */
 | 
			
		||||
/* orbit navigation modes
 | 
			
		||||
 * only two options, so it's sort of a hybrid bool/enum
 | 
			
		||||
 * if ((U.ndof_flag & NDOF_ORBIT_MODE) == NDOF_OM_OBJECT)... */
 | 
			
		||||
/*
 | 
			
		||||
#define NDOF_ORBIT_MODE     (1 << 6)
 | 
			
		||||
#define NDOF_OM_TARGETCAMERA 0
 | 
			
		||||
#define NDOF_OM_OBJECT      NDOF_ORBIT_MODE
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
// #define NDOF_ORBIT_MODE     (1 << 6)
 | 
			
		||||
// #define NDOF_OM_TARGETCAMERA 0
 | 
			
		||||
// #define NDOF_OM_OBJECT      NDOF_ORBIT_MODE
 | 
			
		||||
 | 
			
		||||
/* actually... users probably don't care about what the mode
 | 
			
		||||
 * is called, just that it feels right */
 | 
			
		||||
/* zoom is up/down if this flag is set (otherwise forward/backward) */
 | 
			
		||||
 
 | 
			
		||||
@@ -51,90 +51,90 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* gcc 4.1 on mingw was complaining that __int64 was already defined
 | 
			
		||||
actually is saw the line below as typedef long long long long... 
 | 
			
		||||
Anyhow, since its already defined, its safe to do an ifndef here- Campbell */
 | 
			
		||||
 * actually is saw the line below as typedef long long long long...
 | 
			
		||||
 * Anyhow, since its already defined, its safe to do an ifndef here- Campbell */
 | 
			
		||||
#ifdef FREE_WINDOWS
 | 
			
		||||
#ifndef __int64
 | 
			
		||||
#  ifndef __int64
 | 
			
		||||
typedef long long __int64;
 | 
			
		||||
#endif
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * - please note: no builtin security to detect input of double structs
 | 
			
		||||
 * - if you want a struct not to be in DNA file: add two hash marks above it (#<enter>#<enter>)
 | 
			
		||||
 | 
			
		||||
Structure DNA data is added to each blender file and to each executable, this to detect
 | 
			
		||||
in .blend files new veriables in structs, changed array sizes, etc. It's also used for
 | 
			
		||||
converting endian and pointer size (32-64 bits)
 | 
			
		||||
As an extra, Python uses a call to detect run-time the contents of a blender struct.
 | 
			
		||||
 | 
			
		||||
Create a structDNA: only needed when one of the input include (.h) files change.
 | 
			
		||||
File Syntax:
 | 
			
		||||
	SDNA (4 bytes) (magic number)
 | 
			
		||||
	NAME (4 bytes)
 | 
			
		||||
	<nr> (4 bytes) amount of names (int)
 | 
			
		||||
	<string> 
 | 
			
		||||
	<string>
 | 
			
		||||
	...
 | 
			
		||||
	...
 | 
			
		||||
	TYPE (4 bytes)
 | 
			
		||||
	<nr> amount of types (int)
 | 
			
		||||
	<string>
 | 
			
		||||
	<string>
 | 
			
		||||
	...
 | 
			
		||||
	...
 | 
			
		||||
	TLEN (4 bytes)
 | 
			
		||||
	<len> (short) the lengths of types
 | 
			
		||||
	<len>
 | 
			
		||||
	...
 | 
			
		||||
	...
 | 
			
		||||
	STRC (4 bytes)
 | 
			
		||||
	<nr> amount of structs (int)
 | 
			
		||||
	<typenr><nr_of_elems> <typenr><namenr> <typenr><namenr> ...
 | 
			
		||||
	
 | 
			
		||||
!!Remember to read/write integer and short aligned!!
 | 
			
		||||
 | 
			
		||||
 While writing a file, the names of a struct is indicated with a type number,
 | 
			
		||||
 to be found with: type= findstruct_nr(SDNA *, char *)
 | 
			
		||||
 The value of 'type' corresponds with the the index within the structs array
 | 
			
		||||
 | 
			
		||||
 For the moment: the complete DNA file is included in a .blend file. For
 | 
			
		||||
 the future we can think of smarter methods, like only included the used
 | 
			
		||||
 structs. Only needed to keep a file short though...
 | 
			
		||||
 | 
			
		||||
ALLOWED AND TESTED CHANGES IN STRUCTS:
 | 
			
		||||
 - type change (a char to float will be divided by 255)
 | 
			
		||||
 - location within a struct (everthing can be randomly mixed up)
 | 
			
		||||
 - struct within struct (within struct etc), this is recursive
 | 
			
		||||
 - adding new elements, will be default initialized zero
 | 
			
		||||
 - remving elements
 | 
			
		||||
 - change of array sizes
 | 
			
		||||
 - change of a pointer type: when the name doesn't change the contents is copied
 | 
			
		||||
 | 
			
		||||
NOT YET:
 | 
			
		||||
 - array (vec[3]) to float struct (vec3f)
 | 
			
		||||
 | 
			
		||||
DONE:
 | 
			
		||||
 - endian compatibility
 | 
			
		||||
 - pointer conversion (32-64 bits)
 | 
			
		||||
 | 
			
		||||
IMPORTANT:
 | 
			
		||||
 - do not use #defines in structs for array lengths, this cannot be read by the dna functions
 | 
			
		||||
 - do not use uint, but unsigned int instead, ushort and ulong are allowed
 | 
			
		||||
 - only use a long in Blender if you want this to be the size of a pointer. so it is
 | 
			
		||||
   32 bits or 64 bits, dependent at the cpu architecture
 | 
			
		||||
 - chars are always unsigned
 | 
			
		||||
 - aligment of variables has to be done in such a way, that any system does
 | 
			
		||||
   not create 'padding' (gaps) in structures. So make sure that:
 | 
			
		||||
   - short: 2 aligned
 | 
			
		||||
   - int: 4 aligned
 | 
			
		||||
   - float: 4 aligned
 | 
			
		||||
   - double: 8 aligned
 | 
			
		||||
   - long: 8 aligned
 | 
			
		||||
   - struct: 8 aligned
 | 
			
		||||
 - the sdna functions have several error prints builtin, always check blender running from a console.
 | 
			
		||||
 
 | 
			
		||||
*/
 | 
			
		||||
 *
 | 
			
		||||
 * Structure DNA data is added to each blender file and to each executable, this to detect
 | 
			
		||||
 * in .blend files new veriables in structs, changed array sizes, etc. It's also used for
 | 
			
		||||
 * converting endian and pointer size (32-64 bits)
 | 
			
		||||
 * As an extra, Python uses a call to detect run-time the contents of a blender struct.
 | 
			
		||||
 *
 | 
			
		||||
 * Create a structDNA: only needed when one of the input include (.h) files change.
 | 
			
		||||
 * File Syntax:
 | 
			
		||||
 *     SDNA (4 bytes) (magic number)
 | 
			
		||||
 *     NAME (4 bytes)
 | 
			
		||||
 *     <nr> (4 bytes) amount of names (int)
 | 
			
		||||
 *     <string>
 | 
			
		||||
 *     <string>
 | 
			
		||||
 *     ...
 | 
			
		||||
 *     ...
 | 
			
		||||
 *     TYPE (4 bytes)
 | 
			
		||||
 *     <nr> amount of types (int)
 | 
			
		||||
 *     <string>
 | 
			
		||||
 *     <string>
 | 
			
		||||
 *     ...
 | 
			
		||||
 *     ...
 | 
			
		||||
 *     TLEN (4 bytes)
 | 
			
		||||
 *     <len> (short) the lengths of types
 | 
			
		||||
 *     <len>
 | 
			
		||||
 *     ...
 | 
			
		||||
 *     ...
 | 
			
		||||
 *     STRC (4 bytes)
 | 
			
		||||
 *     <nr> amount of structs (int)
 | 
			
		||||
 *     <typenr><nr_of_elems> <typenr><namenr> <typenr><namenr> ...
 | 
			
		||||
 *
 | 
			
		||||
 * !!Remember to read/write integer and short aligned!!
 | 
			
		||||
 *
 | 
			
		||||
 *  While writing a file, the names of a struct is indicated with a type number,
 | 
			
		||||
 *  to be found with: type= findstruct_nr(SDNA *, char *)
 | 
			
		||||
 *  The value of 'type' corresponds with the the index within the structs array
 | 
			
		||||
 *
 | 
			
		||||
 *  For the moment: the complete DNA file is included in a .blend file. For
 | 
			
		||||
 *  the future we can think of smarter methods, like only included the used
 | 
			
		||||
 *  structs. Only needed to keep a file short though...
 | 
			
		||||
 *
 | 
			
		||||
 * ALLOWED AND TESTED CHANGES IN STRUCTS:
 | 
			
		||||
 *  - type change (a char to float will be divided by 255)
 | 
			
		||||
 *  - location within a struct (everthing can be randomly mixed up)
 | 
			
		||||
 *  - struct within struct (within struct etc), this is recursive
 | 
			
		||||
 *  - adding new elements, will be default initialized zero
 | 
			
		||||
 *  - remving elements
 | 
			
		||||
 *  - change of array sizes
 | 
			
		||||
 *  - change of a pointer type: when the name doesn't change the contents is copied
 | 
			
		||||
 *
 | 
			
		||||
 * NOT YET:
 | 
			
		||||
 *  - array (vec[3]) to float struct (vec3f)
 | 
			
		||||
 *
 | 
			
		||||
 * DONE:
 | 
			
		||||
 *  - endian compatibility
 | 
			
		||||
 *  - pointer conversion (32-64 bits)
 | 
			
		||||
 *
 | 
			
		||||
 * IMPORTANT:
 | 
			
		||||
 *  - do not use #defines in structs for array lengths, this cannot be read by the dna functions
 | 
			
		||||
 *  - do not use uint, but unsigned int instead, ushort and ulong are allowed
 | 
			
		||||
 *  - only use a long in Blender if you want this to be the size of a pointer. so it is
 | 
			
		||||
 *    32 bits or 64 bits, dependent at the cpu architecture
 | 
			
		||||
 *  - chars are always unsigned
 | 
			
		||||
 *  - aligment of variables has to be done in such a way, that any system does
 | 
			
		||||
 *    not create 'padding' (gaps) in structures. So make sure that:
 | 
			
		||||
 *    - short: 2 aligned
 | 
			
		||||
 *    - int: 4 aligned
 | 
			
		||||
 *    - float: 4 aligned
 | 
			
		||||
 *    - double: 8 aligned
 | 
			
		||||
 *    - long: 8 aligned
 | 
			
		||||
 *    - struct: 8 aligned
 | 
			
		||||
 *  - the sdna functions have several error prints builtin, always check blender running from a console.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* local */
 | 
			
		||||
static int le_int(int temp);
 | 
			
		||||
@@ -351,8 +351,8 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
 | 
			
		||||
			sdna->names[nr]= cp;
 | 
			
		||||
 | 
			
		||||
			/* "float gravity [3]" was parsed wrong giving both "gravity" and
 | 
			
		||||
			   "[3]"  members. we rename "[3]", and later set the type of
 | 
			
		||||
			   "gravity" to "void" so the offsets work out correct */
 | 
			
		||||
			 * "[3]"  members. we rename "[3]", and later set the type of
 | 
			
		||||
			 * "gravity" to "void" so the offsets work out correct */
 | 
			
		||||
			if(*cp == '[' && strcmp(cp, "[3]")==0) {
 | 
			
		||||
				if(nr && strcmp(sdna->names[nr-1], "Cvi") == 0) {
 | 
			
		||||
					sdna->names[nr]= "gravity[3]";
 | 
			
		||||
@@ -644,14 +644,14 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna)
 | 
			
		||||
		if(compflags[a]==2) recurs_test_compflags(sdna, compflags, a);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
/*
 | 
			
		||||
#if 0
 | 
			
		||||
	for(a=0; a<sdna->nr_structs; a++) {
 | 
			
		||||
		if(compflags[a]==2) {
 | 
			
		||||
			spold= sdna->structs[a];
 | 
			
		||||
			printf("changed: %s\n", sdna->types[ spold[0] ]);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
*/
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	return compflags;
 | 
			
		||||
}
 | 
			
		||||
@@ -843,13 +843,13 @@ static void reconstruct_elem(SDNA *newsdna, SDNA *oldsdna,
 | 
			
		||||
                             char *type, const char *name, char *curdata, short *old, char *olddata)
 | 
			
		||||
{
 | 
			
		||||
	/* rules: test for NAME:
 | 
			
		||||
			- name equal:
 | 
			
		||||
				- cast type
 | 
			
		||||
			- name partially equal (array differs)
 | 
			
		||||
				- type equal: memcpy
 | 
			
		||||
				- types casten
 | 
			
		||||
	   (nzc 2-4-2001 I want the 'unsigned' bit to be parsed as well. Where
 | 
			
		||||
	   can I force this?)
 | 
			
		||||
	 * 		- name equal:
 | 
			
		||||
	 * 			- cast type
 | 
			
		||||
	 * 		- name partially equal (array differs)
 | 
			
		||||
	 * 			- type equal: memcpy
 | 
			
		||||
	 * 			- types casten
 | 
			
		||||
	 * (nzc 2-4-2001 I want the 'unsigned' bit to be parsed as well. Where
 | 
			
		||||
	 * can I force this?)
 | 
			
		||||
	 */
 | 
			
		||||
	int a, elemcount, len, array, oldsize, cursize, mul;
 | 
			
		||||
	char *otype;
 | 
			
		||||
 
 | 
			
		||||
@@ -146,9 +146,9 @@ static char **types, *typedata;		/* at address types[a] is string a */
 | 
			
		||||
static short *typelens;				/* at typelens[a] is de length of type a */
 | 
			
		||||
static short *alphalens;			/* contains sizes as they are calculated on the DEC Alpha (64 bits), infact any 64bit system */
 | 
			
		||||
static short **structs, *structdata;/* at sp= structs[a] is the first address of a struct definition
 | 
			
		||||
                                       sp[0] is type number
 | 
			
		||||
                                       sp[1] is amount of elements
 | 
			
		||||
                                       sp[2] sp[3] is typenr,  namenr (etc) */
 | 
			
		||||
                                     * sp[0] is type number
 | 
			
		||||
                                     * sp[1] is amount of elements
 | 
			
		||||
                                     * sp[2] sp[3] is typenr,  namenr (etc) */
 | 
			
		||||
/**
 | 
			
		||||
 * Variable to control debug output of makesdna.
 | 
			
		||||
 * debugSDNA:
 | 
			
		||||
@@ -289,9 +289,9 @@ static int add_name(const char *str)
 | 
			
		||||
 | 
			
		||||
	if (str[0] == '(' && str[1] == '*') {
 | 
			
		||||
		/* we handle function pointer and special array cases here, e.g.
 | 
			
		||||
		   void (*function)(...) and float (*array)[..]. the array case
 | 
			
		||||
		   name is still converted to (array*)() though because it is that
 | 
			
		||||
		   way in old dna too, and works correct with elementsize() */
 | 
			
		||||
		 * void (*function)(...) and float (*array)[..]. the array case
 | 
			
		||||
		 * name is still converted to (array*)() though because it is that
 | 
			
		||||
		 * way in old dna too, and works correct with elementsize() */
 | 
			
		||||
		int isfuncptr = (strchr(str+1, '(')) != NULL;
 | 
			
		||||
 | 
			
		||||
		if (debugSDNA > 3) printf("\t\t\t\t*** Function pointer or multidim array pointer found\n");
 | 
			
		||||
@@ -539,7 +539,7 @@ static void *read_file_data(char *filename, int *len_r)
 | 
			
		||||
static int convert_include(char *filename)
 | 
			
		||||
{
 | 
			
		||||
	/* read include file, skip structs with a '#' before it.
 | 
			
		||||
	   store all data in temporal arrays.
 | 
			
		||||
	 * store all data in temporal arrays.
 | 
			
		||||
	 */
 | 
			
		||||
	int filelen, count, overslaan, slen, type, name, strct;
 | 
			
		||||
	short *structpoin, *sp;
 | 
			
		||||
 
 | 
			
		||||
@@ -100,10 +100,10 @@ PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont, const char *ident
 | 
			
		||||
	float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
 | 
			
		||||
PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value,
 | 
			
		||||
	float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax);
 | 
			
		||||
	/*
 | 
			
		||||
PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, const char *identifier, float hardmin, float hardmax,
 | 
			
		||||
	const char *ui_name, const char *ui_description, float softmin, float softmax, unsigned int dimension, unsigned short dim_size[]);
 | 
			
		||||
	*/
 | 
			
		||||
 | 
			
		||||
//PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, const char *identifier, float hardmin, float hardmax,
 | 
			
		||||
//	const char *ui_name, const char *ui_description, float softmin, float softmax, unsigned int dimension, unsigned short dim_size[]);
 | 
			
		||||
 | 
			
		||||
PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax,
 | 
			
		||||
	const char *ui_name, const char *ui_description, float softmin, float softmax);
 | 
			
		||||
PropertyRNA *RNA_def_float_factor(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax,
 | 
			
		||||
 
 | 
			
		||||
@@ -1559,12 +1559,14 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		case PROP_COLLECTION: {
 | 
			
		||||
			/*CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
 | 
			
		||||
#if 0
 | 
			
		||||
			CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
 | 
			
		||||
 | 
			
		||||
			if(cprop->type)
 | 
			
		||||
				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->type, srna->identifier, prop->identifier);
 | 
			
		||||
			else
 | 
			
		||||
				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier);*/
 | 
			
		||||
				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier);
 | 
			
		||||
#endif
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -2529,8 +2531,10 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
 | 
			
		||||
	PropertyDefRNA *dp;
 | 
			
		||||
	FunctionDefRNA *dfunc;
 | 
			
		||||
	
 | 
			
		||||
	fprintf(f, "\n/* Automatically generated struct definitions for the Data API.\n"
 | 
			
		||||
				 "   Do not edit manually, changes will be overwritten.           */\n\n"
 | 
			
		||||
	fprintf(f,
 | 
			
		||||
	        "\n"
 | 
			
		||||
	        "/* Automatically generated struct definitions for the Data API.\n"
 | 
			
		||||
	        " * Do not edit manually, changes will be overwritten.           */\n\n"
 | 
			
		||||
	        "#define RNA_RUNTIME\n\n");
 | 
			
		||||
 | 
			
		||||
	fprintf(f, "#include <float.h>\n");
 | 
			
		||||
@@ -2606,8 +2610,9 @@ static void rna_generate_header(BlenderRNA *brna, FILE *f)
 | 
			
		||||
	fprintf(f, "\n#ifndef __RNA_BLENDER_H__\n");
 | 
			
		||||
	fprintf(f, "#define __RNA_BLENDER_H__\n\n");
 | 
			
		||||
 | 
			
		||||
	fprintf(f, "/* Automatically generated function declarations for the Data API.\n"
 | 
			
		||||
				 "   Do not edit manually, changes will be overwritten.              */\n\n");
 | 
			
		||||
	fprintf(f,
 | 
			
		||||
	        "/* Automatically generated function declarations for the Data API.\n"
 | 
			
		||||
	        " * Do not edit manually, changes will be overwritten.              */\n\n");
 | 
			
		||||
 | 
			
		||||
	fprintf(f, "#include \"RNA_types.h\"\n\n");
 | 
			
		||||
 | 
			
		||||
@@ -2768,8 +2773,9 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
 | 
			
		||||
	fprintf(f, "\n#ifndef __RNA_BLENDER_CPP_H__\n");
 | 
			
		||||
	fprintf(f, "#define __RNA_BLENDER_CPP_H__\n\n");
 | 
			
		||||
 | 
			
		||||
	fprintf(f, "/* Automatically generated classes for the Data API.\n"
 | 
			
		||||
				 "   Do not edit manually, changes will be overwritten. */\n\n");
 | 
			
		||||
	fprintf(f,
 | 
			
		||||
	        "/* Automatically generated classes for the Data API.\n"
 | 
			
		||||
	        " * Do not edit manually, changes will be overwritten. */\n\n");
 | 
			
		||||
	
 | 
			
		||||
	fprintf(f, "#include \"RNA_blender.h\"\n");
 | 
			
		||||
	fprintf(f, "#include \"RNA_types.h\"\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -262,11 +262,13 @@ ID *rna_ID_copy(ID *id)
 | 
			
		||||
static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
 | 
			
		||||
{
 | 
			
		||||
	/* XXX, new function for this! */
 | 
			
		||||
	/*if (ob->type == OB_FONT) {
 | 
			
		||||
#if 0
 | 
			
		||||
	if (ob->type == OB_FONT) {
 | 
			
		||||
		Curve *cu = ob->data;
 | 
			
		||||
		freedisplist(&cu->disp);
 | 
			
		||||
		BKE_text_to_curve(sce, ob, CU_LEFT);
 | 
			
		||||
	}*/
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (flag == 0) {
 | 
			
		||||
		/* pass */
 | 
			
		||||
@@ -281,12 +283,14 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
 | 
			
		||||
			}
 | 
			
		||||
			break;
 | 
			
		||||
		/* Could add particle updates later */
 | 
			
		||||
/*		case ID_PA:
 | 
			
		||||
#if 0
 | 
			
		||||
		case ID_PA:
 | 
			
		||||
			if(flag & ~(OB_RECALC_ALL|PSYS_RECALC)) {
 | 
			
		||||
				BKE_report(reports, RPT_ERROR, "'refresh' incompatible with ParticleSettings ID type");
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
			break; */
 | 
			
		||||
			break;
 | 
			
		||||
#endif
 | 
			
		||||
		default:
 | 
			
		||||
			BKE_report(reports, RPT_ERROR, "This ID type is not compatible with any 'refresh' options");
 | 
			
		||||
			return;
 | 
			
		||||
 
 | 
			
		||||
@@ -1447,7 +1447,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
 | 
			
		||||
	if (is_rna) {
 | 
			
		||||
		if (prop->update) {
 | 
			
		||||
			/* ideally no context would be needed for update, but there's some
 | 
			
		||||
			   parts of the code that need it still, so we have this exception */
 | 
			
		||||
			 * parts of the code that need it still, so we have this exception */
 | 
			
		||||
			if (prop->flag & PROP_CONTEXT_UPDATE) {
 | 
			
		||||
				if (C) {
 | 
			
		||||
					if (prop->flag & PROP_CONTEXT_PROPERTY_UPDATE) {
 | 
			
		||||
@@ -2521,7 +2521,7 @@ PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
 | 
			
		||||
	}
 | 
			
		||||
	else if (prop->flag & PROP_IDPROPERTY) {
 | 
			
		||||
		/* XXX temporary hack to add it automatically, reading should
 | 
			
		||||
		   never do any write ops, to ensure thread safety etc .. */
 | 
			
		||||
		 * never do any write ops, to ensure thread safety etc .. */
 | 
			
		||||
		RNA_property_pointer_add(ptr, prop);
 | 
			
		||||
		return RNA_property_pointer_get(ptr, prop);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -2694,7 +2694,7 @@ int rna_parameter_size(PropertyRNA *parm)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* this function returns the size of the memory allocated for the parameter,
 | 
			
		||||
   useful for instance for memory alignment or for storing additional information */
 | 
			
		||||
 * useful for instance for memory alignment or for storing additional information */
 | 
			
		||||
int rna_parameter_size_alloc(PropertyRNA *parm)
 | 
			
		||||
{
 | 
			
		||||
	int size = rna_parameter_size(parm);
 | 
			
		||||
 
 | 
			
		||||
@@ -68,8 +68,8 @@ static char *rna_DynamicPaintSurface_path(PointerRNA *ptr)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
*	Surfaces
 | 
			
		||||
*/
 | 
			
		||||
 *	Surfaces
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static void rna_DynamicPaint_redoModifier(Main *bmain, Scene *scene, PointerRNA *ptr)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -253,13 +253,13 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
 | 
			
		||||
	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 | 
			
		||||
 | 
			
		||||
	/* expose as layers.active */
 | 
			
		||||
	/*
 | 
			
		||||
#if 0
 | 
			
		||||
	prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
 | 
			
		||||
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
 | 
			
		||||
	RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
 | 
			
		||||
	RNA_def_property_ui_text(prop, "Active", "Set active layer for editing");
 | 
			
		||||
	RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
 | 
			
		||||
	*/
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
 | 
			
		||||
	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
 | 
			
		||||
 
 | 
			
		||||
@@ -494,11 +494,13 @@ static void rna_def_keydata(BlenderRNA *brna)
 | 
			
		||||
	RNA_def_property_ui_text(prop, "Handle 2 Location", "");
 | 
			
		||||
	RNA_def_property_update(prop, 0, "rna_Key_update_data");
 | 
			
		||||
 | 
			
		||||
	/* appears to be unused currently
 | 
			
		||||
	/* appears to be unused currently */
 | 
			
		||||
#if 0
 | 
			
		||||
	prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
 | 
			
		||||
	RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_tilt_get", "rna_ShapeKeyBezierPoint_tilt_set", NULL);
 | 
			
		||||
	RNA_def_property_ui_text(prop, "Tilt", "");
 | 
			
		||||
	RNA_def_property_update(prop, 0, "rna_Key_update_data"); */
 | 
			
		||||
	RNA_def_property_update(prop, 0, "rna_Key_update_data");
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void rna_def_keyblock(BlenderRNA *brna)
 | 
			
		||||
 
 | 
			
		||||
@@ -104,8 +104,8 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
 | 
			
		||||
		copycu = tmpobj->data = copy_curve( (Curve *) ob->data );
 | 
			
		||||
 | 
			
		||||
		/* temporarily set edit so we get updates from edit mode, but
 | 
			
		||||
		   also because for text datablocks copying it while in edit
 | 
			
		||||
		   mode gives invalid data structures */
 | 
			
		||||
		 * also because for text datablocks copying it while in edit
 | 
			
		||||
		 * mode gives invalid data structures */
 | 
			
		||||
		copycu->editfont = tmpcu->editfont;
 | 
			
		||||
		copycu->editnurb = tmpcu->editnurb;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -179,7 +179,7 @@ static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
 | 
			
		||||
	int mode = 0;
 | 
			
		||||
 | 
			
		||||
	/* check the origin of the Paint struct to see which paint
 | 
			
		||||
	   mode to select from */
 | 
			
		||||
	 * mode to select from */
 | 
			
		||||
 | 
			
		||||
	if (ptr->data == &ts->imapaint)
 | 
			
		||||
		mode = OB_MODE_TEXTURE_PAINT;
 | 
			
		||||
 
 | 
			
		||||
@@ -2644,7 +2644,7 @@ static void rna_def_space_filebrowser(BlenderRNA *brna)
 | 
			
		||||
	RNA_def_property_ui_text(prop, "Active Operator", "");
 | 
			
		||||
 | 
			
		||||
	/* keep this for compatibility with existing presets,
 | 
			
		||||
	   not exposed in c++ api because of keyword conflict */
 | 
			
		||||
	 * not exposed in c++ api because of keyword conflict */
 | 
			
		||||
	prop = RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
 | 
			
		||||
	RNA_def_property_pointer_sdna(prop, NULL, "op");
 | 
			
		||||
	RNA_def_property_ui_text(prop, "Active Operator", "");
 | 
			
		||||
 
 | 
			
		||||
@@ -540,7 +540,7 @@ static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
 | 
			
		||||
	wmWindow *win = (wmWindow*)ptr->data;
 | 
			
		||||
 | 
			
		||||
	/* exception: can't set screens inside of area/region handers, and must
 | 
			
		||||
	   use context so notifier gets to the right window */
 | 
			
		||||
	 * use context so notifier gets to the right window */
 | 
			
		||||
	if (win->newscreen) {
 | 
			
		||||
		WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, win->newscreen);
 | 
			
		||||
		win->newscreen = NULL;
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@ static void initData(ModifierData *md)
 | 
			
		||||
	ArrayModifierData *amd = (ArrayModifierData*) md;
 | 
			
		||||
 | 
			
		||||
	/* default to 2 duplicates distributed along the x-axis by an
 | 
			
		||||
	offset of 1 object-width
 | 
			
		||||
	 * offset of 1 object-width
 | 
			
		||||
	 */
 | 
			
		||||
	amd->start_cap = amd->end_cap = amd->curve_ob = amd->offset_ob = NULL;
 | 
			
		||||
	amd->count = 2;
 | 
			
		||||
@@ -264,14 +264,14 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* calculate the maximum number of copies which will fit within the
 | 
			
		||||
	prescribed length */
 | 
			
		||||
	 * prescribed length */
 | 
			
		||||
	if(amd->fit_type == MOD_ARR_FITLENGTH
 | 
			
		||||
		  || amd->fit_type == MOD_ARR_FITCURVE) {
 | 
			
		||||
		float dist = sqrt(dot_v3v3(offset[3], offset[3]));
 | 
			
		||||
 | 
			
		||||
		if(dist > 1e-6f)
 | 
			
		||||
			/* this gives length = first copy start to last copy end
 | 
			
		||||
			add a tiny offset for floating point rounding errors */
 | 
			
		||||
			 * add a tiny offset for floating point rounding errors */
 | 
			
		||||
			count = (length + 1e-6f) / dist;
 | 
			
		||||
		else
 | 
			
		||||
			/* if the offset has no translation, just make one copy */
 | 
			
		||||
@@ -282,11 +282,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
 | 
			
		||||
		count = 1;
 | 
			
		||||
 | 
			
		||||
	/* BMESH_TODO: bumping up the stack level avoids computing the normals
 | 
			
		||||
	   after every top-level operator execution (and this modifier has the
 | 
			
		||||
	   potential to execute a *lot* of top-level BMOps. There should be a
 | 
			
		||||
	   cleaner way to do this. One possibility: a "mirror" BMOp would
 | 
			
		||||
	   certainly help by compressing it all into one top-level BMOp that
 | 
			
		||||
	   executes a lot of second-level BMOps. */
 | 
			
		||||
	 * after every top-level operator execution (and this modifier has the
 | 
			
		||||
	 * potential to execute a *lot* of top-level BMOps. There should be a
 | 
			
		||||
	 * cleaner way to do this. One possibility: a "mirror" BMOp would
 | 
			
		||||
	 * certainly help by compressing it all into one top-level BMOp that
 | 
			
		||||
	 * executes a lot of second-level BMOps. */
 | 
			
		||||
	BMO_push(em->bm, NULL);
 | 
			
		||||
	bmesh_edit_begin(em->bm, 0);
 | 
			
		||||
 | 
			
		||||
@@ -349,8 +349,8 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
 | 
			
		||||
			BMO_op_finish(em->bm, &findop);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/*generate merge mappping using index map.  we do this by using the
 | 
			
		||||
		  operator slots as lookup arrays.*/
 | 
			
		||||
		/* generate merge mappping using index map.  we do this by using the
 | 
			
		||||
		 * operator slots as lookup arrays.*/
 | 
			
		||||
		#define E(i) (i) < s1->len ? _E(s1, i) : _E(s2, (i)-s1->len)
 | 
			
		||||
 | 
			
		||||
		for (i=0; i<indexLen; i++) {
 | 
			
		||||
 
 | 
			
		||||
@@ -173,12 +173,14 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
 | 
			
		||||
 | 
			
		||||
	options = bmd->flags|bmd->val_flags|bmd->lim_flags|bmd->e_flags;
 | 
			
		||||
 | 
			
		||||
	/*if ((options & BME_BEVEL_VWEIGHT) && bmd->defgrp_name[0]) {
 | 
			
		||||
#if 0
 | 
			
		||||
	if ((options & BME_BEVEL_VWEIGHT) && bmd->defgrp_name[0]) {
 | 
			
		||||
		defgrp_index = defgroup_name_index(ob, bmd->defgrp_name);
 | 
			
		||||
		if (defgrp_index < 0) {
 | 
			
		||||
			options &= ~BME_BEVEL_VWEIGHT;
 | 
			
		||||
		}
 | 
			
		||||
	}*/
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	bm = BME_derivedmesh_to_bmesh(derivedData);
 | 
			
		||||
	BME_bevel(bm,bmd->value,bmd->res,options,defgrp_index,bmd->bevel_angle,NULL);
 | 
			
		||||
 
 | 
			
		||||
@@ -133,8 +133,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 | 
			
		||||
		DerivedMesh *result;
 | 
			
		||||
 | 
			
		||||
		/* when one of objects is empty (has got no faces) we could speed up
 | 
			
		||||
		   calculation a bit returning one of objects' derived meshes (or empty one)
 | 
			
		||||
		   Returning mesh is depended on modifieier's operation (sergey) */
 | 
			
		||||
		 * calculation a bit returning one of objects' derived meshes (or empty one)
 | 
			
		||||
		 * Returning mesh is depended on modifieier's operation (sergey) */
 | 
			
		||||
		result = get_quick_derivedMesh(derivedData, dm, bmd->operation);
 | 
			
		||||
 | 
			
		||||
		if(result == NULL) {
 | 
			
		||||
 
 | 
			
		||||
@@ -333,7 +333,7 @@ static void InterpCSGFace(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Iterate over the CSG Output Descriptors and create a new DerivedMesh
 | 
			
		||||
   from them */
 | 
			
		||||
 * from them */
 | 
			
		||||
static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
 | 
			
		||||
	CSG_FaceIteratorDescriptor *face_it,
 | 
			
		||||
	CSG_VertexIteratorDescriptor *vertex_it,
 | 
			
		||||
 
 | 
			
		||||
@@ -39,14 +39,14 @@ struct Base;
 | 
			
		||||
struct DerivedMesh;
 | 
			
		||||
 | 
			
		||||
/* Performs a boolean between two mesh objects, it is assumed that both objects
 | 
			
		||||
   are in fact a mesh object. On success returns 1 and creates a new mesh object
 | 
			
		||||
   into blender data structures. On failure returns 0 and reports an error. */
 | 
			
		||||
 * are in fact a mesh object. On success returns 1 and creates a new mesh object
 | 
			
		||||
 * into blender data structures. On failure returns 0 and reports an error. */
 | 
			
		||||
int NewBooleanMesh(struct Scene *scene, struct Base *base, struct Base *base_select, int op);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Performs a boolean between two mesh objects, it is assumed that both objects
 | 
			
		||||
   are in fact mesh object. On success returns a DerivedMesh. On failure
 | 
			
		||||
   returns NULL and reports an error. */
 | 
			
		||||
 * are in fact mesh object. On success returns a DerivedMesh. On failure
 | 
			
		||||
 * returns NULL and reports an error. */
 | 
			
		||||
 | 
			
		||||
struct DerivedMesh *NewBooleanDerivedMesh(struct DerivedMesh *dm, struct Object *ob, struct DerivedMesh *dm_select, struct Object *ob_select, int int_op_type);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -192,8 +192,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* get the set of edges that will be in the new mesh
 | 
			
		||||
		*/
 | 
			
		||||
		/* get the set of edges that will be in the new mesh */
 | 
			
		||||
		for (i = 0; i < numEdges_dst; i++) {
 | 
			
		||||
			j = BLI_ghash_size(edgeHash);
 | 
			
		||||
			
 | 
			
		||||
 
 | 
			
		||||
@@ -115,8 +115,7 @@ static void initData(ModifierData *md)
 | 
			
		||||
{
 | 
			
		||||
	EdgeSplitModifierData *emd = (EdgeSplitModifierData*) md;
 | 
			
		||||
 | 
			
		||||
	/* default to 30-degree split angle, sharpness from both angle & flag
 | 
			
		||||
	*/
 | 
			
		||||
	/* default to 30-degree split angle, sharpness from both angle & flag */
 | 
			
		||||
	emd->split_angle = 30;
 | 
			
		||||
	emd->flags = MOD_EDGESPLIT_FROMANGLE | MOD_EDGESPLIT_FROMFLAG;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -131,10 +131,10 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
 | 
			
		||||
		fss->cpsQuality = 10.0; // 1.0 / 10.0 => means 0.1 width
 | 
			
		||||
		
 | 
			
		||||
		/*
 | 
			
		||||
		BAD TODO: this is done in buttons_object.c in the moment 
 | 
			
		||||
		Mesh *mesh = ob->data;
 | 
			
		||||
		// calculate bounding box
 | 
			
		||||
		fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize);	
 | 
			
		||||
		 * BAD TODO: this is done in buttons_object.c in the moment
 | 
			
		||||
		 * Mesh *mesh = ob->data;
 | 
			
		||||
		 * // calculate bounding box
 | 
			
		||||
		 * fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize);
 | 
			
		||||
		 */
 | 
			
		||||
		
 | 
			
		||||
		fss->meshVelocities = NULL;
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user