File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -656,7 +656,7 @@ module.exports = {
656
656
visible : new Types . Bool ( true ) ,
657
657
opacity : new Types . Float ( 1.0 ) ,
658
658
} ,
659
- propsDefinedByThree : [ 'type' ]
659
+ propsDefinedByThree : [ 'type' , 'needsUpdate' ]
660
660
} ,
661
661
MeshBasicMaterial : {
662
662
relativePath : './materials/MeshBasicMaterial' ,
Original file line number Diff line number Diff line change
1
+ var _ = require ( 'underscore' ) ;
2
+ var MaterialAutogen = require ( './Material.autogen' ) . MaterialModel ;
3
+
4
+ var MaterialModel = MaterialAutogen . extend ( {
5
+
6
+ onCustomMessage : function ( content , buffers ) {
7
+ switch ( content . type ) {
8
+ case 'needsUpdate' :
9
+ this . obj . needsUpdate = true ;
10
+ this . trigger ( 'childchange' , this ) ;
11
+ break ;
12
+ default :
13
+ MaterialAutogen . prototype . onCustomMessage . call ( arguments ) ;
14
+
15
+ }
16
+ } ,
17
+
18
+ } ) ;
19
+
20
+ module . exports = {
21
+ MaterialModel : MaterialModel ,
22
+ } ;
Original file line number Diff line number Diff line change
1
+
2
+ from traitlets import Bool , validate
3
+ from .Material_autogen import Material as MaterialAutogen
4
+
5
+
6
+ class Material (MaterialAutogen ):
7
+
8
+ # Do not sync this automatically:
9
+ needsUpdate = Bool (False )
10
+
11
+ @validate ('needsUpdate' )
12
+ def onNeedsUpdate (self , proposal ):
13
+ if proposal .value :
14
+ content = {
15
+ "type" : "needsUpdate" ,
16
+ }
17
+ self .send (content = content , buffers = None )
18
+ # Never actually set value
19
+ return False
You can’t perform that action at this time.
0 commit comments