forked from bartvdbraak/blender
remove rna function convert_to_triface because it uses an internal editmesh function and only the OBJ exporter called this.
Converting to tri's on export isnt very important.
This commit is contained in:
parent
7b1e5f4d8e
commit
d987003608
@ -451,6 +451,9 @@ def write(filename, objects, scene,
|
||||
else:
|
||||
faceuv = False
|
||||
|
||||
# XXX - todo, find a better way to do triangulation
|
||||
# ...removed convert_to_triface because it relies on editmesh
|
||||
'''
|
||||
# We have a valid mesh
|
||||
if EXPORT_TRI and me.faces:
|
||||
# Add a dummy object to it.
|
||||
@ -468,7 +471,8 @@ def write(filename, objects, scene,
|
||||
newob.convert_to_triface(scene)
|
||||
# mesh will still be there
|
||||
scene.remove_object(newob)
|
||||
|
||||
'''
|
||||
|
||||
# Make our own list so it can be sorted to reduce context switching
|
||||
face_index_pairs = [ (face, index) for index, face in enumerate(me.faces)]
|
||||
# faces = [ f for f in me.faces ]
|
||||
|
@ -125,6 +125,9 @@ void BKE_image_assign_ibuf(struct Image *ima, struct ImBuf *ibuf);
|
||||
/* called on frame change or before render */
|
||||
void BKE_image_user_calc_imanr(struct ImageUser *iuser, int cfra, int fieldnr);
|
||||
|
||||
/* produce image export path */
|
||||
int BKE_get_image_export_path(struct Image *im, const char *dest_dir, char *abs, int abs_size, char *rel, int rel_size);
|
||||
|
||||
/* fix things in ImageUser when new image gets assigned */
|
||||
void BKE_image_user_new_image(struct Image *ima, struct ImageUser *iuser);
|
||||
|
||||
|
@ -140,7 +140,7 @@ static int vergface(const void *v1, const void *v2)
|
||||
|
||||
/* *********************************** */
|
||||
|
||||
void convert_to_triface(EditMesh *em, int direction)
|
||||
static void convert_to_triface(EditMesh *em, int direction)
|
||||
{
|
||||
EditFace *efa, *efan, *next;
|
||||
float fac;
|
||||
@ -5638,7 +5638,7 @@ static void collapseuvs(EditMesh *em, EditVert *mergevert)
|
||||
}
|
||||
}
|
||||
|
||||
int collapseEdges(EditMesh *em)
|
||||
static int collapseEdges(EditMesh *em)
|
||||
{
|
||||
EditVert *eve;
|
||||
EditEdge *eed;
|
||||
@ -5704,7 +5704,7 @@ int collapseEdges(EditMesh *em)
|
||||
return mergecount;
|
||||
}
|
||||
|
||||
int merge_firstlast(EditMesh *em, int first, int uvmerge)
|
||||
static int merge_firstlast(EditMesh *em, int first, int uvmerge)
|
||||
{
|
||||
EditVert *eve,*mergevert;
|
||||
EditSelection *ese;
|
||||
@ -5738,7 +5738,7 @@ int merge_firstlast(EditMesh *em, int first, int uvmerge)
|
||||
return removedoublesflag(em, 1, 0, MERGELIMIT);
|
||||
}
|
||||
|
||||
void em_snap_to_center(EditMesh *em)
|
||||
static void em_snap_to_center(EditMesh *em)
|
||||
{
|
||||
EditVert *eve;
|
||||
float cent[3] = {0.0f, 0.0f, 0.0f};
|
||||
@ -5763,7 +5763,7 @@ void em_snap_to_center(EditMesh *em)
|
||||
}
|
||||
}
|
||||
|
||||
void em_snap_to_cursor(EditMesh *em, bContext *C)
|
||||
static void em_snap_to_cursor(EditMesh *em, bContext *C)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob= CTX_data_edit_object(C);
|
||||
@ -5784,7 +5784,7 @@ void em_snap_to_cursor(EditMesh *em, bContext *C)
|
||||
}
|
||||
}
|
||||
|
||||
int merge_target(bContext *C, EditMesh *em, int target, int uvmerge)
|
||||
static int merge_target(bContext *C, EditMesh *em, int target, int uvmerge)
|
||||
{
|
||||
EditVert *eve;
|
||||
|
||||
@ -5927,7 +5927,7 @@ typedef struct PathEdge {
|
||||
#define PATH_SELECT_EDGE_LENGTH 0
|
||||
#define PATH_SELECT_TOPOLOGICAL 1
|
||||
|
||||
int select_vertex_path_exec(bContext *C, wmOperator *op)
|
||||
static int select_vertex_path_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
|
||||
@ -7140,7 +7140,7 @@ void MESH_OT_edge_flip(wmOperatorType *ot)
|
||||
|
||||
/********************** Smooth/Solid Operators *************************/
|
||||
|
||||
void mesh_set_smooth_faces(EditMesh *em, short smooth)
|
||||
static void mesh_set_smooth_faces(EditMesh *em, short smooth)
|
||||
{
|
||||
EditFace *efa;
|
||||
|
||||
|
@ -260,34 +260,6 @@ static void rna_Object_free_duplilist(Object *ob, ReportList *reports)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Object_convert_to_triface(Object *ob, bContext *C, ReportList *reports, Scene *sce)
|
||||
{
|
||||
Mesh *me;
|
||||
int ob_editing = CTX_data_edit_object(C) == ob;
|
||||
|
||||
if (ob->type != OB_MESH) {
|
||||
BKE_report(reports, RPT_ERROR, "Object should be of type MESH.");
|
||||
return;
|
||||
}
|
||||
|
||||
me= (Mesh*)ob->data;
|
||||
|
||||
if (!ob_editing)
|
||||
make_editMesh(sce, ob);
|
||||
|
||||
/* select all */
|
||||
EM_select_all(me->edit_mesh);
|
||||
|
||||
convert_to_triface(me->edit_mesh, 0);
|
||||
|
||||
load_editMesh(sce, ob);
|
||||
|
||||
if (!ob_editing)
|
||||
free_editMesh(me->edit_mesh);
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
static bDeformGroup *rna_Object_add_vertex_group(Object *ob, char *group_name)
|
||||
{
|
||||
return ED_vgroup_add_name(ob, group_name);
|
||||
@ -408,12 +380,6 @@ void RNA_api_object(StructRNA *srna)
|
||||
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export.");
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
func= RNA_def_function(srna, "convert_to_triface", "rna_Object_convert_to_triface");
|
||||
RNA_def_function_ui_description(func, "Convert all mesh faces to triangles.");
|
||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
|
||||
parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene where the object belongs.");
|
||||
RNA_def_property_flag(parm, PROP_REQUIRED);
|
||||
|
||||
/* duplis */
|
||||
func= RNA_def_function(srna, "create_dupli_list", "rna_Object_create_duplilist");
|
||||
RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to be freed manually with free_dupli_list.");
|
||||
|
Loading…
Reference in New Issue
Block a user