diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-05-12 02:48:41 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-05-12 02:48:41 +0400 |
commit | 8925ed1420ea2557abc7867cf12f89730ef77718 (patch) | |
tree | 67a95fd12253de438e1bdb30bf6c90af2ff12d7f /source/blender/freestyle/intern | |
parent | bf2fac79d407a1d8c0e5727cc644d98eef60a965 (diff) | |
parent | 1c0c2f4d0bd6556a3dd7293ddbd419a066e745f4 (diff) |
Merged changes in the trunk up to revision 46557.
Conflicts resolved:
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/makesrna/intern/rna_scene.c
Additional changes:
* Fix for recent changes of BKE_* function renaming.
* Fix for an "attempt to free NULL pointer" in BlenderStrokeRenderer::RenderStrokeRepBasic().
Diffstat (limited to 'source/blender/freestyle/intern')
4 files changed, 28 insertions, 28 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index adb46d857ba..f8c87fd0029 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -47,7 +47,7 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render* re, int render_count) char name[22]; snprintf(name, sizeof(name), "FRS%d_%s", render_count, re->scene->id.name+2); - freestyle_scene = add_scene(name); + freestyle_scene = BKE_scene_add(name); freestyle_scene->r.cfra = old_scene->r.cfra; freestyle_scene->r.mode= old_scene->r.mode & ~( R_EDGE_FRS | R_SHADOW | R_SSS | R_PANORAMA | R_ENVMAP | R_MBLUR | R_BORDER ); @@ -80,10 +80,10 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render* re, int render_count) BLI_strncpy(freestyle_scene->r.engine, old_scene->r.engine, sizeof(freestyle_scene->r.engine)); freestyle_scene->r.im_format.planes = R_IMF_PLANES_RGBA; freestyle_scene->r.im_format.imtype = R_IMF_IMTYPE_PNG; - set_scene_bg( G.main, freestyle_scene ); + BKE_scene_set_background( G.main, freestyle_scene ); // Camera - Object* object_camera = add_object(freestyle_scene, OB_CAMERA); + Object* object_camera = BKE_object_add(freestyle_scene, OB_CAMERA); Camera* camera = (Camera *) object_camera->data; camera->type = CAM_ORTHO; @@ -104,7 +104,7 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render* re, int render_count) freestyle_scene->camera = object_camera; // Material - material = add_material("stroke_material"); + material = BKE_material_add("stroke_material"); material->mode |= MA_VERTEXCOLP; material->mode |= MA_TRANSP; material->mode |= MA_SHLESS; @@ -134,12 +134,12 @@ BlenderStrokeRenderer::~BlenderStrokeRenderer(){ //cout << "removing " << name[0] << name[1] << ":" << (name+2) << endl; switch (ob->type) { case OB_MESH: - free_libblock( &G.main->object, ob ); - free_libblock( &G.main->mesh, data ); + BKE_libblock_free( &G.main->object, ob ); + BKE_libblock_free( &G.main->mesh, data ); break; case OB_CAMERA: - free_libblock( &G.main->object, ob ); - free_libblock( &G.main->camera, data ); + BKE_libblock_free( &G.main->object, ob ); + BKE_libblock_free( &G.main->camera, data ); freestyle_scene->camera = NULL; break; default: @@ -150,9 +150,9 @@ BlenderStrokeRenderer::~BlenderStrokeRenderer(){ BLI_freelistN( &freestyle_scene->base ); // release material - free_libblock( &G.main->mat, material ); + BKE_libblock_free( &G.main->mat, material ); - set_scene_bg( G.main, old_scene ); + BKE_scene_set_background( G.main, old_scene ); } float BlenderStrokeRenderer::get_stroke_vertex_z(void) const { @@ -223,11 +223,11 @@ void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const{ continue; // me = Mesh.New() - Object* object_mesh = add_object(freestyle_scene, OB_MESH); + Object* object_mesh = BKE_object_add(freestyle_scene, OB_MESH); Mesh* mesh = (Mesh *) object_mesh->data; - MEM_freeN(mesh->bb); - mesh->bb= NULL; - mesh->id.us = 0; + // MEM_freeN(mesh->bb); + // mesh->bb= NULL; + // mesh->id.us = 0; #if 1 // me.materials = [mat] diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h b/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h index 27880721762..93b5f694eb6 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h +++ b/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h @@ -20,8 +20,8 @@ public: } virtual ~BlenderStyleModule() { - unlink_text(G.main, _text); - free_libblock(&G.main->text, _text); + BKE_text_unlink(G.main, _text); + BKE_libblock_free(&G.main->text, _text); } protected: diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index fbcea9ca164..c9a05019078 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -172,12 +172,12 @@ extern "C" { { char *s1= escape_quotes(layer_name); char *s2= escape_quotes(lineset_name); - Text *text= add_empty_text(lineset_name); - write_text(text, "import parameter_editor; parameter_editor.process('"); - write_text(text, s1); - write_text(text, "', '"); - write_text(text, s2); - write_text(text, "')\n"); + Text *text= BKE_text_add(lineset_name); + BKE_text_write(text, "import parameter_editor; parameter_editor.process('"); + BKE_text_write(text, s1); + BKE_text_write(text, "', '"); + BKE_text_write(text, s2); + BKE_text_write(text, "')\n"); MEM_freeN(s1); MEM_freeN(s2); return text; diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h index 24b03bd2dd3..81e2f70c82e 100755 --- a/source/blender/freestyle/intern/system/PythonInterpreter.h +++ b/source/blender/freestyle/intern/system/PythonInterpreter.h @@ -77,11 +77,11 @@ class LIB_SYSTEM_EXPORT PythonInterpreter : public Interpreter int status = BPY_filepath_exec(_context, fn, reports); #else int status; - Text *text = add_text(fn, G.main->name); + Text *text = BKE_text_load(fn, G.main->name); if (text) { status = BPY_text_exec(_context, text, reports, false); - unlink_text(G.main, text); - free_libblock(&G.main->text, text); + BKE_text_unlink(G.main, text); + BKE_libblock_free(&G.main->text, text); } else { BKE_reportf(reports, RPT_ERROR, "Cannot open file: %s", fn); status = 0; @@ -151,7 +151,7 @@ private: vector<string> pathnames; StringUtils::getPathName(_path, "", pathnames); - struct Text *text = add_empty_text("tmp_freestyle_initpath.txt"); + struct Text *text = BKE_text_add("tmp_freestyle_initpath.txt"); string cmd = "import sys\n"; txt_insert_buf(text, const_cast<char*>(cmd.c_str())); @@ -166,8 +166,8 @@ private: BPY_text_exec(_context, text, NULL, false); // cleaning up - unlink_text(G.main, text); - free_libblock(&G.main->text, text); + BKE_text_unlink(G.main, text); + BKE_libblock_free(&G.main->text, text); //PyRun_SimpleString("from Freestyle import *"); _initialized = true; |