示例#1
0
void makeDispListMBall_forRender(Scene *scene, Object *ob, ListBase *dispbase)
{
	metaball_polygonize(scene, ob, dispbase);
	tex_space_mball(ob);
	
	object_deform_mball(ob, dispbase);
}
示例#2
0
/* both pointers should exist */
static void copy_texture_space(Object *to, Object *ob)
{
	float *poin1= NULL, *poin2= NULL;
	short texflag= 0;
	
	if (ob->type==OB_MESH) {
		texflag= ((Mesh *)ob->data)->texflag;
		poin2= ((Mesh *)ob->data)->loc;
	}
	else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
		texflag= ((Curve *)ob->data)->texflag;
		poin2= ((Curve *)ob->data)->loc;
	}
	else if (ob->type==OB_MBALL) {
		texflag= ((MetaBall *)ob->data)->texflag;
		poin2= ((MetaBall *)ob->data)->loc;
	}
	else
		return;
		
	if (to->type==OB_MESH) {
		((Mesh *)to->data)->texflag= texflag;
		poin1= ((Mesh *)to->data)->loc;
	}
	else if (ELEM3(to->type, OB_CURVE, OB_SURF, OB_FONT)) {
		((Curve *)to->data)->texflag= texflag;
		poin1= ((Curve *)to->data)->loc;
	}
	else if (to->type==OB_MBALL) {
		((MetaBall *)to->data)->texflag= texflag;
		poin1= ((MetaBall *)to->data)->loc;
	}
	else
		return;
	
	memcpy(poin1, poin2, 9*sizeof(float));	/* this was noted in DNA_mesh, curve, mball */
	
	if (to->type==OB_MESH) {
		/* pass */
	}
	else if (to->type == OB_MBALL) {
		tex_space_mball(to);
	}
	else {
		tex_space_curve(to->data);
	}
	
}
示例#3
0
void makeDispListMBall(Scene *scene, Object *ob)
{
	if(!ob || ob->type!=OB_MBALL) return;

	// XXX: mball stuff uses plenty of global variables
	//      while this is unchanged updating during render is unsafe
	if(G.rendering) return;

	freedisplist(&(ob->disp));

	if(ob->type==OB_MBALL) {
		if(ob==find_basis_mball(scene, ob)) {
			metaball_polygonize(scene, ob, &ob->disp);
			tex_space_mball(ob);

			object_deform_mball(ob, &ob->disp);
		}
	}
	
	boundbox_displist(ob);
}