123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- /**
- * @author TristanVALCKE / https://github.com/TristanVALCKE
- */
- QUnit.module( 'BufferAttribute' );
- QUnit.test( 'parseTrackName' , function( assert ) {
- var paths = [
- [
- '.property',
- {
- nodeName: undefined,
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'nodeName.property',
- {
- nodeName: 'nodeName',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'a.property',
- {
- nodeName: 'a',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'no.de.Name.property',
- {
- nodeName: 'no.de.Name',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'no.d-e.Name.property',
- {
- nodeName: 'no.d-e.Name',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'nodeName.property[accessor]',
- {
- nodeName: 'nodeName',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: 'accessor'
- }
- ],
- [
- 'nodeName.material.property[accessor]',
- {
- nodeName: 'nodeName',
- objectName: 'material',
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: 'accessor'
- }
- ],
- [
- 'no.de.Name.material.property',
- {
- nodeName: 'no.de.Name',
- objectName: 'material',
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'no.de.Name.material[materialIndex].property',
- {
- nodeName: 'no.de.Name',
- objectName: 'material',
- objectIndex: 'materialIndex',
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'uuid.property[accessor]',
- {
- nodeName: 'uuid',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: 'accessor'
- }
- ],
- [
- 'uuid.objectName[objectIndex].propertyName[propertyIndex]',
- {
- nodeName: 'uuid',
- objectName: 'objectName',
- objectIndex: 'objectIndex',
- propertyName: 'propertyName',
- propertyIndex: 'propertyIndex'
- }
- ],
- [
- 'parentName/nodeName.property',
- {
- // directoryName is currently unused.
- nodeName: 'nodeName',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'parentName/no.de.Name.property',
- {
- // directoryName is currently unused.
- nodeName: 'no.de.Name',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: undefined
- }
- ],
- [
- 'parentName/parentName/nodeName.property[index]',
- {
- // directoryName is currently unused.
- nodeName: 'nodeName',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'property',
- propertyIndex: 'index'
- }
- ],
- [
- '.bone[Armature.DEF_cog].position',
- {
- nodeName: undefined,
- objectName: 'bone',
- objectIndex: 'Armature.DEF_cog',
- propertyName: 'position',
- propertyIndex: undefined
- }
- ],
- [
- 'scene:helium_balloon_model:helium_balloon_model.position',
- {
- nodeName: 'helium_balloon_model',
- objectName: undefined,
- objectIndex: undefined,
- propertyName: 'position',
- propertyIndex: undefined
- }
- ]
- ];
- paths.forEach( function ( path, i ) {
- assert.smartEqual(
- THREE.PropertyBinding.parseTrackName( path[ 0 ] ),
- path[ 1 ],
- 'Parses track name: ' + path[ 0 ]
- );
- } );
- });
|