forked from bartvdbraak/blender
svn merge ^/trunk/blender -r55357:55372
This commit is contained in:
commit
29b7b344fc
@ -165,7 +165,7 @@ extern "C" {
|
||||
void MEM_printmemlist(void);
|
||||
|
||||
/** calls the function on all allocated memory blocks. */
|
||||
void MEM_callbackmemlist(void (*func)(void*));
|
||||
void MEM_callbackmemlist(void (*func)(void *));
|
||||
|
||||
/** Print statistics about memory usage */
|
||||
void MEM_printmemlist_stats(void);
|
||||
|
@ -170,7 +170,7 @@ bool Armature::popQ(CacheTS timestamp)
|
||||
{
|
||||
if (m_qCCh >= 0) {
|
||||
double* item;
|
||||
item = (double*)m_cache->getPreviousCacheItem(this, m_qCCh, ×tamp);
|
||||
item = (double *)m_cache->getPreviousCacheItem(this, m_qCCh, ×tamp);
|
||||
if (item && m_qCTs != timestamp) {
|
||||
double* q = m_qKdl(0);
|
||||
memcpy(q, item, m_qKdl.rows()*sizeof(double));
|
||||
@ -698,8 +698,8 @@ void Armature::updateControlOutput(const Timestamp& timestamp)
|
||||
JointConstraint_struct* pConstraint = *it;
|
||||
unsigned int nr, i;
|
||||
for (i=0, nr = pConstraint->segment->second.q_nr; i<pConstraint->v_nr; i++, nr++) {
|
||||
*(double*)&pConstraint->value[i].y = m_qKdl[nr];
|
||||
*(double*)&pConstraint->value[i].ydot = m_qdotKdl[nr];
|
||||
*(double *)&pConstraint->value[i].y = m_qKdl[nr];
|
||||
*(double *)&pConstraint->value[i].ydot = m_qdotKdl[nr];
|
||||
}
|
||||
if (pConstraint->function && (pConstraint->substep || (!timestamp.reiterate && !timestamp.substep))) {
|
||||
(*pConstraint->function)(timestamp, pConstraint->values, pConstraint->v_nr, pConstraint->param);
|
||||
|
@ -390,10 +390,14 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
|
||||
layout.prop(rd, "filepath", text="")
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.prop(rd, "use_overwrite")
|
||||
flow.prop(rd, "use_placeholder")
|
||||
flow.prop(rd, "use_file_extension")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.active = not rd.is_movie_format
|
||||
col.prop(rd, "use_overwrite")
|
||||
col.prop(rd, "use_placeholder")
|
||||
|
||||
split.prop(rd, "use_file_extension")
|
||||
|
||||
layout.template_image_settings(image_settings, color_management=False)
|
||||
|
||||
|
@ -480,6 +480,10 @@ class USERPREF_PT_system(Panel):
|
||||
col.prop(system, "texture_collection_rate", text="Collection Rate")
|
||||
|
||||
col.separator()
|
||||
|
||||
col.label(text="Images:")
|
||||
col.prop(system, "image_gpubuffer_limit")
|
||||
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
|
@ -70,7 +70,7 @@ int BKE_read_file(struct bContext *C, const char *filepath, struct ReportList *r
|
||||
#define BKE_READ_FILE_OK 1 /* OK */
|
||||
#define BKE_READ_FILE_OK_USERPREFS 2 /* OK, and with new user settings */
|
||||
|
||||
int BKE_read_file_from_memory(struct bContext *C, char *filebuf, int filelength, struct ReportList *reports);
|
||||
int BKE_read_file_from_memory(struct bContext *C, const void *filebuf, int filelength, struct ReportList *reports);
|
||||
int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports);
|
||||
|
||||
int BKE_read_file_userdef(const char *filepath, struct ReportList *reports);
|
||||
@ -105,8 +105,8 @@ extern struct Main *BKE_undo_get_main(struct Scene **scene);
|
||||
/* copybuffer */
|
||||
void BKE_copybuffer_begin(void);
|
||||
void BKE_copybuffer_tag_ID(struct ID *id);
|
||||
int BKE_copybuffer_save(char *filename, struct ReportList *reports);
|
||||
int BKE_copybuffer_paste(struct bContext *C, char *libname, struct ReportList *reports);
|
||||
int BKE_copybuffer_save(const char *filename, struct ReportList *reports);
|
||||
int BKE_copybuffer_paste(struct bContext *C, const char *libname, struct ReportList *reports);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* u
|
||||
float BKE_brush_sample_tex_3D(const Scene *scene, struct Brush *br, const float point[3],
|
||||
float rgba[4], const int thread, struct ImagePool *pool);
|
||||
float BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2],
|
||||
float rgba[4], struct ImagePool *pool);
|
||||
float rgba[4]);
|
||||
void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
|
||||
struct ImBuf **imbuf, int use_color_correction);
|
||||
|
||||
|
@ -182,7 +182,7 @@ void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float *c
|
||||
|
||||
void fcurve_bake_modifiers(struct FCurve *fcu, int start, int end);
|
||||
|
||||
int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array, float frame, int arraylen, short *exists);
|
||||
int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array, float frame, int arraylen, bool *r_exists);
|
||||
|
||||
/* ************** F-Curves API ******************** */
|
||||
|
||||
@ -200,7 +200,7 @@ struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int
|
||||
struct FCurve *iter_step_fcurve(struct FCurve *fcu_iter, const char rna_path[]);
|
||||
|
||||
/* high level function to get an fcurve from C without having the rna */
|
||||
struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, char *driven);
|
||||
struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, bool *r_driven);
|
||||
|
||||
/* Get list of LinkData's containing pointers to the F-Curves which control the types of data indicated
|
||||
* e.g. numMatches = list_find_data_fcurves(matches, &act->curves, "pose.bones[", "MyFancyBone");
|
||||
@ -208,12 +208,12 @@ struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, c
|
||||
int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix, const char *dataName);
|
||||
|
||||
/* find an f-curve based on an rna property */
|
||||
struct FCurve *rna_get_fcurve(struct PointerRNA *ptr, struct PropertyRNA *prop, int rnaindex, struct bAction **action, int *driven);
|
||||
struct FCurve *rna_get_fcurve(struct PointerRNA *ptr, struct PropertyRNA *prop, int rnaindex, struct bAction **action, bool *r_driven);
|
||||
|
||||
/* Binary search algorithm for finding where to 'insert' BezTriple with given frame number.
|
||||
* Returns the index to insert at (data already at that index will be offset if replace is 0)
|
||||
*/
|
||||
int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, short *replace);
|
||||
int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, bool *r_replace);
|
||||
|
||||
/* get the time extents for F-Curve */
|
||||
void calc_fcurve_range(struct FCurve *fcu, float *min, float *max,
|
||||
|
@ -81,7 +81,7 @@ struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me, struct Object *ob);
|
||||
int BKE_mesh_recalc_tessellation(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata,
|
||||
struct MVert *mvert,
|
||||
int totface, int totloop, int totpoly,
|
||||
const int do_face_normals);
|
||||
const bool do_face_normals);
|
||||
|
||||
/* for forwards compat only quad->tri polys to mface, skip ngons.
|
||||
*/
|
||||
@ -150,7 +150,7 @@ void BKE_mesh_free(struct Mesh *me, int unlink);
|
||||
struct Mesh *BKE_mesh_add(struct Main *bmain, const char *name);
|
||||
struct Mesh *BKE_mesh_copy_ex(struct Main *bmain, struct Mesh *me);
|
||||
struct Mesh *BKE_mesh_copy(struct Mesh *me);
|
||||
void mesh_update_customdata_pointers(struct Mesh *me, const short do_ensure_tess_cd);
|
||||
void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd);
|
||||
|
||||
void BKE_mesh_make_local(struct Mesh *me);
|
||||
void BKE_mesh_boundbox_calc(struct Mesh *me, float r_loc[3], float r_size[3]);
|
||||
@ -159,7 +159,7 @@ float (*BKE_mesh_orco_verts_get(struct Object *ob))[3];
|
||||
void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totvert, int invert);
|
||||
int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr);
|
||||
struct Mesh *BKE_mesh_from_object(struct Object *ob);
|
||||
void set_mesh(struct Object *ob, struct Mesh *me);
|
||||
void BKE_mesh_assign_object(struct Object *ob, struct Mesh *me);
|
||||
void BKE_mesh_from_metaball(struct ListBase *lb, struct Mesh *me);
|
||||
int BKE_mesh_nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *totvert,
|
||||
struct MEdge **alledge, int *totedge, struct MLoop **allloop, struct MPoly **allpoly,
|
||||
@ -167,7 +167,7 @@ int BKE_mesh_nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *tot
|
||||
int BKE_mesh_nurbs_displist_to_mdata(struct Object *ob, struct ListBase *dispbase, struct MVert **allvert, int *_totvert,
|
||||
struct MEdge **alledge, int *_totedge, struct MLoop **allloop, struct MPoly **allpoly,
|
||||
struct MLoopUV **alluv, int *_totloop, int *_totpoly);
|
||||
void BKE_mesh_from_nurbs_displist(struct Object *ob, struct ListBase *dispbase, int use_orco_uv);
|
||||
void BKE_mesh_from_nurbs_displist(struct Object *ob, struct ListBase *dispbase, const bool use_orco_uv);
|
||||
void BKE_mesh_from_nurbs(struct Object *ob);
|
||||
void BKE_mesh_to_curve_nurblist(struct DerivedMesh *dm, struct ListBase *nurblist, const int edge_users_test);
|
||||
void BKE_mesh_to_curve(struct Scene *scene, struct Object *ob);
|
||||
@ -221,7 +221,7 @@ void BKE_mesh_calc_normals(
|
||||
|
||||
/* Return a newly MEM_malloc'd array of all the mesh vertex locations
|
||||
* (_numVerts_r_ may be NULL) */
|
||||
float (*mesh_getVertexCos(struct Mesh *me, int *numVerts_r))[3];
|
||||
float (*mesh_getVertexCos(struct Mesh *me, int *r_numVerts))[3];
|
||||
|
||||
/* map from uv vertex to face (for select linked, stitch, uv suburf) */
|
||||
|
||||
@ -280,7 +280,7 @@ typedef struct UvElementMap {
|
||||
* to make that many islands, he can bite me :p */
|
||||
#define INVALID_ISLAND 0xFFFF
|
||||
|
||||
UvVertMap *BKE_mesh_uv_vert_map_make(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
|
||||
UvVertMap *BKE_mesh_uv_vert_map_create(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
|
||||
unsigned int totpoly, unsigned int totvert, int selected, float *limit);
|
||||
UvMapVert *BKE_mesh_uv_vert_map_get_vert(UvVertMap *vmap, unsigned int v);
|
||||
void BKE_mesh_uv_vert_map_free(UvVertMap *vmap);
|
||||
@ -296,12 +296,12 @@ typedef struct IndexNode {
|
||||
int index;
|
||||
} IndexNode;
|
||||
|
||||
void create_vert_poly_map(MeshElemMap **map, int **mem,
|
||||
const struct MPoly *mface, const struct MLoop *mloop,
|
||||
int totvert, int totface, int totloop);
|
||||
void BKE_mesh_vert_poly_map_create(MeshElemMap **map, int **mem,
|
||||
const struct MPoly *mface, const struct MLoop *mloop,
|
||||
int totvert, int totface, int totloop);
|
||||
|
||||
void create_vert_edge_map(MeshElemMap **map, int **mem,
|
||||
const struct MEdge *medge, int totvert, int totedge);
|
||||
void BKE_mesh_vert_edge_map_create(MeshElemMap **map, int **mem,
|
||||
const struct MEdge *medge, int totvert, int totedge);
|
||||
|
||||
/* vertex level transformations & checks (no derived mesh) */
|
||||
|
||||
@ -309,7 +309,7 @@ int BKE_mesh_minmax(struct Mesh *me, float r_min[3], float r_max[3]);
|
||||
int BKE_mesh_center_median(struct Mesh *me, float cent[3]);
|
||||
int BKE_mesh_center_bounds(struct Mesh *me, float cent[3]);
|
||||
int BKE_mesh_center_centroid(struct Mesh *me, float cent[3]);
|
||||
void BKE_mesh_translate(struct Mesh *me, float offset[3], int do_keys);
|
||||
void BKE_mesh_translate(struct Mesh *me, const float offset[3], const bool do_keys);
|
||||
|
||||
/* mesh_validate.c */
|
||||
/* XXX Loop v/e are unsigned, so using max uint_32 value as invalid marker... */
|
||||
@ -322,8 +322,8 @@ int BKE_mesh_validate_arrays(
|
||||
struct MLoop *mloops, unsigned int totloop,
|
||||
struct MPoly *mpolys, unsigned int totpoly,
|
||||
struct MDeformVert *dverts, /* assume totvert length */
|
||||
const short do_verbose, const short do_fixes);
|
||||
int BKE_mesh_validate(struct Mesh *me, int do_verbose);
|
||||
const bool do_verbose, const bool do_fixes);
|
||||
int BKE_mesh_validate(struct Mesh *me, const int do_verbose);
|
||||
int BKE_mesh_validate_dm(struct DerivedMesh *dm);
|
||||
|
||||
void BKE_mesh_calc_edges(struct Mesh *mesh, bool update, const bool select);
|
||||
|
@ -542,7 +542,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
|
||||
}
|
||||
|
||||
/* yes, must be before _and_ after tessellate */
|
||||
mesh_update_customdata_pointers(&tmp, false);
|
||||
BKE_mesh_update_customdata_pointers(&tmp, false);
|
||||
|
||||
/* since 2.65 caller must do! */
|
||||
// BKE_mesh_tessface_calc(&tmp);
|
||||
|
@ -461,7 +461,7 @@ int BKE_read_file(bContext *C, const char *filepath, ReportList *reports)
|
||||
return (bfd ? retval : BKE_READ_FILE_FAIL);
|
||||
}
|
||||
|
||||
int BKE_read_file_from_memory(bContext *C, char *filebuf, int filelength, ReportList *reports)
|
||||
int BKE_read_file_from_memory(bContext *C, const void *filebuf, int filelength, ReportList *reports)
|
||||
{
|
||||
BlendFileData *bfd;
|
||||
|
||||
@ -906,7 +906,7 @@ static void copybuffer_doit(void *UNUSED(handle), Main *UNUSED(bmain), void *vid
|
||||
}
|
||||
|
||||
/* frees main in end */
|
||||
int BKE_copybuffer_save(char *filename, ReportList *reports)
|
||||
int BKE_copybuffer_save(const char *filename, ReportList *reports)
|
||||
{
|
||||
Main *mainb = MEM_callocN(sizeof(Main), "copybuffer");
|
||||
ListBase *lbarray[MAX_LIBARRAY], *fromarray[MAX_LIBARRAY];
|
||||
@ -959,7 +959,7 @@ int BKE_copybuffer_save(char *filename, ReportList *reports)
|
||||
}
|
||||
|
||||
/* return success (1) */
|
||||
int BKE_copybuffer_paste(bContext *C, char *libname, ReportList *reports)
|
||||
int BKE_copybuffer_paste(bContext *C, const char *libname, ReportList *reports)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
@ -563,7 +563,7 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
|
||||
|
||||
|
||||
/* Brush Sampling for 2D brushes. when we unify the brush systems this will be necessarily a separate function */
|
||||
float BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], struct ImagePool *pool)
|
||||
float BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2], float rgba[4])
|
||||
{
|
||||
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
|
||||
MTex *mtex = &brush->mtex;
|
||||
@ -598,7 +598,7 @@ float BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2
|
||||
co[1] = y + brush->mtex.ofs[1];
|
||||
co[2] = 0.0f;
|
||||
|
||||
hasrgb = externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, 0, pool);
|
||||
hasrgb = externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, 0, NULL);
|
||||
|
||||
if (hasrgb) {
|
||||
rgba[0] = tr;
|
||||
@ -660,15 +660,15 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
|
||||
dstf[3] = alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
|
||||
}
|
||||
else if (texfall == 1) {
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, dstf, 0);
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, dstf);
|
||||
}
|
||||
else if (texfall == 2) {
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
|
||||
mul_v3_v3v3(dstf, rgba, brush_rgb);
|
||||
dstf[3] = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
|
||||
}
|
||||
else {
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
|
||||
copy_v3_v3(dstf, brush_rgb);
|
||||
dstf[3] = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
|
||||
}
|
||||
@ -695,11 +695,11 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
|
||||
dst[3] = FTOCHAR(alpha_f);
|
||||
}
|
||||
else if (texfall == 1) {
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
|
||||
rgba_float_to_uchar(dst, rgba);
|
||||
}
|
||||
else if (texfall == 2) {
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
|
||||
mul_v3_v3(rgba, brush->rgb);
|
||||
alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
|
||||
|
||||
@ -708,7 +708,7 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
|
||||
dst[3] = FTOCHAR(alpha_f);
|
||||
}
|
||||
else {
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
|
||||
alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
|
||||
|
||||
dst[0] = crgb[0];
|
||||
|
@ -215,7 +215,7 @@ static const MeshElemMap *cdDM_getPolyMap(Object *ob, DerivedMesh *dm)
|
||||
if (!cddm->pmap && ob->type == OB_MESH) {
|
||||
Mesh *me = ob->data;
|
||||
|
||||
create_vert_poly_map(&cddm->pmap, &cddm->pmap_mem,
|
||||
BKE_mesh_vert_poly_map_create(&cddm->pmap, &cddm->pmap_mem,
|
||||
me->mpoly, me->mloop,
|
||||
me->totvert, me->totpoly, me->totloop);
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ void copy_fcurves(ListBase *dst, ListBase *src)
|
||||
/* ----------------- Finding F-Curves -------------------------- */
|
||||
|
||||
/* high level function to get an fcurve from C without having the rna */
|
||||
FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, char *driven)
|
||||
FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven)
|
||||
{
|
||||
/* anim vars */
|
||||
AnimData *adt = BKE_animdata_from_id(id);
|
||||
@ -180,8 +180,8 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro
|
||||
PropertyRNA *prop;
|
||||
char *path;
|
||||
|
||||
if (driven)
|
||||
*driven = FALSE;
|
||||
if (r_driven)
|
||||
*r_driven = false;
|
||||
|
||||
/* only use the current action ??? */
|
||||
if (ELEM(NULL, adt, adt->action))
|
||||
@ -201,8 +201,8 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro
|
||||
/* if not animated, check if driven */
|
||||
if ((fcu == NULL) && (adt->drivers.first)) {
|
||||
fcu = list_find_fcurve(&adt->drivers, path, index);
|
||||
if (fcu && driven)
|
||||
*driven = TRUE;
|
||||
if (fcu && r_driven)
|
||||
*r_driven = true;
|
||||
fcu = NULL;
|
||||
}
|
||||
|
||||
@ -305,11 +305,11 @@ int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix,
|
||||
return matches;
|
||||
}
|
||||
|
||||
FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction **action, int *driven)
|
||||
FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction **action, bool *r_driven)
|
||||
{
|
||||
FCurve *fcu = NULL;
|
||||
|
||||
*driven = 0;
|
||||
*r_driven = false;
|
||||
|
||||
/* there must be some RNA-pointer + property combon */
|
||||
if (prop && ptr->id.data && RNA_property_animateable(ptr, prop)) {
|
||||
@ -331,7 +331,7 @@ FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction
|
||||
fcu = list_find_fcurve(&adt->drivers, path, rnaindex);
|
||||
|
||||
if (fcu)
|
||||
*driven = 1;
|
||||
*r_driven = true;
|
||||
}
|
||||
|
||||
if (fcu && action)
|
||||
@ -354,13 +354,13 @@ FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction
|
||||
/* Binary search algorithm for finding where to insert BezTriple. (for use by insert_bezt_fcurve)
|
||||
* Returns the index to insert at (data already at that index will be offset if replace is 0)
|
||||
*/
|
||||
int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short *replace)
|
||||
int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, bool *r_replace)
|
||||
{
|
||||
int start = 0, end = arraylen;
|
||||
int loopbreaker = 0, maxloop = arraylen * 2;
|
||||
|
||||
/* initialize replace-flag first */
|
||||
*replace = 0;
|
||||
*r_replace = false;
|
||||
|
||||
/* sneaky optimizations (don't go through searching process if...):
|
||||
* - keyframe to be added is to be added out of current bounds
|
||||
@ -377,7 +377,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short
|
||||
/* 'First' Keyframe (when only one keyframe, this case is used) */
|
||||
framenum = array[0].vec[1][0];
|
||||
if (IS_EQT(frame, framenum, BEZT_BINARYSEARCH_THRESH)) {
|
||||
*replace = 1;
|
||||
*r_replace = true;
|
||||
return 0;
|
||||
}
|
||||
else if (frame < framenum)
|
||||
@ -386,7 +386,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short
|
||||
/* 'Last' Keyframe */
|
||||
framenum = array[(arraylen - 1)].vec[1][0];
|
||||
if (IS_EQT(frame, framenum, BEZT_BINARYSEARCH_THRESH)) {
|
||||
*replace = 1;
|
||||
*r_replace = true;
|
||||
return (arraylen - 1);
|
||||
}
|
||||
else if (frame > framenum)
|
||||
@ -404,7 +404,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short
|
||||
|
||||
/* check if exactly equal to midpoint */
|
||||
if (IS_EQT(frame, midfra, BEZT_BINARYSEARCH_THRESH)) {
|
||||
*replace = 1;
|
||||
*r_replace = true;
|
||||
return mid;
|
||||
}
|
||||
|
||||
|
@ -487,13 +487,13 @@ static FModifierTypeInfo FMI_ENVELOPE = {
|
||||
*/
|
||||
#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001f
|
||||
|
||||
int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int arraylen, short *exists)
|
||||
int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int arraylen, bool *r_exists)
|
||||
{
|
||||
int start = 0, end = arraylen;
|
||||
int loopbreaker = 0, maxloop = arraylen * 2;
|
||||
|
||||
/* initialize exists-flag first */
|
||||
*exists = 0;
|
||||
*r_exists = false;
|
||||
|
||||
/* sneaky optimizations (don't go through searching process if...):
|
||||
* - keyframe to be added is to be added out of current bounds
|
||||
@ -510,7 +510,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array
|
||||
/* 'First' Point (when only one point, this case is used) */
|
||||
framenum = array[0].time;
|
||||
if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) {
|
||||
*exists = 1;
|
||||
*r_exists = true;
|
||||
return 0;
|
||||
}
|
||||
else if (frame < framenum) {
|
||||
@ -520,7 +520,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array
|
||||
/* 'Last' Point */
|
||||
framenum = array[(arraylen - 1)].time;
|
||||
if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) {
|
||||
*exists = 1;
|
||||
*r_exists = true;
|
||||
return (arraylen - 1);
|
||||
}
|
||||
else if (frame > framenum) {
|
||||
@ -539,7 +539,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array
|
||||
|
||||
/* check if exactly equal to midpoint */
|
||||
if (IS_EQT(frame, midfra, BINARYSEARCH_FRAMEEQ_THRESH)) {
|
||||
*exists = 1;
|
||||
*r_exists = true;
|
||||
return mid;
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ static void mesh_ensure_tessellation_customdata(Mesh *me)
|
||||
* note that for undo mesh data we want to skip 'ensure_tess_cd' call since
|
||||
* we don't want to store memory for tessface when its only used for older
|
||||
* versions of the mesh. - campbell*/
|
||||
static void mesh_update_linked_customdata(Mesh *me, const short do_ensure_tess_cd)
|
||||
static void mesh_update_linked_customdata(Mesh *me, const bool do_ensure_tess_cd)
|
||||
{
|
||||
if (me->edit_btmesh)
|
||||
BMEdit_UpdateLinkedCustomData(me->edit_btmesh);
|
||||
@ -360,7 +360,7 @@ static void mesh_update_linked_customdata(Mesh *me, const short do_ensure_tess_c
|
||||
CustomData_bmesh_update_active_layers(&me->fdata, &me->pdata, &me->ldata);
|
||||
}
|
||||
|
||||
void mesh_update_customdata_pointers(Mesh *me, const short do_ensure_tess_cd)
|
||||
void BKE_mesh_update_customdata_pointers(Mesh *me, const bool do_ensure_tess_cd)
|
||||
{
|
||||
mesh_update_linked_customdata(me, do_ensure_tess_cd);
|
||||
|
||||
@ -493,7 +493,7 @@ Mesh *BKE_mesh_copy_ex(Main *bmain, Mesh *me)
|
||||
mesh_tessface_clear_intern(men, FALSE);
|
||||
}
|
||||
|
||||
mesh_update_customdata_pointers(men, do_tessface);
|
||||
BKE_mesh_update_customdata_pointers(men, do_tessface);
|
||||
|
||||
/* ensure indirect linked data becomes lib-extern */
|
||||
for (i = 0; i < me->fdata.totlayer; i++) {
|
||||
@ -622,7 +622,7 @@ void BKE_mesh_make_local(Mesh *me)
|
||||
for (ob = bmain->object.first; ob; ob = ob->id.next) {
|
||||
if (me == ob->data) {
|
||||
if (ob->id.lib == NULL) {
|
||||
set_mesh(ob, me_new);
|
||||
BKE_mesh_assign_object(ob, me_new);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -825,7 +825,7 @@ Mesh *BKE_mesh_from_object(Object *ob)
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
void set_mesh(Object *ob, Mesh *me)
|
||||
void BKE_mesh_assign_object(Object *ob, Mesh *me)
|
||||
{
|
||||
Mesh *old = NULL;
|
||||
|
||||
@ -1194,7 +1194,7 @@ void BKE_mesh_from_metaball(ListBase *lb, Mesh *me)
|
||||
index += 4;
|
||||
}
|
||||
|
||||
mesh_update_customdata_pointers(me, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(me, true);
|
||||
|
||||
BKE_mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
|
||||
|
||||
@ -1477,7 +1477,7 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob, ListBase *dispbase,
|
||||
|
||||
|
||||
/* this may fail replacing ob->data, be sure to check ob->type */
|
||||
void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, int use_orco_uv)
|
||||
void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use_orco_uv)
|
||||
{
|
||||
Main *bmain = G.main;
|
||||
Object *ob1;
|
||||
@ -2063,7 +2063,7 @@ void BKE_mesh_convert_mfaces_to_mpolys(Mesh *mesh)
|
||||
mesh->medge, mesh->mface,
|
||||
&mesh->totloop, &mesh->totpoly, &mesh->mloop, &mesh->mpoly);
|
||||
|
||||
mesh_update_customdata_pointers(mesh, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, true);
|
||||
}
|
||||
|
||||
/* the same as BKE_mesh_convert_mfaces_to_mpolys but oriented to be used in do_versions from readfile.c
|
||||
@ -2085,7 +2085,7 @@ void BKE_mesh_do_versions_convert_mfaces_to_mpolys(Mesh *mesh)
|
||||
|
||||
CustomData_bmesh_do_versions_update_active_layers(&mesh->fdata, &mesh->pdata, &mesh->ldata);
|
||||
|
||||
mesh_update_customdata_pointers(mesh, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, true);
|
||||
}
|
||||
|
||||
void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, CustomData *fdata, CustomData *ldata, CustomData *pdata,
|
||||
@ -2190,12 +2190,12 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, CustomData *fdata, CustomData
|
||||
*mloop_r = mloop;
|
||||
}
|
||||
|
||||
float (*mesh_getVertexCos(Mesh * me, int *numVerts_r))[3]
|
||||
float (*mesh_getVertexCos(Mesh * me, int *r_numVerts))[3]
|
||||
{
|
||||
int i, numVerts = me->totvert;
|
||||
float (*cos)[3] = MEM_mallocN(sizeof(*cos) * numVerts, "vertexcos1");
|
||||
|
||||
if (numVerts_r) *numVerts_r = numVerts;
|
||||
if (r_numVerts) *r_numVerts = numVerts;
|
||||
for (i = 0; i < numVerts; i++)
|
||||
copy_v3_v3(cos[i], me->mvert[i].co);
|
||||
|
||||
@ -2207,7 +2207,8 @@ float (*mesh_getVertexCos(Mesh * me, int *numVerts_r))[3]
|
||||
/* this replaces the non bmesh function (in trunk) which takes MTFace's, if we ever need it back we could
|
||||
* but for now this replaces it because its unused. */
|
||||
|
||||
UvVertMap *BKE_mesh_uv_vert_map_make(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv, unsigned int totpoly, unsigned int totvert, int selected, float *limit)
|
||||
UvVertMap *BKE_mesh_uv_vert_map_create(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
|
||||
unsigned int totpoly, unsigned int totvert, int selected, float *limit)
|
||||
{
|
||||
UvVertMap *vmap;
|
||||
UvMapVert *buf;
|
||||
@ -2315,9 +2316,9 @@ void BKE_mesh_uv_vert_map_free(UvVertMap *vmap)
|
||||
/* Generates a map where the key is the vertex and the value is a list
|
||||
* of polys that use that vertex as a corner. The lists are allocated
|
||||
* from one memory pool. */
|
||||
void create_vert_poly_map(MeshElemMap **map, int **mem,
|
||||
const MPoly *mpoly, const MLoop *mloop,
|
||||
int totvert, int totpoly, int totloop)
|
||||
void BKE_mesh_vert_poly_map_create(MeshElemMap **map, int **mem,
|
||||
const MPoly *mpoly, const MLoop *mloop,
|
||||
int totvert, int totpoly, int totloop)
|
||||
{
|
||||
int i, j;
|
||||
int *indices;
|
||||
@ -2359,8 +2360,8 @@ void create_vert_poly_map(MeshElemMap **map, int **mem,
|
||||
/* Generates a map where the key is the vertex and the value is a list
|
||||
* of edges that use that vertex as an endpoint. The lists are allocated
|
||||
* from one memory pool. */
|
||||
void create_vert_edge_map(MeshElemMap **map, int **mem,
|
||||
const MEdge *medge, int totvert, int totedge)
|
||||
void BKE_mesh_vert_edge_map_create(MeshElemMap **map, int **mem,
|
||||
const MEdge *medge, int totvert, int totedge)
|
||||
{
|
||||
int i, *indices;
|
||||
|
||||
@ -2465,7 +2466,7 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
|
||||
int totpoly,
|
||||
/* when tessellating to recalculate normals after
|
||||
* we can skip copying here */
|
||||
const int do_face_nor_cpy)
|
||||
const bool do_face_nor_cpy)
|
||||
{
|
||||
/* use this to avoid locking pthread for _every_ polygon
|
||||
* and calling the fill function */
|
||||
@ -3335,7 +3336,7 @@ int BKE_mesh_center_centroid(Mesh *me, float cent[3])
|
||||
return (me->totpoly != 0);
|
||||
}
|
||||
|
||||
void BKE_mesh_translate(Mesh *me, float offset[3], int do_keys)
|
||||
void BKE_mesh_translate(Mesh *me, const float offset[3], const bool do_keys)
|
||||
{
|
||||
int i = me->totvert;
|
||||
MVert *mvert;
|
||||
@ -3374,9 +3375,9 @@ void BKE_mesh_tessface_calc(Mesh *mesh)
|
||||
mesh->mvert,
|
||||
mesh->totface, mesh->totloop, mesh->totpoly,
|
||||
/* calc normals right after, don't copy from polys here */
|
||||
FALSE);
|
||||
false);
|
||||
|
||||
mesh_update_customdata_pointers(mesh, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, true);
|
||||
}
|
||||
|
||||
void BKE_mesh_tessface_ensure(Mesh *mesh)
|
||||
|
@ -190,13 +190,13 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
|
||||
MLoop *mloops, unsigned int totloop,
|
||||
MPoly *mpolys, unsigned int totpoly,
|
||||
MDeformVert *dverts, /* assume totvert length */
|
||||
const short do_verbose, const short do_fixes)
|
||||
const bool do_verbose, const bool do_fixes)
|
||||
{
|
||||
# define REMOVE_EDGE_TAG(_me) { _me->v2 = _me->v1; do_edge_free = TRUE; } (void)0
|
||||
# define REMOVE_EDGE_TAG(_me) { _me->v2 = _me->v1; do_edge_free = true; } (void)0
|
||||
# define IS_REMOVED_EDGE(_me) (_me->v2 == _me->v1)
|
||||
|
||||
# define REMOVE_LOOP_TAG(_ml) { _ml->e = INVALID_LOOP_EDGE_MARKER; do_polyloop_free = TRUE; } (void)0
|
||||
# define REMOVE_POLY_TAG(_mp) { _mp->totloop *= -1; do_polyloop_free = TRUE; } (void)0
|
||||
# define REMOVE_LOOP_TAG(_ml) { _ml->e = INVALID_LOOP_EDGE_MARKER; do_polyloop_free = true; } (void)0
|
||||
# define REMOVE_POLY_TAG(_mp) { _mp->totloop *= -1; do_polyloop_free = true; } (void)0
|
||||
|
||||
MVert *mv = mverts;
|
||||
MEdge *me;
|
||||
@ -205,15 +205,15 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
|
||||
unsigned int i, j;
|
||||
int *v;
|
||||
|
||||
short do_edge_free = FALSE;
|
||||
short do_face_free = FALSE;
|
||||
short do_polyloop_free = FALSE; /* This regroups loops and polys! */
|
||||
bool do_edge_free = false;
|
||||
bool do_face_free = false;
|
||||
bool do_polyloop_free = false; /* This regroups loops and polys! */
|
||||
|
||||
short verts_fixed = FALSE;
|
||||
short vert_weights_fixed = FALSE;
|
||||
int msel_fixed = FALSE;
|
||||
bool verts_fixed = false;
|
||||
bool vert_weights_fixed = false;
|
||||
bool msel_fixed = false;
|
||||
|
||||
int do_edge_recalc = FALSE;
|
||||
bool do_edge_recalc = false;
|
||||
|
||||
EdgeHash *edge_hash = BLI_edgehash_new();
|
||||
|
||||
@ -825,7 +825,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
|
||||
return (verts_fixed || vert_weights_fixed || do_polyloop_free || do_edge_free || do_edge_recalc || msel_fixed);
|
||||
}
|
||||
|
||||
static int mesh_validate_customdata(CustomData *data, short do_verbose, const short do_fixes)
|
||||
static int mesh_validate_customdata(CustomData *data, const bool do_verbose, const bool do_fixes)
|
||||
{
|
||||
int i = 0, has_fixes = 0;
|
||||
|
||||
@ -859,7 +859,7 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh
|
||||
|
||||
static int BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata,
|
||||
CustomData *ldata, CustomData *pdata,
|
||||
short do_verbose, const short do_fixes)
|
||||
const bool do_verbose, const short do_fixes)
|
||||
{
|
||||
int vfixed = 0, efixed = 0, lfixed = 0, pfixed = 0;
|
||||
|
||||
@ -871,7 +871,7 @@ static int BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata
|
||||
return vfixed || efixed || lfixed || pfixed;
|
||||
}
|
||||
|
||||
int BKE_mesh_validate(Mesh *me, int do_verbose)
|
||||
int BKE_mesh_validate(Mesh *me, const int do_verbose)
|
||||
{
|
||||
int layers_fixed = 0, arrays_fixed = 0;
|
||||
|
||||
@ -887,13 +887,13 @@ int BKE_mesh_validate(Mesh *me, int do_verbose)
|
||||
me->mloop, me->totloop,
|
||||
me->mpoly, me->totpoly,
|
||||
me->dvert,
|
||||
do_verbose, TRUE);
|
||||
do_verbose, true);
|
||||
|
||||
if (layers_fixed || arrays_fixed) {
|
||||
DAG_id_tag_update(&me->id, OB_RECALC_DATA);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
int BKE_mesh_validate_dm(DerivedMesh *dm)
|
||||
|
@ -1288,14 +1288,14 @@ void pbvh_bmesh_print(PBVH *bvh)
|
||||
fprintf(stderr, "bm_face_to_node:\n");
|
||||
GHASH_ITER (gh_iter, bvh->bm_face_to_node) {
|
||||
fprintf(stderr, " %d -> %d\n",
|
||||
BM_elem_index_get((BMFace*)BLI_ghashIterator_getKey(&gh_iter)),
|
||||
BM_elem_index_get((BMFace *)BLI_ghashIterator_getKey(&gh_iter)),
|
||||
GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)));
|
||||
}
|
||||
|
||||
fprintf(stderr, "bm_vert_to_node:\n");
|
||||
GHASH_ITER (gh_iter, bvh->bm_vert_to_node) {
|
||||
fprintf(stderr, " %d -> %d\n",
|
||||
BM_elem_index_get((BMVert*)BLI_ghashIterator_getKey(&gh_iter)),
|
||||
BM_elem_index_get((BMVert *)BLI_ghashIterator_getKey(&gh_iter)),
|
||||
GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)));
|
||||
}
|
||||
|
||||
@ -1307,15 +1307,15 @@ void pbvh_bmesh_print(PBVH *bvh)
|
||||
fprintf(stderr, "node %d\n faces:\n", n);
|
||||
GHASH_ITER (gh_iter, node->bm_faces)
|
||||
fprintf(stderr, " %d\n",
|
||||
BM_elem_index_get((BMFace*)BLI_ghashIterator_getKey(&gh_iter)));
|
||||
BM_elem_index_get((BMFace *)BLI_ghashIterator_getKey(&gh_iter)));
|
||||
fprintf(stderr, " unique verts:\n");
|
||||
GHASH_ITER (gh_iter, node->bm_unique_verts)
|
||||
fprintf(stderr, " %d\n",
|
||||
BM_elem_index_get((BMVert*)BLI_ghashIterator_getKey(&gh_iter)));
|
||||
BM_elem_index_get((BMVert *)BLI_ghashIterator_getKey(&gh_iter)));
|
||||
fprintf(stderr, " other verts:\n");
|
||||
GHASH_ITER (gh_iter, node->bm_other_verts)
|
||||
fprintf(stderr, " %d\n",
|
||||
BM_elem_index_get((BMVert*)BLI_ghashIterator_getKey(&gh_iter)));
|
||||
BM_elem_index_get((BMVert *)BLI_ghashIterator_getKey(&gh_iter)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
|
||||
float uv[3] = {0.0f, 0.0f, 0.0f}; /* only first 2 values are written into */
|
||||
|
||||
limit[0] = limit[1] = STD_UV_CONNECT_LIMIT;
|
||||
vmap = BKE_mesh_uv_vert_map_make(mpoly, mloop, mloopuv, totface, totvert, 0, limit);
|
||||
vmap = BKE_mesh_uv_vert_map_create(mpoly, mloop, mloopuv, totface, totvert, 0, limit);
|
||||
if (!vmap)
|
||||
return 0;
|
||||
|
||||
@ -2985,7 +2985,7 @@ static const MeshElemMap *ccgDM_getPolyMap(Object *ob, DerivedMesh *dm)
|
||||
if (!ccgdm->multires.mmd && !ccgdm->pmap && ob->type == OB_MESH) {
|
||||
Mesh *me = ob->data;
|
||||
|
||||
create_vert_poly_map(&ccgdm->pmap, &ccgdm->pmap_mem,
|
||||
BKE_mesh_vert_poly_map_create(&ccgdm->pmap, &ccgdm->pmap_mem,
|
||||
me->mpoly, me->mloop,
|
||||
me->totvert, me->totpoly, me->totloop);
|
||||
}
|
||||
|
@ -86,10 +86,10 @@ void BLI_setenv_if_new(const char *env, const char *val);
|
||||
void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file);
|
||||
void BLI_make_exist(char *dir);
|
||||
void BLI_make_existing_file(const char *name);
|
||||
void BLI_split_dirfile(const char *string, char *dir, char *file, size_t dirlen, size_t filelen);
|
||||
void BLI_split_dir_part(const char *string, char *dir, size_t dirlen);
|
||||
void BLI_split_file_part(const char *string, char *file, size_t filelen);
|
||||
void BLI_join_dirfile(char *string, size_t maxlen, const char *dir, const char *file);
|
||||
void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen);
|
||||
void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen);
|
||||
void BLI_split_file_part(const char *string, char *file, const size_t filelen);
|
||||
void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *file);
|
||||
const char *BLI_path_basename(const char *path);
|
||||
|
||||
typedef enum bli_rebase_state {
|
||||
@ -105,7 +105,7 @@ int BLI_add_slash(char *string);
|
||||
void BLI_del_slash(char *string);
|
||||
const char *BLI_first_slash(const char *string);
|
||||
|
||||
void BLI_getlastdir(const char *dir, char *last, size_t maxlen);
|
||||
void BLI_getlastdir(const char *dir, char *last, const size_t maxlen);
|
||||
bool BLI_testextensie(const char *str, const char *ext);
|
||||
bool BLI_testextensie_array(const char *str, const char **ext_array);
|
||||
bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch);
|
||||
@ -117,7 +117,7 @@ bool BLI_uniquename_cb(bool (*unique_check)(void * arg, const char * name),
|
||||
void BLI_newname(char *name, int add);
|
||||
int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen);
|
||||
void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic);
|
||||
int BLI_split_name_num(char *left, int *nr, const char *name, char delim);
|
||||
int BLI_split_name_num(char *left, int *nr, const char *name, const char delim);
|
||||
|
||||
/* make sure path separators conform to system one */
|
||||
void BLI_clean(char *path)
|
||||
|
@ -96,7 +96,7 @@ BlendFileData *BLO_read_from_file(const char *filepath, struct ReportList *repor
|
||||
* indicating the cause of the failure.
|
||||
* \return The data of the file.
|
||||
*/
|
||||
BlendFileData *BLO_read_from_memory(void *mem, int memsize, struct ReportList *reports);
|
||||
BlendFileData *BLO_read_from_memory(const void *mem, int memsize, struct ReportList *reports);
|
||||
|
||||
/**
|
||||
* oldmain is old main, from which we will keep libraries, images, ..
|
||||
@ -122,7 +122,7 @@ BLO_blendfiledata_free(BlendFileData *bfd);
|
||||
* \return A handle on success, or NULL on failure.
|
||||
*/
|
||||
BlendHandle *
|
||||
BLO_blendhandle_from_file(char *file,
|
||||
BLO_blendhandle_from_file(const char *filepath,
|
||||
struct ReportList *reports);
|
||||
|
||||
/**
|
||||
@ -134,7 +134,7 @@ BLO_blendhandle_from_file(char *file,
|
||||
*/
|
||||
|
||||
BlendHandle *
|
||||
BLO_blendhandle_from_memory(void *mem,
|
||||
BLO_blendhandle_from_memory(const void *mem,
|
||||
int memsize);
|
||||
|
||||
/**
|
||||
|
@ -74,16 +74,16 @@ void BLO_blendhandle_print_sizes(BlendHandle *, void *);
|
||||
|
||||
/* Access routines used by filesel. */
|
||||
|
||||
BlendHandle *BLO_blendhandle_from_file(char *file, ReportList *reports)
|
||||
BlendHandle *BLO_blendhandle_from_file(const char *filepath, ReportList *reports)
|
||||
{
|
||||
BlendHandle *bh;
|
||||
|
||||
bh = (BlendHandle *)blo_openblenderfile(file, reports);
|
||||
bh = (BlendHandle *)blo_openblenderfile(filepath, reports);
|
||||
|
||||
return bh;
|
||||
}
|
||||
|
||||
BlendHandle *BLO_blendhandle_from_memory(void *mem, int memsize)
|
||||
BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize)
|
||||
{
|
||||
BlendHandle *bh;
|
||||
|
||||
@ -271,7 +271,7 @@ BlendFileData *BLO_read_from_file(const char *filepath, ReportList *reports)
|
||||
return bfd;
|
||||
}
|
||||
|
||||
BlendFileData *BLO_read_from_memory(void *mem, int memsize, ReportList *reports)
|
||||
BlendFileData *BLO_read_from_memory(const void *mem, int memsize, ReportList *reports)
|
||||
{
|
||||
BlendFileData *bfd = NULL;
|
||||
FileData *fd;
|
||||
|
@ -1044,7 +1044,7 @@ static int fd_read_gzip_from_memory_init(FileData *fd)
|
||||
return 1;
|
||||
}
|
||||
|
||||
FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports)
|
||||
FileData *blo_openblendermemory(const void *mem, int memsize, ReportList *reports)
|
||||
{
|
||||
if (!mem || memsize<SIZEOFBLENDERHEADER) {
|
||||
BKE_report(reports, RPT_WARNING, (mem) ? TIP_("Unable to read"): TIP_("Unable to open"));
|
||||
@ -1052,7 +1052,7 @@ FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports)
|
||||
}
|
||||
else {
|
||||
FileData *fd = filedata_new();
|
||||
char *cp = mem;
|
||||
const char *cp = mem;
|
||||
|
||||
fd->buffer = mem;
|
||||
fd->buffersize = memsize;
|
||||
@ -1109,7 +1109,7 @@ void blo_freefiledata(FileData *fd)
|
||||
}
|
||||
|
||||
if (fd->buffer && !(fd->flags & FD_FLAGS_NOT_MY_BUFFER)) {
|
||||
MEM_freeN(fd->buffer);
|
||||
MEM_freeN((void *)fd->buffer);
|
||||
fd->buffer = NULL;
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ typedef struct FileData {
|
||||
int (*read)(struct FileData *filedata, void *buffer, unsigned int size);
|
||||
|
||||
// variables needed for reading from memory / stream
|
||||
char *buffer;
|
||||
const char *buffer;
|
||||
// variables needed for reading from memfile (undo)
|
||||
struct MemFile *memfile;
|
||||
|
||||
@ -123,7 +123,7 @@ void blo_split_main(ListBase *mainlist, struct Main *main);
|
||||
BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath);
|
||||
|
||||
FileData *blo_openblenderfile(const char *filepath, struct ReportList *reports);
|
||||
FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports);
|
||||
FileData *blo_openblendermemory(const void *buffer, int buffersize, struct ReportList *reports);
|
||||
FileData *blo_openblendermemfile(struct MemFile *memfile, struct ReportList *reports);
|
||||
|
||||
void blo_clear_proxy_pointers_from_lib(Main *oldmain);
|
||||
|
@ -453,7 +453,7 @@ static void customdata_version_242(Mesh *me)
|
||||
}
|
||||
}
|
||||
|
||||
mesh_update_customdata_pointers(me, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(me, true);
|
||||
}
|
||||
|
||||
/*only copy render texface layer from active*/
|
||||
|
@ -1872,7 +1872,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
|
||||
mesh->totface = BKE_mesh_mpoly_to_mface(&mesh->fdata, &backup_mesh.ldata, &backup_mesh.pdata,
|
||||
mesh->totface, backup_mesh.totloop, backup_mesh.totpoly);
|
||||
|
||||
mesh_update_customdata_pointers(mesh, FALSE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, false);
|
||||
|
||||
writestruct(wd, ID_ME, "Mesh", 1, mesh);
|
||||
|
||||
@ -1909,7 +1909,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
|
||||
mesh->totpoly = backup_mesh.totpoly;
|
||||
mesh->totloop = backup_mesh.totloop;
|
||||
/* -- */
|
||||
mesh_update_customdata_pointers(mesh, FALSE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, false);
|
||||
/* --*/
|
||||
mesh->edit_btmesh = backup_mesh.edit_btmesh; /* keep this after updating custom pointers */
|
||||
/* restore */
|
||||
|
@ -756,7 +756,7 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
|
||||
BM_ITER_MESH (ed, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
if (vptr_map) {
|
||||
/* printf("Edge v1: %p -> %p\n", ed->v1, BLI_ghash_lookup(vptr_map, (const void *)ed->v1));*/
|
||||
/* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, (const void* )ed->v2));*/
|
||||
/* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, (const void *)ed->v2));*/
|
||||
ed->v1 = BLI_ghash_lookup(vptr_map, (const void *)ed->v1);
|
||||
ed->v2 = BLI_ghash_lookup(vptr_map, (const void *)ed->v2);
|
||||
}
|
||||
|
@ -660,7 +660,7 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, bool do_tessface)
|
||||
me->cd_flag = BM_mesh_cd_flag_from_bmesh(bm);
|
||||
|
||||
/* this is called again, 'dotess' arg is used there */
|
||||
mesh_update_customdata_pointers(me, 0);
|
||||
BKE_mesh_update_customdata_pointers(me, 0);
|
||||
|
||||
i = 0;
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
@ -800,7 +800,7 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, bool do_tessface)
|
||||
BKE_mesh_tessface_calc(me);
|
||||
}
|
||||
|
||||
mesh_update_customdata_pointers(me, do_tessface);
|
||||
BKE_mesh_update_customdata_pointers(me, do_tessface);
|
||||
|
||||
{
|
||||
BMEditSelection *selected;
|
||||
|
@ -1087,7 +1087,7 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
|
||||
* Small utility functions for fast access
|
||||
*
|
||||
* faster alternative to:
|
||||
* BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void**)v, 3);
|
||||
* BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void **)v, 3);
|
||||
*/
|
||||
void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3])
|
||||
{
|
||||
@ -1102,7 +1102,7 @@ void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3])
|
||||
|
||||
/**
|
||||
* faster alternative to:
|
||||
* BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void**)v, 4);
|
||||
* BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void **)v, 4);
|
||||
*/
|
||||
void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4])
|
||||
{
|
||||
|
@ -184,7 +184,7 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl
|
||||
ListBase *conlist = get_active_constraints(ob);
|
||||
if (conlist == NULL) return;
|
||||
bConstraint *con;
|
||||
for (con = (bConstraint*)conlist->first; con; con = con->next) {
|
||||
for (con = (bConstraint *)conlist->first; con; con = con->next) {
|
||||
ListBase targets = {NULL, NULL};
|
||||
|
||||
bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
|
||||
@ -200,7 +200,7 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl
|
||||
*/
|
||||
cti->get_constraint_targets(con, &targets);
|
||||
if (cti) {
|
||||
for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) {
|
||||
for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) {
|
||||
obtar = ct->tar;
|
||||
find_frames(obtar, frames);
|
||||
}
|
||||
@ -544,7 +544,7 @@ void AnimationExporter::dae_baked_object_animation(std::vector<float> &fra, Obje
|
||||
if (!fra.size())
|
||||
return;
|
||||
|
||||
BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s", (char*)translate_id(ob_name).c_str(),
|
||||
BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s", (char *)translate_id(ob_name).c_str(),
|
||||
"object_matrix");
|
||||
|
||||
openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING);
|
||||
@ -1535,7 +1535,7 @@ void AnimationExporter::calc_ob_mat_at_time(Object *ob, float ctime , float mat[
|
||||
{
|
||||
ListBase *conlist = get_active_constraints(ob);
|
||||
bConstraint *con;
|
||||
for (con = (bConstraint*)conlist->first; con; con = con->next) {
|
||||
for (con = (bConstraint *)conlist->first; con; con = con->next) {
|
||||
ListBase targets = {NULL, NULL};
|
||||
|
||||
bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con);
|
||||
@ -1544,7 +1544,7 @@ void AnimationExporter::calc_ob_mat_at_time(Object *ob, float ctime , float mat[
|
||||
bConstraintTarget *ct;
|
||||
Object *obtar;
|
||||
cti->get_constraint_targets(con, &targets);
|
||||
for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) {
|
||||
for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) {
|
||||
obtar = ct->tar;
|
||||
BKE_animsys_evaluate_animdata(scene, &obtar->id, obtar->adt, ctime, ADT_RECALC_ANIM);
|
||||
BKE_object_where_is_calc_time(scene, obtar, ctime);
|
||||
|
@ -674,7 +674,7 @@ void ArmatureImporter::make_shape_keys()
|
||||
|
||||
if (source_ob) {
|
||||
|
||||
Mesh *source_me = (Mesh*) source_ob->data;
|
||||
Mesh *source_me = (Mesh *)source_ob->data;
|
||||
//insert key to source mesh
|
||||
Key *key = source_me->key = BKE_key_add((ID *)source_me);
|
||||
key->type = KEY_RELATIVE;
|
||||
|
@ -352,7 +352,7 @@ std::string ControllerExporter::add_morph_targets(Key *key, Object *ob)
|
||||
|
||||
source.prepareToAppendValues();
|
||||
|
||||
KeyBlock * kb = (KeyBlock*)key->block.first;
|
||||
KeyBlock *kb = (KeyBlock *)key->block.first;
|
||||
//skip the basis
|
||||
kb = kb->next;
|
||||
for (; kb; kb = kb->next) {
|
||||
@ -381,7 +381,7 @@ std::string ControllerExporter::add_morph_weights(Key *key, Object *ob)
|
||||
|
||||
source.prepareToAppendValues();
|
||||
|
||||
KeyBlock * kb = (KeyBlock*)key->block.first;
|
||||
KeyBlock *kb = (KeyBlock *)key->block.first;
|
||||
//skip the basis
|
||||
kb = kb->next;
|
||||
for (; kb; kb = kb->next) {
|
||||
@ -399,7 +399,7 @@ void ControllerExporter::add_weight_extras(Key *key)
|
||||
// can also try the base element and param alternative
|
||||
COLLADASW::BaseExtraTechnique extra;
|
||||
|
||||
KeyBlock * kb = (KeyBlock*)key->block.first;
|
||||
KeyBlock * kb = (KeyBlock *)key->block.first;
|
||||
//skip the basis
|
||||
kb = kb->next;
|
||||
for (; kb; kb = kb->next) {
|
||||
|
@ -155,7 +155,7 @@ void GeometryExporter::operator()(Object *ob)
|
||||
if (this->export_settings->include_shapekeys) {
|
||||
Key * key = BKE_key_from_object(ob);
|
||||
if (key) {
|
||||
KeyBlock * kb = (KeyBlock*)key->block.first;
|
||||
KeyBlock * kb = (KeyBlock *)key->block.first;
|
||||
//skip the basis
|
||||
kb = kb->next;
|
||||
for (; kb; kb = kb->next) {
|
||||
|
@ -465,7 +465,7 @@ void MeshImporter::mesh_add_edges(Mesh *mesh, int len)
|
||||
|
||||
CustomData_free(&mesh->edata, mesh->totedge);
|
||||
mesh->edata = edata;
|
||||
mesh_update_customdata_pointers(mesh, FALSE); /* new edges don't change tessellation */
|
||||
BKE_mesh_update_customdata_pointers(mesh, false); /* new edges don't change tessellation */
|
||||
|
||||
/* set default flags */
|
||||
medge = &mesh->medge[mesh->totedge];
|
||||
@ -1029,7 +1029,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
|
||||
Mesh *old_mesh = (Mesh *)ob->data;
|
||||
Mesh *new_mesh = uid_mesh_map[*geom_uid];
|
||||
|
||||
set_mesh(ob, new_mesh);
|
||||
BKE_mesh_assign_object(ob, new_mesh);
|
||||
|
||||
if (old_mesh->id.us == 0) BKE_libblock_free(&G.main->mesh, old_mesh);
|
||||
|
||||
@ -1075,7 +1075,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom)
|
||||
|
||||
const std::string& str_geom_id = mesh->getName().size() ? mesh->getName() : mesh->getOriginalId();
|
||||
Mesh *me = BKE_mesh_add(G.main, (char *)str_geom_id.c_str());
|
||||
me->id.us--; // is already 1 here, but will be set later in set_mesh
|
||||
me->id.us--; // is already 1 here, but will be set later in BKE_mesh_assign_object
|
||||
|
||||
// store the Mesh pointer to link it later with an Object
|
||||
// mesh_geom_map needed to map mesh to its geometry name (for shape key naming)
|
||||
|
@ -190,7 +190,7 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
|
||||
}
|
||||
|
||||
if (ob->constraints.first != NULL ) {
|
||||
bConstraint *con = (bConstraint*) ob->constraints.first;
|
||||
bConstraint *con = (bConstraint *) ob->constraints.first;
|
||||
while (con) {
|
||||
std::string con_name(id_name(con));
|
||||
std::string con_tag = con_name + "_constraint";
|
||||
@ -216,7 +216,7 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
|
||||
|
||||
cti->get_constraint_targets(con, &targets);
|
||||
if (cti) {
|
||||
for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) {
|
||||
for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) {
|
||||
obtar = ct->tar;
|
||||
std::string tar_id(id_name(obtar));
|
||||
colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"target_id",tar_id);
|
||||
|
@ -343,7 +343,7 @@ static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void *UNUSED(ar
|
||||
|
||||
/* check that no data exists for the current frame... */
|
||||
if (env->data) {
|
||||
short exists = -1;
|
||||
bool exists;
|
||||
int i = BKE_fcm_envelope_find_index(env->data, (float)(scene->r.cfra), env->totvert, &exists);
|
||||
|
||||
/* binarysearch_...() will set exists by default to 0, so if it is non-zero, that means that the point exists already */
|
||||
|
@ -237,7 +237,7 @@ int insert_bezt_fcurve(FCurve *fcu, BezTriple *bezt, short flag)
|
||||
|
||||
/* are there already keyframes? */
|
||||
if (fcu->bezt) {
|
||||
short replace = -1;
|
||||
bool replace;
|
||||
i = binarysearch_bezt_index(fcu->bezt, bezt->vec[1][0], fcu->totvert, &replace);
|
||||
|
||||
/* replace an existing keyframe? */
|
||||
@ -1055,7 +1055,7 @@ short delete_keyframe(ReportList *reports, ID *id, bAction *act, const char grou
|
||||
/* will only loop once unless the array index was -1 */
|
||||
for (; array_index < array_index_max; array_index++) {
|
||||
FCurve *fcu = verify_fcurve(act, group, &ptr, rna_path, array_index, 0);
|
||||
short found = -1;
|
||||
bool found;
|
||||
int i;
|
||||
|
||||
/* check if F-Curve exists and/or whether it can be edited */
|
||||
@ -1845,7 +1845,7 @@ short fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter)
|
||||
|
||||
/* we either include all regardless of muting, or only non-muted */
|
||||
if ((filter & ANIMFILTER_KEYS_MUTED) || (fcu->flag & FCURVE_MUTED) == 0) {
|
||||
short replace = -1;
|
||||
bool replace;
|
||||
int i = binarysearch_bezt_index(fcu->bezt, frame, fcu->totvert, &replace);
|
||||
|
||||
/* binarysearch_bezt_index will set replace to be 0 or 1
|
||||
|
@ -1081,7 +1081,7 @@ static void pose_propagate_fcurve(wmOperator *op, Object *ob, FCurve *fcu,
|
||||
|
||||
BezTriple *bezt;
|
||||
float refVal = 0.0f;
|
||||
short keyExists;
|
||||
bool keyExists;
|
||||
int i, match;
|
||||
short first = 1;
|
||||
|
||||
|
@ -79,7 +79,7 @@ int ED_space_image_maskedit_mask_poll(struct bContext *C);
|
||||
void ED_image_update_frame(const struct Main *mainp, int cfra);
|
||||
|
||||
void ED_image_draw_info(struct Scene *scene, struct ARegion *ar, int color_manage, int use_default_view, int channels, int x, int y,
|
||||
const unsigned char cp[4], const float fp[4], int *zp, float *zpf);
|
||||
const unsigned char cp[4], const float fp[4], const float linearcol[4], int *zp, float *zpf);
|
||||
|
||||
#endif /* __ED_IMAGE_H__ */
|
||||
|
||||
|
@ -216,7 +216,7 @@ bool ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, int
|
||||
struct rctf *r_viewplane, float *r_clipsta, float *r_clipend);
|
||||
void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar,
|
||||
struct View3D *v3d, struct RegionView3D *rv3d,
|
||||
struct rctf *viewborder_r, const bool no_shift);
|
||||
struct rctf *r_viewborder, const bool no_shift);
|
||||
void ED_view3d_calc_camera_border_size(struct Scene *scene, struct ARegion *ar,
|
||||
struct View3D *v3d, struct RegionView3D *rv3d,
|
||||
float r_size[2]);
|
||||
@ -244,7 +244,7 @@ unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, const int mval[2
|
||||
unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y);
|
||||
|
||||
/* draws and does a 4x4 sample */
|
||||
int ED_view3d_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const int mval[2], float mouse_worldloc[3]);
|
||||
int ED_view3d_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const int mval[2], float mouse_worldloc[3], bool alphaoverride);
|
||||
|
||||
/* only draw so ED_view3d_autodist_simple can be called many times after */
|
||||
int ED_view3d_autodist_init(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, int mode);
|
||||
@ -268,7 +268,7 @@ int edge_inside_circle(const float cent[2], float radius, const float screen_co_
|
||||
|
||||
/* get 3d region from context, also if mouse is in header or toolbar */
|
||||
struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C);
|
||||
int ED_view3d_context_user_region(struct bContext *C, struct View3D **v3d_r, struct ARegion **ar_r);
|
||||
int ED_view3d_context_user_region(struct bContext *C, struct View3D **r_v3d, struct ARegion **r_ar);
|
||||
int ED_operator_rv3d_user_region_poll(struct bContext *C);
|
||||
|
||||
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d);
|
||||
|
@ -55,19 +55,19 @@
|
||||
|
||||
#include "interface_intern.h"
|
||||
|
||||
static FCurve *ui_but_get_fcurve(uiBut *but, bAction **action, int *driven)
|
||||
static FCurve *ui_but_get_fcurve(uiBut *but, bAction **action, bool *r_driven)
|
||||
{
|
||||
/* for entire array buttons we check the first component, it's not perfect
|
||||
* but works well enough in typical cases */
|
||||
int rnaindex = (but->rnaindex == -1) ? 0 : but->rnaindex;
|
||||
|
||||
return rna_get_fcurve(&but->rnapoin, but->rnaprop, rnaindex, action, driven);
|
||||
return rna_get_fcurve(&but->rnapoin, but->rnaprop, rnaindex, action, r_driven);
|
||||
}
|
||||
|
||||
void ui_but_anim_flag(uiBut *but, float cfra)
|
||||
{
|
||||
FCurve *fcu;
|
||||
int driven;
|
||||
bool driven;
|
||||
|
||||
but->flag &= ~(UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN);
|
||||
|
||||
@ -90,7 +90,7 @@ int ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen)
|
||||
{
|
||||
FCurve *fcu;
|
||||
ChannelDriver *driver;
|
||||
int driven;
|
||||
bool driven;
|
||||
|
||||
fcu = ui_but_get_fcurve(but, NULL, &driven);
|
||||
|
||||
@ -110,7 +110,7 @@ int ui_but_anim_expression_set(uiBut *but, const char *str)
|
||||
{
|
||||
FCurve *fcu;
|
||||
ChannelDriver *driver;
|
||||
int driven;
|
||||
bool driven;
|
||||
|
||||
fcu = ui_but_get_fcurve(but, NULL, &driven);
|
||||
|
||||
@ -194,7 +194,7 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
|
||||
ID *id;
|
||||
bAction *action;
|
||||
FCurve *fcu;
|
||||
int driven;
|
||||
bool driven;
|
||||
|
||||
fcu = ui_but_get_fcurve(but, &action, &driven);
|
||||
|
||||
|
@ -4158,20 +4158,27 @@ static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandle
|
||||
return WM_UI_HANDLER_CONTINUE;
|
||||
}
|
||||
|
||||
static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
|
||||
float mx, float my, const short shift)
|
||||
static int ui_numedit_but_CURVE(uiBlock *block, uiBut *but, uiHandleButtonData *data, int snap,
|
||||
int evtx, int evty, const short shift)
|
||||
{
|
||||
CurveMapping *cumap = (CurveMapping *)but->poin;
|
||||
CurveMap *cuma = cumap->cm + cumap->cur;
|
||||
CurveMapPoint *cmp = cuma->curve;
|
||||
float fx, fy, zoomx, zoomy /*, offsx, offsy */ /* UNUSED */;
|
||||
float fx, fy, zoomx, zoomy;
|
||||
int mx, my, dragx, dragy;
|
||||
int a, changed = 0;
|
||||
|
||||
/* evtx evty and drag coords are absolute mousecoords, prevents errors when editing when layout changes */
|
||||
mx = evtx;
|
||||
my = evty;
|
||||
ui_window_to_block(data->region, block, &mx, &my);
|
||||
dragx = data->draglastx;
|
||||
dragy = data->draglasty;
|
||||
ui_window_to_block(data->region, block, &dragx, &dragy);
|
||||
|
||||
zoomx = BLI_rctf_size_x(&but->rect) / BLI_rctf_size_x(&cumap->curr);
|
||||
zoomy = BLI_rctf_size_y(&but->rect) / BLI_rctf_size_y(&cumap->curr);
|
||||
/* offsx = cumap->curr.xmin; */
|
||||
/* offsy = cumap->curr.ymin; */
|
||||
|
||||
|
||||
if (snap) {
|
||||
float d[2];
|
||||
|
||||
@ -4187,8 +4194,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
|
||||
const float mval_factor = ui_mouse_scale_warp_factor(shift);
|
||||
int moved_point = 0; /* for ctrl grid, can't use orig coords because of sorting */
|
||||
|
||||
fx = (mx - data->draglastx) / zoomx;
|
||||
fy = (my - data->draglasty) / zoomy;
|
||||
fx = (mx - dragx) / zoomx;
|
||||
fy = (my - dragy) / zoomy;
|
||||
|
||||
fx *= mval_factor;
|
||||
fy *= mval_factor;
|
||||
@ -4212,8 +4219,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
|
||||
curvemapping_changed(cumap, FALSE);
|
||||
|
||||
if (moved_point) {
|
||||
data->draglastx = mx;
|
||||
data->draglasty = my;
|
||||
data->draglastx = evtx;
|
||||
data->draglasty = evty;
|
||||
changed = 1;
|
||||
|
||||
#ifdef USE_CONT_MOUSE_CORRECT
|
||||
@ -4232,8 +4239,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
|
||||
data->dragchange = 1; /* mark for selection */
|
||||
}
|
||||
else {
|
||||
fx = (mx - data->draglastx) / zoomx;
|
||||
fy = (my - data->draglasty) / zoomy;
|
||||
fx = (mx - dragx) / zoomx;
|
||||
fy = (my - dragy) / zoomy;
|
||||
|
||||
/* clamp for clip */
|
||||
if (cumap->flag & CUMA_DO_CLIP) {
|
||||
@ -4252,8 +4259,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap,
|
||||
cumap->curr.xmax -= fx;
|
||||
cumap->curr.ymax -= fy;
|
||||
|
||||
data->draglastx = mx;
|
||||
data->draglasty = my;
|
||||
data->draglastx = evtx;
|
||||
data->draglasty = evty;
|
||||
|
||||
changed = 1;
|
||||
}
|
||||
@ -4268,7 +4275,7 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
|
||||
mx = event->x;
|
||||
my = event->y;
|
||||
ui_window_to_block(data->region, block, &mx, &my);
|
||||
|
||||
|
||||
if (data->state == BUTTON_STATE_HIGHLIGHT) {
|
||||
if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
|
||||
CurveMapping *cumap = (CurveMapping *)but->poin;
|
||||
@ -4358,11 +4365,11 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
|
||||
}
|
||||
|
||||
data->dragsel = sel;
|
||||
|
||||
data->dragstartx = mx;
|
||||
data->dragstarty = my;
|
||||
data->draglastx = mx;
|
||||
data->draglasty = my;
|
||||
|
||||
data->dragstartx = event->x;
|
||||
data->dragstarty = event->y;
|
||||
data->draglastx = event->x;
|
||||
data->draglasty = event->y;
|
||||
|
||||
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
|
||||
return WM_UI_HANDLER_BREAK;
|
||||
@ -4370,8 +4377,9 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
|
||||
}
|
||||
else if (data->state == BUTTON_STATE_NUM_EDITING) {
|
||||
if (event->type == MOUSEMOVE) {
|
||||
if (mx != data->draglastx || my != data->draglasty) {
|
||||
if (ui_numedit_but_CURVE(but, data, event->ctrl, mx, my, event->shift))
|
||||
if (event->x != data->draglastx || event->y != data->draglasty) {
|
||||
|
||||
if (ui_numedit_but_CURVE(block, but, data, event->ctrl, event->x, event->y, event->shift))
|
||||
ui_numedit_apply(C, block, but, data);
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
|
||||
}
|
||||
else {
|
||||
CustomData_free_layer_active(data, type, tot);
|
||||
mesh_update_customdata_pointers(me, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(me, true);
|
||||
}
|
||||
|
||||
if (!CustomData_has_layer(data, type) && (type == CD_MLOOPCOL && (ob->mode & OB_MODE_VERTEX_PAINT)))
|
||||
@ -406,7 +406,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
|
||||
CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum_dst);
|
||||
}
|
||||
|
||||
mesh_update_customdata_pointers(me, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(me, true);
|
||||
}
|
||||
|
||||
/* don't overwrite our copied coords */
|
||||
@ -489,7 +489,7 @@ int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mes
|
||||
CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum);
|
||||
}
|
||||
|
||||
mesh_update_customdata_pointers(me, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(me, true);
|
||||
}
|
||||
|
||||
DAG_id_tag_update(&me->id, 0);
|
||||
@ -942,7 +942,7 @@ static void mesh_add_verts(Mesh *mesh, int len)
|
||||
|
||||
CustomData_free(&mesh->vdata, mesh->totvert);
|
||||
mesh->vdata = vdata;
|
||||
mesh_update_customdata_pointers(mesh, FALSE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, false);
|
||||
|
||||
/* scan the input list and insert the new vertices */
|
||||
|
||||
@ -986,7 +986,7 @@ static void mesh_add_edges(Mesh *mesh, int len)
|
||||
|
||||
CustomData_free(&mesh->edata, mesh->totedge);
|
||||
mesh->edata = edata;
|
||||
mesh_update_customdata_pointers(mesh, FALSE); /* new edges don't change tessellation */
|
||||
BKE_mesh_update_customdata_pointers(mesh, false); /* new edges don't change tessellation */
|
||||
|
||||
/* set default flags */
|
||||
medge = &mesh->medge[mesh->totedge];
|
||||
@ -1016,7 +1016,7 @@ static void mesh_add_tessfaces(Mesh *mesh, int len)
|
||||
|
||||
CustomData_free(&mesh->fdata, mesh->totface);
|
||||
mesh->fdata = fdata;
|
||||
mesh_update_customdata_pointers(mesh, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, true);
|
||||
|
||||
/* set default flags */
|
||||
mface = &mesh->mface[mesh->totface];
|
||||
@ -1045,7 +1045,7 @@ static void mesh_add_loops(Mesh *mesh, int len)
|
||||
|
||||
CustomData_free(&mesh->ldata, mesh->totloop);
|
||||
mesh->ldata = ldata;
|
||||
mesh_update_customdata_pointers(mesh, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, true);
|
||||
|
||||
mesh->totloop = totloop;
|
||||
}
|
||||
@ -1070,7 +1070,7 @@ static void mesh_add_polys(Mesh *mesh, int len)
|
||||
|
||||
CustomData_free(&mesh->pdata, mesh->totpoly);
|
||||
mesh->pdata = pdata;
|
||||
mesh_update_customdata_pointers(mesh, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(mesh, true);
|
||||
|
||||
/* set default flags */
|
||||
mpoly = &mesh->mpoly[mesh->totpoly];
|
||||
|
@ -505,7 +505,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
|
||||
me->pdata = pdata;
|
||||
|
||||
/* tessface data removed above, no need to update */
|
||||
mesh_update_customdata_pointers(me, FALSE);
|
||||
BKE_mesh_update_customdata_pointers(me, false);
|
||||
|
||||
/* update normals in case objects with non-uniform scale are joined */
|
||||
ED_mesh_calc_normals(me);
|
||||
|
@ -1754,7 +1754,7 @@ static Object *modifier_skin_armature_create(struct Scene *scene,
|
||||
arm->edbo = MEM_callocN(sizeof(ListBase), "edbo armature");
|
||||
|
||||
mvert_skin = CustomData_get_layer(&me->vdata, CD_MVERT_SKIN);
|
||||
create_vert_edge_map(&emap, &emap_mem,
|
||||
BKE_mesh_vert_edge_map_create(&emap, &emap_mem,
|
||||
me->medge, me->totvert, me->totedge);
|
||||
|
||||
edges_visited = BLI_BITMAP_NEW(me->totedge, "edge_visited");
|
||||
|
@ -192,7 +192,7 @@ static Main *G_pr_main = NULL;
|
||||
static Main *G_pr_main_cycles = NULL;
|
||||
|
||||
#ifndef WITH_HEADLESS
|
||||
static Main *load_main_from_memory(char *blend, int blend_size)
|
||||
static Main *load_main_from_memory(const void *blend, int blend_size)
|
||||
{
|
||||
const int fileflags = G.fileflags;
|
||||
Main *bmain = NULL;
|
||||
|
@ -614,8 +614,8 @@ void PAINT_OT_image_paint(wmOperatorType *ot)
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
|
||||
|
||||
RNA_def_enum(ot->srna, "mode", stroke_mode_items, BRUSH_STROKE_NORMAL,
|
||||
"Paint Stroke Mode",
|
||||
"Action taken when a paint stroke is made");
|
||||
"Paint Stroke Mode",
|
||||
"Action taken when a paint stroke is made");
|
||||
|
||||
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ static void brush_painter_2d_do_partial(BrushPainter *painter, ImBuf *oldtexibuf
|
||||
xy[0] = x + xoff;
|
||||
xy[1] = y + yoff;
|
||||
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, tf, NULL);
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, tf);
|
||||
}
|
||||
|
||||
bf[0] = tf[0] * mf[0];
|
||||
@ -266,7 +266,7 @@ static void brush_painter_2d_do_partial(BrushPainter *painter, ImBuf *oldtexibuf
|
||||
xy[0] = x + xoff;
|
||||
xy[1] = y + yoff;
|
||||
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba, NULL);
|
||||
BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
|
||||
rgba_float_to_uchar(t, rgba);
|
||||
}
|
||||
|
||||
|
@ -4118,7 +4118,7 @@ int paint_proj_stroke(bContext *C, void *pps, const int prevmval_i[2], const int
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
if (!ED_view3d_autodist(scene, ps->ar, v3d, mval_i, cursor))
|
||||
if (!ED_view3d_autodist(scene, ps->ar, v3d, mval_i, cursor, false))
|
||||
return 0;
|
||||
|
||||
ED_region_tag_redraw(ps->ar);
|
||||
|
@ -354,7 +354,7 @@ static void make_vertexcol(Object *ob) /* single ob */
|
||||
if (!me->mloopcol) {
|
||||
CustomData_add_layer(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop);
|
||||
}
|
||||
mesh_update_customdata_pointers(me, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(me, true);
|
||||
}
|
||||
|
||||
update_tessface_data(ob, me);
|
||||
|
@ -4553,7 +4553,7 @@ void sculpt_dynamic_topology_disable(bContext *C,
|
||||
CustomData_copy(&unode->bm_enter_pdata, &me->pdata, CD_MASK_MESH,
|
||||
CD_DUPLICATE, unode->bm_enter_totpoly);
|
||||
|
||||
mesh_update_customdata_pointers(me, FALSE);
|
||||
BKE_mesh_update_customdata_pointers(me, false);
|
||||
}
|
||||
else {
|
||||
sculptsession_bm_to_me(ob, TRUE);
|
||||
|
@ -221,7 +221,7 @@ static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)
|
||||
Sequence *seq;
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
struct FCurve *fcu;
|
||||
char driven;
|
||||
bool driven;
|
||||
|
||||
SEQ_BEGIN(scene->ed, seq)
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ static void draw_render_info(Scene *scene, Image *ima, ARegion *ar, float zoomx,
|
||||
|
||||
/* used by node view too */
|
||||
void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_default_view, int channels, int x, int y,
|
||||
const unsigned char cp[4], const float fp[4], int *zp, float *zpf)
|
||||
const unsigned char cp[4], const float fp[4], const float linearcol[4], int *zp, float *zpf)
|
||||
{
|
||||
char str[256];
|
||||
float dx = 6;
|
||||
@ -258,15 +258,23 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
|
||||
dx += BLF_width(blf_mono_font, str);
|
||||
}
|
||||
|
||||
if (color_manage && channels == 4) {
|
||||
float pixel[4];
|
||||
if (color_manage) {
|
||||
float rgba[4];
|
||||
|
||||
copy_v3_v3(rgba, linearcol);
|
||||
if (channels == 3)
|
||||
rgba[3] = 1.0f;
|
||||
else
|
||||
rgba[3] = linearcol[3];
|
||||
|
||||
(void)color_manage;
|
||||
|
||||
if (use_default_view)
|
||||
IMB_colormanagement_pixel_to_display_space_v4(pixel, fp, NULL, &scene->display_settings);
|
||||
IMB_colormanagement_pixel_to_display_space_v4(rgba, rgba, NULL, &scene->display_settings);
|
||||
else
|
||||
IMB_colormanagement_pixel_to_display_space_v4(pixel, fp, &scene->view_settings, &scene->display_settings);
|
||||
IMB_colormanagement_pixel_to_display_space_v4(rgba, rgba, &scene->view_settings, &scene->display_settings);
|
||||
|
||||
BLI_snprintf(str, sizeof(str), " | CM R:%-.4f G:%-.4f B:%-.4f", pixel[0], pixel[1], pixel[2]);
|
||||
BLI_snprintf(str, sizeof(str), " | CM R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
|
||||
BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0);
|
||||
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
|
||||
dx += BLF_width(blf_mono_font, str);
|
||||
@ -287,26 +295,11 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
|
||||
col[3] = 1.0f;
|
||||
}
|
||||
else if (channels == 3) {
|
||||
if (fp) {
|
||||
copy_v3_v3(col, fp);
|
||||
}
|
||||
else if (cp) {
|
||||
rgb_uchar_to_float(col, cp);
|
||||
}
|
||||
else {
|
||||
zero_v3(col);
|
||||
}
|
||||
copy_v3_v3(col, linearcol);
|
||||
col[3] = 1.0f;
|
||||
}
|
||||
else if (channels == 4) {
|
||||
if (fp)
|
||||
copy_v4_v4(col, fp);
|
||||
else if (cp) {
|
||||
rgba_uchar_to_float(col, cp);
|
||||
}
|
||||
else {
|
||||
zero_v4(col);
|
||||
}
|
||||
copy_v4_v4(col, linearcol);
|
||||
}
|
||||
else {
|
||||
BLI_assert(0);
|
||||
|
@ -2079,6 +2079,7 @@ typedef struct ImageSampleInfo {
|
||||
|
||||
unsigned char col[4];
|
||||
float colf[4];
|
||||
float linearcol[4];
|
||||
int z;
|
||||
float zf;
|
||||
|
||||
@ -2099,7 +2100,7 @@ static void image_sample_draw(const bContext *C, ARegion *ar, void *arg_info)
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
ED_image_draw_info(scene, ar, info->color_manage, info->use_default_view, info->channels,
|
||||
info->x, info->y, info->colp, info->colfp, info->zp, info->zfp);
|
||||
info->x, info->y, info->colp, info->colfp, info->linearcol, info->zp, info->zfp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2198,7 +2199,10 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event
|
||||
info->colf[3] = (float)cp[3] / 255.0f;
|
||||
info->colfp = info->colf;
|
||||
|
||||
info->color_manage = FALSE;
|
||||
copy_v4_v4(info->linearcol, info->colf);
|
||||
IMB_colormanagement_colorspace_to_scene_linear_v4(info->linearcol, false, ibuf->rect_colorspace);
|
||||
|
||||
info->color_manage = TRUE;
|
||||
}
|
||||
if (ibuf->rect_float) {
|
||||
fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
|
||||
@ -2209,6 +2213,8 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event
|
||||
info->colf[3] = fp[3];
|
||||
info->colfp = info->colf;
|
||||
|
||||
copy_v4_v4(info->linearcol, info->colf);
|
||||
|
||||
info->color_manage = TRUE;
|
||||
}
|
||||
|
||||
|
@ -1129,7 +1129,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
|
||||
|
||||
if (snode->nodetree) {
|
||||
bNode *node;
|
||||
/* void** highlights = 0; */ /* UNUSED */
|
||||
/* void **highlights = 0; */ /* UNUSED */
|
||||
|
||||
node_uiblocks_init(C, snode->nodetree);
|
||||
|
||||
|
@ -56,6 +56,7 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "IMB_colormanagement.h"
|
||||
#include "IMB_imbuf.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
|
||||
@ -335,6 +336,7 @@ typedef struct ImageSampleInfo {
|
||||
|
||||
unsigned char col[4];
|
||||
float colf[4];
|
||||
float linearcol[4];
|
||||
|
||||
int z;
|
||||
float zf;
|
||||
@ -353,7 +355,7 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info)
|
||||
|
||||
if (info->draw) {
|
||||
ED_image_draw_info(scene, ar, info->color_manage, FALSE, info->channels,
|
||||
info->x, info->y, info->col, info->colf,
|
||||
info->x, info->y, info->col, info->colf, info->linearcol,
|
||||
info->zp, info->zfp);
|
||||
}
|
||||
}
|
||||
@ -469,7 +471,10 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
info->colf[2] = (float)cp[2] / 255.0f;
|
||||
info->colf[3] = (float)cp[3] / 255.0f;
|
||||
|
||||
info->color_manage = FALSE;
|
||||
copy_v4_v4(info->linearcol, info->colf);
|
||||
IMB_colormanagement_colorspace_to_scene_linear_v4(info->linearcol, false, ibuf->rect_colorspace);
|
||||
|
||||
info->color_manage = TRUE;
|
||||
}
|
||||
if (ibuf->rect_float) {
|
||||
fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "DNA_scene_types.h"
|
||||
@ -66,6 +67,7 @@ typedef struct ImageSampleInfo {
|
||||
|
||||
unsigned char col[4];
|
||||
float colf[4];
|
||||
float linearcol[4];
|
||||
|
||||
unsigned char *colp;
|
||||
float *colfp;
|
||||
@ -81,7 +83,8 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info)
|
||||
|
||||
if (info->draw) {
|
||||
ED_image_draw_info(scene, ar, info->color_manage, FALSE, info->channels,
|
||||
info->x, info->y, info->colp, info->colfp, NULL, NULL);
|
||||
info->x, info->y, info->colp, info->colfp,
|
||||
info->linearcol, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,7 +137,10 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
info->colf[3] = (float)cp[3] / 255.0f;
|
||||
info->colfp = info->colf;
|
||||
|
||||
info->color_manage = FALSE;
|
||||
copy_v4_v4(info->linearcol, info->colf);
|
||||
IMB_colormanagement_colorspace_to_scene_linear_v4(info->linearcol, false, ibuf->rect_colorspace);
|
||||
|
||||
info->color_manage = TRUE;
|
||||
}
|
||||
if (ibuf->rect_float) {
|
||||
fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
|
||||
|
@ -159,12 +159,12 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C)
|
||||
|
||||
/* ideally would return an rv3d but in some cases the region is needed too
|
||||
* so return that, the caller can then access the ar->regiondata */
|
||||
int ED_view3d_context_user_region(bContext *C, View3D **v3d_r, ARegion **ar_r)
|
||||
int ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_ar)
|
||||
{
|
||||
ScrArea *sa = CTX_wm_area(C);
|
||||
|
||||
*v3d_r = NULL;
|
||||
*ar_r = NULL;
|
||||
*r_v3d = NULL;
|
||||
*r_ar = NULL;
|
||||
|
||||
if (sa && sa->spacetype == SPACE_VIEW3D) {
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
@ -173,8 +173,8 @@ int ED_view3d_context_user_region(bContext *C, View3D **v3d_r, ARegion **ar_r)
|
||||
if (ar) {
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
if (rv3d && rv3d->viewlock == 0) {
|
||||
*v3d_r = v3d;
|
||||
*ar_r = ar;
|
||||
*r_v3d = v3d;
|
||||
*r_ar = ar;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
@ -196,14 +196,14 @@ int ED_view3d_context_user_region(bContext *C, View3D **v3d_r, ARegion **ar_r)
|
||||
|
||||
/* camera/perspective view get priority when the active region is locked */
|
||||
if (ar_unlock_user) {
|
||||
*v3d_r = v3d;
|
||||
*ar_r = ar_unlock_user;
|
||||
*r_v3d = v3d;
|
||||
*r_ar = ar_unlock_user;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ar_unlock) {
|
||||
*v3d_r = v3d;
|
||||
*ar_r = ar_unlock;
|
||||
*r_v3d = v3d;
|
||||
*r_ar = ar_unlock;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -1008,9 +1008,9 @@ void ED_view3d_calc_camera_border_size(Scene *scene, ARegion *ar, View3D *v3d, R
|
||||
}
|
||||
|
||||
void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d,
|
||||
rctf *viewborder_r, const bool no_shift)
|
||||
rctf *r_viewborder, const bool no_shift)
|
||||
{
|
||||
view3d_camera_border(scene, ar, v3d, rv3d, viewborder_r, no_shift, false);
|
||||
view3d_camera_border(scene, ar, v3d, rv3d, r_viewborder, no_shift, false);
|
||||
}
|
||||
|
||||
static void drawviewborder_grid3(float x1, float x2, float y1, float y2, float fac)
|
||||
@ -2235,7 +2235,7 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d)
|
||||
|
||||
}
|
||||
|
||||
void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *))
|
||||
void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *), bool alphaoverride)
|
||||
{
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
Base *base;
|
||||
@ -2247,7 +2247,7 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *))
|
||||
|
||||
/* Setting these temporarily is not nice */
|
||||
v3d->flag &= ~V3D_SELECT_OUTLINE;
|
||||
U.glalphaclip = 0.5; /* not that nice but means we wont zoom into billboards */
|
||||
U.glalphaclip = alphaoverride ? 0.5f : glalphaclip; /* not that nice but means we wont zoom into billboards */
|
||||
U.obcenter_dia = 0;
|
||||
|
||||
setwinmatrixview3d(ar, v3d, NULL);
|
||||
|
@ -457,7 +457,7 @@ static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *even
|
||||
|
||||
view3d_operator_needs_opengl(C); /* needed for zbuf drawing */
|
||||
|
||||
if ((vod->use_dyn_ofs = ED_view3d_autodist(CTX_data_scene(C), vod->ar, vod->v3d, event->mval, vod->dyn_ofs))) {
|
||||
if ((vod->use_dyn_ofs = ED_view3d_autodist(CTX_data_scene(C), vod->ar, vod->v3d, event->mval, vod->dyn_ofs, true))) {
|
||||
if (rv3d->is_persp) {
|
||||
float my_origin[3]; /* original G.vd->ofs */
|
||||
float my_pivot[3]; /* view */
|
||||
@ -2896,7 +2896,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
|
||||
|
||||
/* Get Z Depths, needed for perspective, nice for ortho */
|
||||
bgl_get_mats(&mats);
|
||||
draw_depth(scene, ar, v3d, NULL);
|
||||
draw_depth(scene, ar, v3d, NULL, true);
|
||||
|
||||
{
|
||||
/* avoid allocating the whole depth buffer */
|
||||
@ -3745,7 +3745,7 @@ void ED_view3d_cursor3d_position(bContext *C, float fp[3], const int mval[2])
|
||||
|
||||
if (U.uiflag & USER_ZBUF_CURSOR) { /* maybe this should be accessed some other way */
|
||||
view3d_operator_needs_opengl(C);
|
||||
if (ED_view3d_autodist(scene, ar, v3d, mval, fp))
|
||||
if (ED_view3d_autodist(scene, ar, v3d, mval, fp, true))
|
||||
depth_used = TRUE;
|
||||
}
|
||||
|
||||
@ -3917,7 +3917,7 @@ static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int marg
|
||||
}
|
||||
|
||||
/* XXX todo Zooms in on a border drawn by the user */
|
||||
int ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2], float mouse_worldloc[3])
|
||||
int ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2], float mouse_worldloc[3], bool alphaoverride)
|
||||
{
|
||||
bglMats mats; /* ZBuffer depth vars */
|
||||
float depth_close = FLT_MAX;
|
||||
@ -3925,7 +3925,7 @@ int ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2]
|
||||
|
||||
/* Get Z Depths, needed for perspective, nice for ortho */
|
||||
bgl_get_mats(&mats);
|
||||
draw_depth(scene, ar, v3d, NULL);
|
||||
draw_depth(scene, ar, v3d, NULL, alphaoverride);
|
||||
|
||||
depth_close = view_autodist_depth_margin(ar, mval, 4);
|
||||
|
||||
@ -3952,7 +3952,7 @@ int ED_view3d_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode)
|
||||
/* Get Z Depths, needed for perspective, nice for ortho */
|
||||
switch (mode) {
|
||||
case 0:
|
||||
draw_depth(scene, ar, v3d, NULL);
|
||||
draw_depth(scene, ar, v3d, NULL, true);
|
||||
break;
|
||||
case 1:
|
||||
draw_depth_gpencil(scene, ar, v3d);
|
||||
|
@ -152,7 +152,7 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
|
||||
|
||||
/* view3d_draw.c */
|
||||
void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar);
|
||||
void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (*func)(void *));
|
||||
void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (*func)(void *), bool alphaoverride);
|
||||
void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d);
|
||||
void ED_view3d_after_add(ListBase *lb, Base *base, const short dflag);
|
||||
|
||||
|
@ -1859,7 +1859,7 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[3][3],
|
||||
}
|
||||
|
||||
/* loop-in-a-loop I know, but we need it! (ton) */
|
||||
static void get_face_center(float cent_r[3], BMVert *eve)
|
||||
static void get_face_center(float r_cent[3], BMVert *eve)
|
||||
|
||||
{
|
||||
BMFace *efa;
|
||||
@ -1867,20 +1867,20 @@ static void get_face_center(float cent_r[3], BMVert *eve)
|
||||
|
||||
BM_ITER_ELEM (efa, &iter, eve, BM_FACES_OF_VERT) {
|
||||
if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
|
||||
BM_face_calc_center_mean(efa, cent_r);
|
||||
BM_face_calc_center_mean(efa, r_cent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void get_edge_center(float cent_r[3], BMVert *eve)
|
||||
static void get_edge_center(float r_cent[3], BMVert *eve)
|
||||
{
|
||||
BMEdge *eed;
|
||||
BMIter iter;
|
||||
|
||||
BM_ITER_ELEM (eed, &iter, eve, BM_EDGES_OF_VERT) {
|
||||
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
|
||||
mid_v3_v3v3(cent_r, eed->v1->co, eed->v2->co);
|
||||
mid_v3_v3v3(r_cent, eed->v1->co, eed->v2->co);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +70,8 @@ void IMB_colormanagement_transform_threaded(float *buffer, int width, int height
|
||||
void IMB_colormanagement_transform_v4(float pixel[4], const char *from_colorspace, const char *to_colorspace);
|
||||
|
||||
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], struct ColorSpace *colorspace);
|
||||
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], int predivide, struct ColorSpace *colorspace);
|
||||
|
||||
void IMB_colormanagement_scene_linear_to_colorspace_v3(float pixel[3], struct ColorSpace *colorspace);
|
||||
|
||||
void IMB_colormanagement_colorspace_to_scene_linear(float *buffer, int width, int height, int channels, struct ColorSpace *colorspace, int predivide);
|
||||
|
@ -179,7 +179,6 @@ typedef struct ImBuf {
|
||||
* Note that the lower 11 bits is used for storing custom flags
|
||||
*/
|
||||
#define IB_CUSTOM_FLAGS_MASK 0x7ff
|
||||
#define IB_ALPHA_MASK 0xff
|
||||
|
||||
#define PNG (1 << 30)
|
||||
#define TGA (1 << 28)
|
||||
|
@ -1583,6 +1583,26 @@ void IMB_colormanagement_scene_linear_to_colorspace_v3(float pixel[3], ColorSpac
|
||||
OCIO_processorApplyRGB(processor, pixel);
|
||||
}
|
||||
|
||||
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], int predivide, ColorSpace *colorspace)
|
||||
{
|
||||
OCIO_ConstProcessorRcPtr *processor;
|
||||
|
||||
if (!colorspace) {
|
||||
/* should never happen */
|
||||
printf("%s: perform conversion from unknown color space\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
processor = colorspace_to_scene_linear_processor(colorspace);
|
||||
|
||||
if (processor) {
|
||||
if (predivide)
|
||||
OCIO_processorApplyRGBA_predivide(processor, pixel);
|
||||
else
|
||||
OCIO_processorApplyRGBA(processor, pixel);
|
||||
}
|
||||
}
|
||||
|
||||
void IMB_colormanagement_colorspace_to_scene_linear(float *buffer, int width, int height, int channels, struct ColorSpace *colorspace, int predivide)
|
||||
{
|
||||
OCIO_ConstProcessorRcPtr *processor;
|
||||
|
@ -517,7 +517,7 @@ void IMB_rectblend(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx,
|
||||
dr = drect;
|
||||
sr = srect;
|
||||
for (x = width; x > 0; x--, dr++, sr++) {
|
||||
if (*sr & IB_ALPHA_MASK)
|
||||
if (((char *)sr)[3])
|
||||
func((char *)dr, (char *)dr, (char *)sr, ((char *)sr)[3]);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ typedef struct IDProperty {
|
||||
/* 2 characters for ID code and 64 for actual name */
|
||||
#define MAX_ID_NAME 66
|
||||
|
||||
/* There's a nasty circular dependency here.... void* to the rescue! I
|
||||
/* There's a nasty circular dependency here.... 'void *' to the rescue! I
|
||||
* really wonder why this is needed. */
|
||||
typedef struct ID {
|
||||
void *next, *prev;
|
||||
|
@ -646,7 +646,7 @@ static FCM_EnvelopeData *rna_FModifierEnvelope_points_add(FModifier *fmod, Repor
|
||||
fed.f1 = fed.f2 = 0;
|
||||
|
||||
if (env->data) {
|
||||
short exists = -1;
|
||||
bool exists;
|
||||
i = BKE_fcm_envelope_find_index(env->data, frame, env->totvert, &exists);
|
||||
if (exists) {
|
||||
BKE_reportf(reports, RPT_ERROR, "Already a control point at frame %.6f", frame);
|
||||
|
@ -528,7 +528,7 @@ static void rna_CustomDataLayer_active_set(PointerRNA *ptr, CustomData *data, in
|
||||
else CustomData_set_layer_active(ldata, CD_MLOOPUV, n);
|
||||
}
|
||||
|
||||
mesh_update_customdata_pointers(me, TRUE);
|
||||
BKE_mesh_update_customdata_pointers(me, true);
|
||||
}
|
||||
|
||||
static void rna_CustomDataLayer_clone_set(PointerRNA *ptr, CustomData *data, int value, int type, int render)
|
||||
|
@ -110,7 +110,7 @@
|
||||
CustomData *ldata = rna_mesh_ldata_helper(me); \
|
||||
CustomData_set_layer_##active_type(ldata, CD_MLOOPUV, a); \
|
||||
} \
|
||||
mesh_update_customdata_pointers(me, TRUE); \
|
||||
BKE_mesh_update_customdata_pointers(me, true); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
@ -139,7 +139,7 @@
|
||||
CustomData *ldata = rna_mesh_ldata_helper(me); \
|
||||
CustomData_set_layer_##active_type(ldata, CD_MLOOPUV, value); \
|
||||
} \
|
||||
mesh_update_customdata_pointers(me, TRUE); \
|
||||
BKE_mesh_update_customdata_pointers(me, true); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
|
||||
|
||||
#define SUBTYPE(socktype, stypename, id, idname) \
|
||||
{ \
|
||||
bNodeSocketValue##stypename * value = (bNodeSocketValue##stypename *)sock->default_value; \
|
||||
bNodeSocketValue##stypename *value = (bNodeSocketValue##stypename *)sock->default_value; \
|
||||
if (value->subtype == PROP_##id) \
|
||||
return &RNA_NodeSocket##stypename##idname; \
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value)
|
||||
}
|
||||
}
|
||||
else if (ob->type == OB_MESH) {
|
||||
set_mesh(ob, (Mesh *)id);
|
||||
BKE_mesh_assign_object(ob, (Mesh *)id);
|
||||
}
|
||||
else {
|
||||
if (ob->data) {
|
||||
|
@ -1785,7 +1785,7 @@ static DerivedMesh *base_skin(DerivedMesh *origdm,
|
||||
totvert = origdm->getNumVerts(origdm);
|
||||
totedge = origdm->getNumEdges(origdm);
|
||||
|
||||
create_vert_edge_map(&emap, &emapmem, medge, totvert, totedge);
|
||||
BKE_mesh_vert_edge_map_create(&emap, &emapmem, medge, totvert, totedge);
|
||||
|
||||
emat = build_edge_mats(nodes, mvert, totvert, medge, emap, totedge);
|
||||
skin_nodes = build_frames(mvert, totvert, nodes, emap, emat);
|
||||
|
@ -393,7 +393,8 @@ static int node_animation_properties(bNodeTree *ntree, bNode *node)
|
||||
lb = RNA_struct_type_properties(ptr.type);
|
||||
|
||||
for (link = lb->first; link; link = link->next) {
|
||||
int driven, len = 1, index;
|
||||
int len = 1, index;
|
||||
bool driven;
|
||||
prop = (PropertyRNA *)link;
|
||||
|
||||
if (RNA_property_array_check(prop))
|
||||
@ -409,7 +410,8 @@ static int node_animation_properties(bNodeTree *ntree, bNode *node)
|
||||
|
||||
/* now check node sockets */
|
||||
for (sock = node->inputs.first; sock; sock = sock->next) {
|
||||
int driven, len = 1, index;
|
||||
int len = 1, index;
|
||||
bool driven;
|
||||
|
||||
RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &ptr);
|
||||
prop = RNA_struct_find_property(&ptr, "default_value");
|
||||
|
@ -81,7 +81,7 @@ void bpy_import_init(PyObject *builtins)
|
||||
|
||||
/* move reload here
|
||||
* XXX, use import hooks */
|
||||
mod = PyImport_ImportModuleLevel((char *)"imp", NULL, NULL, NULL, 0);
|
||||
mod = PyImport_ImportModuleLevel("imp", NULL, NULL, NULL, 0);
|
||||
if (mod) {
|
||||
PyObject *mod_dict = PyModule_GetDict(mod);
|
||||
|
||||
|
@ -226,7 +226,7 @@ static PyMethodDef meth_bpy_resource_path =
|
||||
|
||||
static PyObject *bpy_import_test(const char *modname)
|
||||
{
|
||||
PyObject *mod = PyImport_ImportModuleLevel((char *)modname, NULL, NULL, NULL, 0);
|
||||
PyObject *mod = PyImport_ImportModuleLevel(modname, NULL, NULL, NULL, 0);
|
||||
if (mod) {
|
||||
Py_DECREF(mod);
|
||||
}
|
||||
|
@ -75,14 +75,14 @@ int bpy_pydriver_create_dict(void)
|
||||
}
|
||||
|
||||
/* add bpy to global namespace */
|
||||
mod = PyImport_ImportModuleLevel((char *)"bpy", NULL, NULL, NULL, 0);
|
||||
mod = PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0);
|
||||
if (mod) {
|
||||
PyDict_SetItemString(bpy_pydriver_Dict, "bpy", mod);
|
||||
Py_DECREF(mod);
|
||||
}
|
||||
|
||||
/* add noise to global namespace */
|
||||
mod = PyImport_ImportModuleLevel((char *)"mathutils", NULL, NULL, NULL, 0);
|
||||
mod = PyImport_ImportModuleLevel("mathutils", NULL, NULL, NULL, 0);
|
||||
if (mod) {
|
||||
PyObject *modsub = PyDict_GetItemString(PyModule_GetDict(mod), "noise");
|
||||
PyDict_SetItemString(bpy_pydriver_Dict, "noise", modsub);
|
||||
|
@ -57,7 +57,7 @@ static void atexit_func_call(const char *func_name, PyObject *atexit_func_arg)
|
||||
* this is intended, but if its problematic it could be changed
|
||||
* - campbell */
|
||||
|
||||
PyObject *atexit_mod = PyImport_ImportModuleLevel((char *)"atexit", NULL, NULL, NULL, 0);
|
||||
PyObject *atexit_mod = PyImport_ImportModuleLevel("atexit", NULL, NULL, NULL, 0);
|
||||
PyObject *atexit_func = PyObject_GetAttrString(atexit_mod, func_name);
|
||||
PyObject *args = PyTuple_New(1);
|
||||
PyObject *ret;
|
||||
|
@ -6118,7 +6118,7 @@ static PyObject *pyrna_srna_ExternalType(StructRNA *srna)
|
||||
PyObject *newclass;
|
||||
|
||||
if (bpy_types_dict == NULL) {
|
||||
PyObject *bpy_types = PyImport_ImportModuleLevel((char *)"bpy_types", NULL, NULL, NULL, 0);
|
||||
PyObject *bpy_types = PyImport_ImportModuleLevel("bpy_types", NULL, NULL, NULL, 0);
|
||||
|
||||
if (bpy_types == NULL) {
|
||||
PyErr_Print();
|
||||
|
@ -870,16 +870,16 @@ PyMODINIT_FUNC PyInit_mathutils_noise_types(void)
|
||||
{
|
||||
PyObject *submodule = PyModule_Create(&M_NoiseTypes_module_def);
|
||||
|
||||
PyModule_AddIntConstant(submodule, (char *)"BLENDER", TEX_BLENDER);
|
||||
PyModule_AddIntConstant(submodule, (char *)"STDPERLIN", TEX_STDPERLIN);
|
||||
PyModule_AddIntConstant(submodule, (char *)"NEWPERLIN", TEX_NEWPERLIN);
|
||||
PyModule_AddIntConstant(submodule, (char *)"VORONOI_F1", TEX_VORONOI_F1);
|
||||
PyModule_AddIntConstant(submodule, (char *)"VORONOI_F2", TEX_VORONOI_F2);
|
||||
PyModule_AddIntConstant(submodule, (char *)"VORONOI_F3", TEX_VORONOI_F3);
|
||||
PyModule_AddIntConstant(submodule, (char *)"VORONOI_F4", TEX_VORONOI_F4);
|
||||
PyModule_AddIntConstant(submodule, (char *)"VORONOI_F2F1", TEX_VORONOI_F2F1);
|
||||
PyModule_AddIntConstant(submodule, (char *)"VORONOI_CRACKLE", TEX_VORONOI_CRACKLE);
|
||||
PyModule_AddIntConstant(submodule, (char *)"CELLNOISE", TEX_CELLNOISE);
|
||||
PyModule_AddIntConstant(submodule, "BLENDER", TEX_BLENDER);
|
||||
PyModule_AddIntConstant(submodule, "STDPERLIN", TEX_STDPERLIN);
|
||||
PyModule_AddIntConstant(submodule, "NEWPERLIN", TEX_NEWPERLIN);
|
||||
PyModule_AddIntConstant(submodule, "VORONOI_F1", TEX_VORONOI_F1);
|
||||
PyModule_AddIntConstant(submodule, "VORONOI_F2", TEX_VORONOI_F2);
|
||||
PyModule_AddIntConstant(submodule, "VORONOI_F3", TEX_VORONOI_F3);
|
||||
PyModule_AddIntConstant(submodule, "VORONOI_F4", TEX_VORONOI_F4);
|
||||
PyModule_AddIntConstant(submodule, "VORONOI_F2F1", TEX_VORONOI_F2F1);
|
||||
PyModule_AddIntConstant(submodule, "VORONOI_CRACKLE", TEX_VORONOI_CRACKLE);
|
||||
PyModule_AddIntConstant(submodule, "CELLNOISE", TEX_CELLNOISE);
|
||||
|
||||
return submodule;
|
||||
}
|
||||
@ -900,13 +900,13 @@ PyMODINIT_FUNC PyInit_mathutils_noise_metrics(void)
|
||||
{
|
||||
PyObject *submodule = PyModule_Create(&M_NoiseMetrics_module_def);
|
||||
|
||||
PyModule_AddIntConstant(submodule, (char *)"DISTANCE", TEX_DISTANCE);
|
||||
PyModule_AddIntConstant(submodule, (char *)"DISTANCE_SQUARED", TEX_DISTANCE_SQUARED);
|
||||
PyModule_AddIntConstant(submodule, (char *)"MANHATTAN", TEX_MANHATTAN);
|
||||
PyModule_AddIntConstant(submodule, (char *)"CHEBYCHEV", TEX_CHEBYCHEV);
|
||||
PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY_HALF", TEX_MINKOVSKY_HALF);
|
||||
PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY_FOUR", TEX_MINKOVSKY_FOUR);
|
||||
PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY", TEX_MINKOVSKY);
|
||||
PyModule_AddIntConstant(submodule, "DISTANCE", TEX_DISTANCE);
|
||||
PyModule_AddIntConstant(submodule, "DISTANCE_SQUARED", TEX_DISTANCE_SQUARED);
|
||||
PyModule_AddIntConstant(submodule, "MANHATTAN", TEX_MANHATTAN);
|
||||
PyModule_AddIntConstant(submodule, "CHEBYCHEV", TEX_CHEBYCHEV);
|
||||
PyModule_AddIntConstant(submodule, "MINKOVSKY_HALF", TEX_MINKOVSKY_HALF);
|
||||
PyModule_AddIntConstant(submodule, "MINKOVSKY_FOUR", TEX_MINKOVSKY_FOUR);
|
||||
PyModule_AddIntConstant(submodule, "MINKOVSKY", TEX_MINKOVSKY);
|
||||
|
||||
return submodule;
|
||||
}
|
||||
|
@ -295,8 +295,8 @@ static OSStatus AudioConverterInputCallback(AudioConverterRef inAudioConverter,
|
||||
|
||||
qtexport->audioTotalExportedFrames += *ioNumberDataPackets;
|
||||
|
||||
AUD_readDevice(qtexport->audioInputDevice, (UInt8*)qtexport->audioInputBuffer,
|
||||
qtexport->audioInputFormat.mFramesPerPacket * *ioNumberDataPackets);
|
||||
AUD_readDevice(qtexport->audioInputDevice, (UInt8 *)qtexport->audioInputBuffer,
|
||||
qtexport->audioInputFormat.mFramesPerPacket * *ioNumberDataPackets);
|
||||
|
||||
ioData->mBuffers[0].mDataByteSize = qtexport->audioInputFormat.mBytesPerPacket * *ioNumberDataPackets;
|
||||
ioData->mBuffers[0].mData = qtexport->audioInputBuffer;
|
||||
@ -357,7 +357,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
|
||||
|
||||
tmpnam(name);
|
||||
strcat(name, extension);
|
||||
outputFileURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,(UInt8*) name, strlen(name), false);
|
||||
outputFileURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,(UInt8 *)name, strlen(name), false);
|
||||
|
||||
if (outputFileURL) {
|
||||
|
||||
|
@ -103,12 +103,12 @@ int RE_rayobjectcontrol_test_break(RayObjectControl *c);
|
||||
#define RE_rayobject_isVlakPrimitive(o) ((((intptr_t)o)&3) == 3)
|
||||
|
||||
/* used to align a given ray object */
|
||||
#define RE_rayobject_align(o) ((RayObject*)(((intptr_t)o)&(~3)))
|
||||
#define RE_rayobject_align(o) ((RayObject *)(((intptr_t)o)&(~3)))
|
||||
|
||||
/* used to unalign a given ray object */
|
||||
#define RE_rayobject_unalignRayFace(o) ((RayObject*)(((intptr_t)o)|1))
|
||||
#define RE_rayobject_unalignRayAPI(o) ((RayObject*)(((intptr_t)o)|2))
|
||||
#define RE_rayobject_unalignVlakPrimitive(o) ((RayObject*)(((intptr_t)o)|3))
|
||||
#define RE_rayobject_unalignRayFace(o) ((RayObject *)(((intptr_t)o)|1))
|
||||
#define RE_rayobject_unalignRayAPI(o) ((RayObject *)(((intptr_t)o)|2))
|
||||
#define RE_rayobject_unalignVlakPrimitive(o) ((RayObject *)(((intptr_t)o)|3))
|
||||
|
||||
/*
|
||||
* This rayobject represents a generic object. With it's own callbacks for raytrace operations.
|
||||
|
@ -1500,7 +1500,7 @@ static void tag_scenes_for_render(Render *re)
|
||||
if (node->id) {
|
||||
if (!MAIN_VERSION_ATLEAST(re->main, 265, 5)) {
|
||||
if (rlayer_node_uses_alpha(re->scene->nodetree, node)) {
|
||||
Scene *scene = (Scene*) node->id;
|
||||
Scene *scene = (Scene *)node->id;
|
||||
|
||||
if (scene->r.alphamode != R_ALPHAPREMUL) {
|
||||
BKE_reportf(re->reports, RPT_WARNING, "Setting scene %s alpha mode to Premul", scene->id.name + 2);
|
||||
|
@ -938,7 +938,7 @@ HaloRen *RE_findOrAddHalo(ObjectRen *obr, int nr)
|
||||
// TABLEINITSIZE, obr->blohalen+TABLEINITSIZE );
|
||||
temp=obr->bloha;
|
||||
|
||||
obr->bloha = (HaloRen**)MEM_callocN(sizeof(void *) * (obr->blohalen + TABLEINITSIZE), "Bloha");
|
||||
obr->bloha = (HaloRen **)MEM_callocN(sizeof(void *) * (obr->blohalen + TABLEINITSIZE), "Bloha");
|
||||
if (temp) memcpy(obr->bloha, temp, obr->blohalen*sizeof(void *));
|
||||
memset(&(obr->bloha[obr->blohalen]), 0, TABLEINITSIZE * sizeof(void *));
|
||||
obr->blohalen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/
|
||||
|
@ -2830,7 +2830,8 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
return OPERATOR_FINISHED; /* use finish or we don't get an undo */
|
||||
}
|
||||
}
|
||||
// /* Allow view navigation??? */
|
||||
/* Allow view navigation??? */
|
||||
/* note, this gives issues: 1) other modal ops run on top (border select), 2) middlemouse is used now 3) tablet/trackpad? */
|
||||
// else {
|
||||
// return OPERATOR_PASS_THROUGH;
|
||||
// }
|
||||
|
@ -504,8 +504,8 @@ void WM_operator_properties_free(struct PointerRNA *ptr) {}
|
||||
void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring) {}
|
||||
void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot) {}
|
||||
void WM_operator_properties_sanitize(struct PointerRNA *ptr, const short no_context) {};
|
||||
void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType*, void*), void *userdata) {}
|
||||
void WM_operatortype_append_macro_ptr(void (*opfunc)(struct wmOperatorType*, void*), void *userdata) {}
|
||||
void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType*, void *), void *userdata) {}
|
||||
void WM_operatortype_append_macro_ptr(void (*opfunc)(struct wmOperatorType*, void *), void *userdata) {}
|
||||
void WM_operator_bl_idname(char *to, const char *from) {}
|
||||
void WM_operator_py_idname(char *to, const char *from) {}
|
||||
void WM_operator_ui_popup(struct bContext *C, struct wmOperator *op, int width, int height) {}
|
||||
|
@ -130,10 +130,10 @@ void BL_ArmatureConstraint::ReParent(BL_ArmatureObject* armature)
|
||||
m_constraint = NULL;
|
||||
m_posechannel = NULL;
|
||||
// and locate the constraint
|
||||
for (pchan = (bPoseChannel*)newpose->chanbase.first; pchan; pchan=(bPoseChannel*)pchan->next) {
|
||||
for (pchan = (bPoseChannel*)newpose->chanbase.first; pchan; pchan = (bPoseChannel*)pchan->next) {
|
||||
if (!strcmp(pchan->name, posechannel)) {
|
||||
// now locate the constraint
|
||||
for (pcon = (bConstraint*)pchan->constraints.first; pcon; pcon=(bConstraint*)pcon->next) {
|
||||
for (pcon = (bConstraint *)pchan->constraints.first; pcon; pcon = (bConstraint *)pcon->next) {
|
||||
if (!strcmp(pcon->name, constraint)) {
|
||||
m_constraint = pcon;
|
||||
m_posechannel = pchan;
|
||||
|
@ -100,14 +100,14 @@ void game_copy_pose(bPose **dst, bPose *src, int copy_constraint)
|
||||
/* remap pointers */
|
||||
ghash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "game_copy_pose gh");
|
||||
|
||||
pchan= (bPoseChannel*)src->chanbase.first;
|
||||
outpchan= (bPoseChannel*)out->chanbase.first;
|
||||
pchan= (bPoseChannel *)src->chanbase.first;
|
||||
outpchan= (bPoseChannel *)out->chanbase.first;
|
||||
for (; pchan; pchan=pchan->next, outpchan=outpchan->next)
|
||||
BLI_ghash_insert(ghash, pchan, outpchan);
|
||||
|
||||
for (pchan = (bPoseChannel*)out->chanbase.first; pchan; pchan = pchan->next) {
|
||||
pchan->parent= (bPoseChannel*)BLI_ghash_lookup(ghash, pchan->parent);
|
||||
pchan->child= (bPoseChannel*)BLI_ghash_lookup(ghash, pchan->child);
|
||||
for (pchan = (bPoseChannel *)out->chanbase.first; pchan; pchan = pchan->next) {
|
||||
pchan->parent= (bPoseChannel *)BLI_ghash_lookup(ghash, pchan->parent);
|
||||
pchan->child= (bPoseChannel *)BLI_ghash_lookup(ghash, pchan->child);
|
||||
|
||||
if (copy_constraint) {
|
||||
ListBase listb;
|
||||
@ -158,8 +158,8 @@ void game_blend_poses(bPose *dst, bPose *src, float srcweight/*, short mode*/)
|
||||
dstweight = 1.0F;
|
||||
}
|
||||
|
||||
schan= (bPoseChannel*)src->chanbase.first;
|
||||
for (dchan = (bPoseChannel*)dst->chanbase.first; dchan; dchan=(bPoseChannel*)dchan->next, schan= (bPoseChannel*)schan->next) {
|
||||
schan= (bPoseChannel *)src->chanbase.first;
|
||||
for (dchan = (bPoseChannel *)dst->chanbase.first; dchan; dchan=(bPoseChannel *)dchan->next, schan= (bPoseChannel *)schan->next) {
|
||||
// always blend on all channels since we don't know which one has been set
|
||||
/* quat interpolation done separate */
|
||||
if (schan->rotmode == ROT_MODE_QUAT) {
|
||||
@ -376,7 +376,7 @@ void BL_ArmatureObject::LoadChannels()
|
||||
BL_ArmatureChannel* proxy;
|
||||
|
||||
m_channelNumber = 0;
|
||||
for (pchan = (bPoseChannel*)m_pose->chanbase.first; pchan; pchan=(bPoseChannel*)pchan->next) {
|
||||
for (pchan = (bPoseChannel *)m_pose->chanbase.first; pchan; pchan=(bPoseChannel *)pchan->next) {
|
||||
proxy = new BL_ArmatureChannel(this, pchan);
|
||||
m_poseChannels.AddBack(proxy);
|
||||
m_channelNumber++;
|
||||
|
@ -2140,7 +2140,7 @@ static void UNUSED_FUNCTION(RBJconstraints)(Object *ob)//not used
|
||||
conlist = get_active_constraints2(ob);
|
||||
|
||||
if (conlist) {
|
||||
for (curcon = (bConstraint *)conlist->first; curcon; curcon=(bConstraint *)curcon->next) {
|
||||
for (curcon = (bConstraint *)conlist->first; curcon; curcon = (bConstraint *)curcon->next) {
|
||||
|
||||
printf("%i\n",curcon->type);
|
||||
}
|
||||
@ -2785,7 +2785,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
|
||||
continue;
|
||||
|
||||
if (conlist) {
|
||||
for (curcon = (bConstraint *)conlist->first; curcon; curcon=(bConstraint *)curcon->next) {
|
||||
for (curcon = (bConstraint *)conlist->first; curcon; curcon = (bConstraint *)curcon->next) {
|
||||
if (curcon->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) {
|
||||
|
||||
bRigidBodyJointConstraint *dat=(bRigidBodyJointConstraint *)curcon->data;
|
||||
|
@ -94,7 +94,7 @@ bool BL_DeformableGameObject::GetShape(vector<float> &shape)
|
||||
if (key && key->type==KEY_RELATIVE)
|
||||
{
|
||||
KeyBlock *kb;
|
||||
for (kb = (KeyBlock*)key->block.first; kb; kb = (KeyBlock*)kb->next)
|
||||
for (kb = (KeyBlock *)key->block.first; kb; kb = (KeyBlock *)kb->next)
|
||||
{
|
||||
shape.push_back(kb->curval);
|
||||
}
|
||||
|
@ -176,9 +176,9 @@ void BL_ShapeActionActuator::BlendShape(Key* key, float srcweight)
|
||||
|
||||
dstweight = 1.0F - srcweight;
|
||||
|
||||
for (it=m_blendshape.begin(), kb = (KeyBlock*)key->block.first;
|
||||
for (it=m_blendshape.begin(), kb = (KeyBlock *)key->block.first;
|
||||
kb && it != m_blendshape.end();
|
||||
kb = (KeyBlock*)kb->next, it++)
|
||||
kb = (KeyBlock *)kb->next, it++)
|
||||
{
|
||||
kb->curval = kb->curval * dstweight + (*it) * srcweight;
|
||||
}
|
||||
@ -439,7 +439,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame)
|
||||
KeyBlock *kb;
|
||||
// We go through and clear out the keyblocks so there isn't any interference
|
||||
// from other shape actions
|
||||
for (kb=(KeyBlock*)key->block.first; kb; kb=(KeyBlock*)kb->next)
|
||||
for (kb=(KeyBlock *)key->block.first; kb; kb=(KeyBlock *)kb->next)
|
||||
kb->curval = 0.f;
|
||||
|
||||
animsys_evaluate_action(m_idptr, m_action, NULL, m_localtime);
|
||||
|
@ -1050,12 +1050,12 @@ KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFileMemory(void *data, int
|
||||
return LinkBlendFile(bpy_openlib, path, group, scene_merge, err_str, options);
|
||||
}
|
||||
|
||||
KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFilePath(const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options)
|
||||
KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFilePath(const char *filepath, char *group, KX_Scene *scene_merge, char **err_str, short options)
|
||||
{
|
||||
BlendHandle *bpy_openlib = BLO_blendhandle_from_file((char *)path, NULL);
|
||||
BlendHandle *bpy_openlib = BLO_blendhandle_from_file(filepath, NULL);
|
||||
|
||||
// Error checking is done in LinkBlendFile
|
||||
return LinkBlendFile(bpy_openlib, path, group, scene_merge, err_str, options);
|
||||
return LinkBlendFile(bpy_openlib, filepath, group, scene_merge, err_str, options);
|
||||
}
|
||||
|
||||
static void load_datablocks(Main *main_newlib, BlendHandle *bpy_openlib, const char *path, int idcode)
|
||||
|
@ -270,7 +270,7 @@ void SCA_PythonController::ErrorPrint(const char *error_msg)
|
||||
* their user count. Not to mention holding references to wrapped data.
|
||||
* This is especially bad when the PyObject for the wrapped data is freed, after blender
|
||||
* has already dealocated the pointer */
|
||||
PySys_SetObject( (char *)"last_traceback", NULL);
|
||||
PySys_SetObject("last_traceback", NULL);
|
||||
PyErr_Clear(); /* just to be sure */
|
||||
}
|
||||
|
||||
|
@ -155,14 +155,14 @@ bool GPC_Engine::Start(const char *filename)
|
||||
}
|
||||
|
||||
|
||||
bool GPC_Engine::Start(unsigned char *blenderDataBuffer,
|
||||
unsigned int blenderDataBufferSize)
|
||||
bool GPC_Engine::Start(const void *blenderDataBuffer,
|
||||
unsigned int blenderDataBufferSize)
|
||||
{
|
||||
ReportList reports;
|
||||
BlendFileData *bfd;
|
||||
|
||||
BKE_reports_init(&reports, RPT_STORE);
|
||||
bfd= BLO_read_from_memory(blenderDataBuffer, blenderDataBufferSize, &reports);
|
||||
bfd = BLO_read_from_memory(blenderDataBuffer, blenderDataBufferSize, &reports);
|
||||
BKE_reports_clear(&reports);
|
||||
|
||||
if (!bfd) {
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
// different prototypes for Unix and Windows
|
||||
void StartLoadingAnimation();
|
||||
bool Start(const char *filename); // file-on-disk starter
|
||||
bool Start(unsigned char *blenderDataBuffer,
|
||||
bool Start(const void *blenderDataBuffer,
|
||||
unsigned int blenderDataBufferSize); // file-in-memory starter
|
||||
|
||||
void Stop();
|
||||
|
@ -239,7 +239,7 @@ bool BL_Action::Play(const char* name,
|
||||
// Now that we have the previous blend shape saved, we can clear out the key to avoid any
|
||||
// further interference.
|
||||
KeyBlock *kb;
|
||||
for (kb=(KeyBlock*)shape_deformer->GetKey()->block.first; kb; kb=(KeyBlock*)kb->next)
|
||||
for (kb=(KeyBlock *)shape_deformer->GetKey()->block.first; kb; kb=(KeyBlock *)kb->next)
|
||||
kb->curval = 0.f;
|
||||
}
|
||||
}
|
||||
@ -358,9 +358,9 @@ void BL_Action::BlendShape(Key* key, float srcweight, std::vector<float>& blends
|
||||
|
||||
dstweight = 1.0F - srcweight;
|
||||
//printf("Dst: %f\tSrc: %f\n", srcweight, dstweight);
|
||||
for (it=blendshape.begin(), kb = (KeyBlock*)key->block.first;
|
||||
for (it=blendshape.begin(), kb = (KeyBlock *)key->block.first;
|
||||
kb && it != blendshape.end();
|
||||
kb = (KeyBlock*)kb->next, it++)
|
||||
kb = (KeyBlock *)kb->next, it++)
|
||||
{
|
||||
//printf("OirgKeys: %f\t%f\n", kb->curval, (*it));
|
||||
kb->curval = kb->curval * dstweight + (*it) * srcweight;
|
||||
@ -478,7 +478,7 @@ void BL_Action::Update(float curtime)
|
||||
// We go through and clear out the keyblocks so there isn't any interference
|
||||
// from other shape actions
|
||||
KeyBlock *kb;
|
||||
for (kb=(KeyBlock*)key->block.first; kb; kb=(KeyBlock*)kb->next)
|
||||
for (kb=(KeyBlock *)key->block.first; kb; kb=(KeyBlock *)kb->next)
|
||||
kb->curval = 0.f;
|
||||
|
||||
// Now blend the shape
|
||||
|
@ -80,7 +80,7 @@ void KX_ArmatureSensor::FindConstraint()
|
||||
for (pchan = (bPoseChannel*)pose->chanbase.first; pchan; pchan=(bPoseChannel*)pchan->next) {
|
||||
if (!strcmp(pchan->name, m_posechannel)) {
|
||||
// now locate the constraint
|
||||
for (pcon = (bConstraint*)pchan->constraints.first; pcon; pcon=(bConstraint*)pcon->next) {
|
||||
for (pcon = (bConstraint *)pchan->constraints.first; pcon; pcon = (bConstraint *)pcon->next) {
|
||||
if (!strcmp(pcon->name, m_constraintname)) {
|
||||
if (pcon->flag & CONSTRAINT_DISABLE)
|
||||
/* this constraint is not valid, can't use it */
|
||||
|
@ -154,7 +154,7 @@ bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingI
|
||||
{
|
||||
PyErr_Print();
|
||||
PyErr_Clear();
|
||||
PySys_SetObject( (char *)"last_traceback", NULL);
|
||||
PySys_SetObject("last_traceback", NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1929,14 +1929,14 @@ PyObject *initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
|
||||
|
||||
/* mathutils types are used by the BGE even if we don't import them */
|
||||
{
|
||||
PyObject *mod= PyImport_ImportModuleLevel((char *)"mathutils", NULL, NULL, NULL, 0);
|
||||
PyObject *mod = PyImport_ImportModuleLevel("mathutils", NULL, NULL, NULL, 0);
|
||||
Py_DECREF(mod);
|
||||
}
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
/* accessing a SoundActuator's sound results in a crash if aud is not initialized... */
|
||||
{
|
||||
PyObject *mod= PyImport_ImportModuleLevel((char *)"aud", NULL, NULL, NULL, 0);
|
||||
PyObject *mod = PyImport_ImportModuleLevel("aud", NULL, NULL, NULL, 0);
|
||||
Py_DECREF(mod);
|
||||
}
|
||||
#endif
|
||||
@ -1993,7 +1993,7 @@ PyObject *initGamePythonScripting(const STR_String& progname, TPythonSecurityLev
|
||||
#ifdef WITH_AUDASPACE
|
||||
/* accessing a SoundActuator's sound results in a crash if aud is not initialized... */
|
||||
{
|
||||
PyObject *mod= PyImport_ImportModuleLevel((char *)"aud", NULL, NULL, NULL, 0);
|
||||
PyObject *mod= PyImport_ImportModuleLevel("aud", NULL, NULL, NULL, 0);
|
||||
Py_DECREF(mod);
|
||||
}
|
||||
#endif
|
||||
|
@ -172,9 +172,9 @@ void initPyTypes(void)
|
||||
*/
|
||||
|
||||
/* For now just do PyType_Ready */
|
||||
PyObject *mod= PyModule_New("GameTypes");
|
||||
PyObject *dict= PyModule_GetDict(mod);
|
||||
PyDict_SetItemString(PySys_GetObject((char *)"modules"), (char *)"GameTypes", mod);
|
||||
PyObject *mod = PyModule_New("GameTypes");
|
||||
PyObject *dict = PyModule_GetDict(mod);
|
||||
PyDict_SetItemString(PySys_GetObject("modules"), "GameTypes", mod);
|
||||
Py_DECREF(mod);
|
||||
|
||||
|
||||
|
@ -115,7 +115,7 @@ RAS_MeshObject::RAS_MeshObject(Mesh* mesh)
|
||||
int count=0;
|
||||
// initialize weight cache for shape objects
|
||||
// count how many keys in this mesh
|
||||
for (kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next)
|
||||
for (kb= (KeyBlock *)m_mesh->key->block.first; kb; kb= (KeyBlock *)kb->next)
|
||||
count++;
|
||||
m_cacheWeightIndex.resize(count,-1);
|
||||
}
|
||||
@ -129,7 +129,7 @@ RAS_MeshObject::~RAS_MeshObject()
|
||||
{
|
||||
KeyBlock *kb;
|
||||
// remove the weight cache to avoid memory leak
|
||||
for (kb= (KeyBlock*)m_mesh->key->block.first; kb; kb= (KeyBlock*)kb->next) {
|
||||
for (kb = (KeyBlock *)m_mesh->key->block.first; kb; kb = (KeyBlock *)kb->next) {
|
||||
if (kb->weights)
|
||||
MEM_freeN(kb->weights);
|
||||
kb->weights= NULL;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user