1- import { Color , ColorManagement , Layers , RGBAFormat , Texture , UnsignedByteType } from 'three' ;
1+ import { ColorManagement , Layers , RGBAFormat , Texture , UnsignedByteType } from 'three' ;
22import { getLocalState , invalidateInstance } from '../instance' ;
33import { NgtAnyRecord , NgtInstanceNode , NgtState } from '../types' ;
44import { is } from './is' ;
@@ -63,7 +63,7 @@ export function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord) {
6363
6464 // special treatmen for objects with support for set/copy, and layers
6565 if ( targetProp && targetProp [ 'set' ] && ( targetProp [ 'copy' ] || targetProp instanceof Layers ) ) {
66- const isColor = targetProp instanceof Color ;
66+ const isColor = targetProp . isColor ;
6767 // if value is an array
6868 if ( Array . isArray ( value ) ) {
6969 if ( targetProp [ 'fromArray' ] ) targetProp [ 'fromArray' ] ( value ) ;
@@ -79,7 +79,7 @@ export function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord) {
7979 if ( ! ColorManagement && ! rootState . linear && isColor ) targetProp [ 'convertSRGBToLinear' ] ( ) ;
8080 } // if nothing else fits, just set the single value, ignore undefined
8181 else if ( value !== undefined ) {
82- const isColor = targetProp instanceof Color ;
82+ const isColor = targetProp . isColor ;
8383 // allow setting array scalars
8484 if ( ! isColor && targetProp [ 'setScalar' ] ) targetProp [ 'setScalar' ] ( value ) ;
8585 // layers have no copy function, copy the mask
@@ -95,7 +95,7 @@ export function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord) {
9595 currentInstance [ key ] = value ;
9696 // auto-convert srgb textures
9797 if (
98- currentInstance [ key ] instanceof Texture &&
98+ currentInstance [ key ] . isTexture &&
9999 currentInstance [ key ] . format === RGBAFormat &&
100100 currentInstance [ key ] . type === UnsignedByteType
101101 ) {
0 commit comments