LineArt: Allow curves objects to be loaded into calculation

When line art is first developed, curves objects does not exist yet, now
it is added to line art so it will be read and take part in feature line
generation and occlusion tests.

This patch also adds "Line Art" panel for curves object, just like other
objects supported by line art.

Pull Request: https://projects.blender.org/blender/blender/pulls/145296
This commit is contained in:
YimingWu
2025-08-28 17:28:47 +02:00
committed by YimingWu
parent 9e0ef26686
commit 02737c7b93
3 changed files with 4 additions and 4 deletions

View File

@@ -310,7 +310,7 @@ class OBJECT_PT_lineart(ObjectButtonsPanel, Panel):
@classmethod
def poll(cls, context):
ob = context.object
return (ob.type in {'MESH', 'FONT', 'CURVE', 'SURFACE'})
return (ob.type in {'MESH', 'FONT', 'CURVE', 'SURFACE', 'CURVES'})
def draw(self, context):
layout = self.layout

View File

@@ -141,7 +141,7 @@ static void add_this_collection(Collection &collection,
default_add = false;
}
FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (&collection, ob, mode) {
if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVES_LEGACY, OB_SURF, OB_FONT, OB_CURVES)) {
if ((ob->lineart.usage == OBJECT_LRT_INHERIT && default_add) ||
ob->lineart.usage != OBJECT_LRT_EXCLUDE)
{

View File

@@ -2472,7 +2472,7 @@ static void lineart_object_load_single_instance(LineartData *ld,
mul_m4db_m4db_m4fl(obi->model_view_proj, ld->conf.view_projection, use_mat);
mul_m4db_m4db_m4fl(obi->model_view, ld->conf.view, use_mat);
if (!ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
if (!ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVES_LEGACY, OB_SURF, OB_FONT, OB_CURVES)) {
return;
}
if (ob->type == OB_MESH) {
@@ -2604,7 +2604,7 @@ void lineart_main_load_geometries(Depsgraph *depsgraph,
/* DEG_OBJECT_ITER_BEGIN will include the instanced mesh of these curve object types, so don't
* load them twice. */
if (allow_duplicates && ELEM(ob->type, OB_CURVES_LEGACY, OB_FONT, OB_SURF)) {
if (allow_duplicates && ELEM(ob->type, OB_CURVES_LEGACY, OB_FONT, OB_SURF, OB_CURVES)) {
continue;
}