diff --git a/libs/core/src/index.ts b/libs/core/src/index.ts index 55bb62366..318ea8ebf 100644 --- a/libs/core/src/index.ts +++ b/libs/core/src/index.ts @@ -15,6 +15,7 @@ export * from './lib/di/audio'; export * from './lib/di/camera'; export * from './lib/di/geometry'; export * from './lib/di/material'; +export * from './lib/di/curve'; export * from './lib/pipes/math'; export * from './lib/pipes/vector'; diff --git a/libs/core/src/lib/abstracts/instance.ts b/libs/core/src/lib/abstracts/instance.ts index 73a669f3a..5f3f9c44e 100644 --- a/libs/core/src/lib/abstracts/instance.ts +++ b/libs/core/src/lib/abstracts/instance.ts @@ -180,6 +180,19 @@ export abstract class NgtInstance< tap(([, attach]) => { if (!this.parentInstanceFactory) return; + const propertyToAttach = []; + if (Array.isArray(attach)) { + if (attach.length === 0) { + if (this.instance) { + if (isMaterial(this.instance)) { + propertyToAttach.push('material'); + } else if (isGeometry(this.instance)) { + propertyToAttach.push('geometry'); + } + } + } + } + if (!this.shouldAttach) { this.shouldAttach = typeof attach === 'function' || attach.length > 0; @@ -195,17 +208,6 @@ export abstract class NgtInstance< this.__ngt__.previousAttach = attachCleanUp; } } else { - const propertyToAttach = [...attach]; - if (propertyToAttach.length === 0) { - if (this.instance) { - if (isMaterial(this.instance)) { - propertyToAttach.push('material'); - } else if (isGeometry(this.instance)) { - propertyToAttach.push('geometry'); - } - } - } - if (propertyToAttach.length === 0) { // TODO: warn users about invalid attach params return; diff --git a/tools/generators/three/curves/files/lib/__fileName__.directive.ts__tmpl__ b/tools/generators/three/curves/files/lib/__fileName__.ts__tmpl__ similarity index 100% rename from tools/generators/three/curves/files/lib/__fileName__.directive.ts__tmpl__ rename to tools/generators/three/curves/files/lib/__fileName__.ts__tmpl__