File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ module.exports = {
371
371
relativePath : './core/BufferGeometry' ,
372
372
superClass : 'BaseBufferGeometry' ,
373
373
properties : {
374
+ index : new Types . ThreeType ( [ 'BufferAttribute' , 'InterleavedBufferAttribute' ] ) ,
374
375
attributes : new Types . ThreeTypeDict ( [ 'BufferAttribute' , 'InterleavedBufferAttribute' ] ) ,
375
376
morphAttributes : new Types . BufferMorphAttributes ( ) ,
376
377
MaxIndex : new Types . Int ( 65535 ) ,
Original file line number Diff line number Diff line change @@ -35,7 +35,12 @@ var BufferGeometryModel = AutogenBufferGeometryModel.extend({
35
35
Promise . all ( _ . map ( _ . values ( ref . get ( 'morphAttributes' ) ) , function ( attr ) {
36
36
return attr . initPromise ;
37
37
} ) )
38
- ) ;
38
+ ) . then ( function ( ) {
39
+ // Wait for index attribute
40
+ return ref . get ( 'index' ) . then ( function ( index ) {
41
+ return index . initPromise ;
42
+ } ) ;
43
+ } ) ;
39
44
}
40
45
41
46
// Create three.js BufferAttributes from ref.
@@ -80,6 +85,15 @@ var BufferGeometryModel = AutogenBufferGeometryModel.extend({
80
85
} ) . then ( function ( attribModelKVs ) {
81
86
toSet . morphAttributes = _ . object ( attribModelKVs ) ;
82
87
88
+ // Then create models for index attribute:
89
+ } ) . then ( function ( ) {
90
+ if ( result . index ) {
91
+ var modelCtor = result . index . isInterleavedBufferAttribute ? InterleavedBufferAttributeModel : BufferAttributeModel ;
92
+ return createModel ( modelCtor , this . widget_manager , result . index ) . then ( function ( model ) {
93
+ toSet . index = model ;
94
+ } , this ) ;
95
+ }
96
+
83
97
// Sync out all properties that have been set:
84
98
} ) . then ( function ( ) {
85
99
// Add other fields that needs to be synced out:
Original file line number Diff line number Diff line change @@ -35,11 +35,14 @@ def validate(self, proposal):
35
35
def _gen_repr_from_keys (self , keys ):
36
36
# Hide data in repr to avoid overly large datasets
37
37
# Replace with uuids of buffer attributes
38
+ data_keys = ('attributes' , 'morphAttributes' , 'index' )
38
39
class_name = self .__class__ .__name__
39
40
signature_parts = [
40
41
'%s=%r' % (key , getattr (self , key ))
41
- for key in keys if key not in ( 'attributes' , 'morphAttributes' )
42
+ for key in keys if key not in data_keys
42
43
]
44
+ if not self ._compare (self .index , self .__class__ .index .default_value ):
45
+ signature_parts .append ('index=%s' % _attr_value_repr (self .index ))
43
46
for name in ('attributes' , 'morphAttributes' ):
44
47
if not _dict_is_default (self , name ):
45
48
signature_parts .append ('%s=%s' % (name , _attr_dict_repr (getattr (self , name ))))
You can’t perform that action at this time.
0 commit comments