diff options
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 7c46937bed2..6365dfe26a7 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -232,7 +232,7 @@ Material *BlenderStrokeRenderer::GetStrokeShader(Main *bmain, storage = (NodeShaderAttribute *)input_attr_color->storage; BLI_strncpy(storage->name, "Color", sizeof(storage->name)); - bNode *mix_rgb_color = nodeAddStaticNode(nullptr, ntree, SH_NODE_MIX_RGB); + bNode *mix_rgb_color = nodeAddStaticNode(nullptr, ntree, SH_NODE_MIX_RGB_LEGACY); mix_rgb_color->custom1 = MA_RAMP_BLEND; // Mix mix_rgb_color->locx = 200.0f; mix_rgb_color->locy = -200.0f; @@ -246,7 +246,7 @@ Material *BlenderStrokeRenderer::GetStrokeShader(Main *bmain, storage = (NodeShaderAttribute *)input_attr_alpha->storage; BLI_strncpy(storage->name, "Alpha", sizeof(storage->name)); - bNode *mix_rgb_alpha = nodeAddStaticNode(nullptr, ntree, SH_NODE_MIX_RGB); + bNode *mix_rgb_alpha = nodeAddStaticNode(nullptr, ntree, SH_NODE_MIX_RGB_LEGACY); mix_rgb_alpha->custom1 = MA_RAMP_BLEND; // Mix mix_rgb_alpha->locx = 600.0f; mix_rgb_alpha->locy = 300.0f; @@ -577,15 +577,15 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) mesh->totcol = group->materials.size(); mesh->mvert = (MVert *)CustomData_add_layer( - &mesh->vdata, CD_MVERT, CD_CALLOC, nullptr, mesh->totvert); + &mesh->vdata, CD_MVERT, CD_SET_DEFAULT, nullptr, mesh->totvert); mesh->medge = (MEdge *)CustomData_add_layer( - &mesh->edata, CD_MEDGE, CD_CALLOC, nullptr, mesh->totedge); + &mesh->edata, CD_MEDGE, CD_SET_DEFAULT, nullptr, mesh->totedge); mesh->mpoly = (MPoly *)CustomData_add_layer( - &mesh->pdata, CD_MPOLY, CD_CALLOC, nullptr, mesh->totpoly); + &mesh->pdata, CD_MPOLY, CD_SET_DEFAULT, nullptr, mesh->totpoly); mesh->mloop = (MLoop *)CustomData_add_layer( - &mesh->ldata, CD_MLOOP, CD_CALLOC, nullptr, mesh->totloop); + &mesh->ldata, CD_MLOOP, CD_SET_DEFAULT, nullptr, mesh->totloop); int *material_indices = (int *)CustomData_add_layer_named( - &mesh->pdata, CD_PROP_INT32, CD_DEFAULT, nullptr, mesh->totpoly, "material_index"); + &mesh->pdata, CD_PROP_INT32, CD_SET_DEFAULT, nullptr, mesh->totpoly, "material_index"); MVert *vertices = mesh->mvert; MEdge *edges = mesh->medge; MPoly *polys = mesh->mpoly; @@ -595,14 +595,14 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) if (hasTex) { // First UV layer CustomData_add_layer_named( - &mesh->ldata, CD_MLOOPUV, CD_CALLOC, nullptr, mesh->totloop, uvNames[0]); + &mesh->ldata, CD_MLOOPUV, CD_SET_DEFAULT, nullptr, mesh->totloop, uvNames[0]); CustomData_set_layer_active(&mesh->ldata, CD_MLOOPUV, 0); BKE_mesh_update_customdata_pointers(mesh, true); loopsuv[0] = mesh->mloopuv; // Second UV layer CustomData_add_layer_named( - &mesh->ldata, CD_MLOOPUV, CD_CALLOC, nullptr, mesh->totloop, uvNames[1]); + &mesh->ldata, CD_MLOOPUV, CD_SET_DEFAULT, nullptr, mesh->totloop, uvNames[1]); CustomData_set_layer_active(&mesh->ldata, CD_MLOOPUV, 1); BKE_mesh_update_customdata_pointers(mesh, true); loopsuv[1] = mesh->mloopuv; @@ -610,9 +610,9 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) // colors and transparency (the latter represented by grayscale colors) MLoopCol *colors = (MLoopCol *)CustomData_add_layer_named( - &mesh->ldata, CD_PROP_BYTE_COLOR, CD_CALLOC, nullptr, mesh->totloop, "Color"); + &mesh->ldata, CD_PROP_BYTE_COLOR, CD_SET_DEFAULT, nullptr, mesh->totloop, "Color"); MLoopCol *transp = (MLoopCol *)CustomData_add_layer_named( - &mesh->ldata, CD_PROP_BYTE_COLOR, CD_CALLOC, nullptr, mesh->totloop, "Alpha"); + &mesh->ldata, CD_PROP_BYTE_COLOR, CD_SET_DEFAULT, nullptr, mesh->totloop, "Alpha"); mesh->mloopcol = colors; mesh->mat = (Material **)MEM_mallocN(sizeof(Material *) * mesh->totcol, "MaterialList"); |