1
- import { Color , ColorManagement , Layers , RGBAFormat , Texture , UnsignedByteType } from 'three' ;
1
+ import { ColorManagement , Layers , RGBAFormat , Texture , UnsignedByteType } from 'three' ;
2
2
import { getLocalState , invalidateInstance } from '../instance' ;
3
3
import { NgtAnyRecord , NgtInstanceNode , NgtState } from '../types' ;
4
4
import { is } from './is' ;
@@ -63,7 +63,7 @@ export function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord) {
63
63
64
64
// special treatmen for objects with support for set/copy, and layers
65
65
if ( targetProp && targetProp [ 'set' ] && ( targetProp [ 'copy' ] || targetProp instanceof Layers ) ) {
66
- const isColor = targetProp instanceof Color ;
66
+ const isColor = targetProp . isColor ;
67
67
// if value is an array
68
68
if ( Array . isArray ( value ) ) {
69
69
if ( targetProp [ 'fromArray' ] ) targetProp [ 'fromArray' ] ( value ) ;
@@ -79,7 +79,7 @@ export function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord) {
79
79
if ( ! ColorManagement && ! rootState . linear && isColor ) targetProp [ 'convertSRGBToLinear' ] ( ) ;
80
80
} // if nothing else fits, just set the single value, ignore undefined
81
81
else if ( value !== undefined ) {
82
- const isColor = targetProp instanceof Color ;
82
+ const isColor = targetProp . isColor ;
83
83
// allow setting array scalars
84
84
if ( ! isColor && targetProp [ 'setScalar' ] ) targetProp [ 'setScalar' ] ( value ) ;
85
85
// layers have no copy function, copy the mask
@@ -95,7 +95,7 @@ export function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord) {
95
95
currentInstance [ key ] = value ;
96
96
// auto-convert srgb textures
97
97
if (
98
- currentInstance [ key ] instanceof Texture &&
98
+ currentInstance [ key ] . isTexture &&
99
99
currentInstance [ key ] . format === RGBAFormat &&
100
100
currentInstance [ key ] . type === UnsignedByteType
101
101
) {
0 commit comments