1#usda 1.0 2( 3 startTimeCode = 0 4 endTimeCode = 10 5) 6 7def PointInstancer "Base" () { 8 Vec3f[] extent = [(-1, -1, -1), (26, 51, 103)] 9 int[] protoIndices = [] 10 Vec3f[] positions = [] 11 rel prototypes = [ <Protos/Proto1>, <Protos/Proto2> ] 12 def "Protos" { 13 def Cube "Proto1" () { 14 ColorFloat[] primvars:displayColor = [(1,0,0)] 15 } 16 def Cube "Proto2" () { 17 ColorFloat[] primvars:displayColor = [(0,1,0)] 18 } 19 } 20} 21 22def PointInstancer "NoInstances" ( 23 references = </Base> 24) { 25 int[] protoIndices = [] 26 Vec3f[] positions.timeSamples = { 27 0: [ ], 28 5: [ ], 29 10: [ ] 30 } 31 Quath[] orientations.timeSamples = { 32 0: [ ], 33 5: [ ], 34 10: [ ] 35 } 36 Vec3f[] velocities.timeSamples = { 37 0: [ ], 38 5: [ ], 39 10: [ ] 40 } 41 Vec3f[] angularVelocities.timeSamples = { 42 0: [ ], 43 5: [ ], 44 10: [ ] 45 } 46} 47 48def PointInstancer "OneInstanceNoSamples" ( 49 references = </Base> 50) { 51 int[] protoIndices = [ 0 ] 52 Vec3f[] positions = [ (0,0,0) ] 53 Quath[] orientations = [ (1,0,0,0) ] 54 Vec3f[] velocities = [ (120,240,480) ] 55 Vec3f[] angularVelocities = [ (0,0,864) ] 56} 57 58def PointInstancer "OneInstanceNoVelocities" ( 59 references = </Base> 60) { 61 int[] protoIndices = [ 0 ] 62 Vec3f[] positions.timeSamples = { 63 0: [ (0,0,0) ], 64 5: [ (25,50,100) ], 65 10: [ (0,0,0) ] 66 } 67 Quath[] orientations.timeSamples = { 68 0: [ (1,0,0,0) ], 69 5: [ (0,0,0,1) ], 70 10: [ (1,0,0,0) ] 71 } 72} 73 74def PointInstancer "OneInstance" ( 75 references = </Base> 76) { 77 int[] protoIndices = [ 0 ] 78 Vec3f[] positions.timeSamples = { 79 0: [ (0,0,0) ], 80 5: [ (25,50,100) ], 81 10: [ (0,0,0) ] 82 } 83 Quath[] orientations.timeSamples = { 84 0: [ (1,0,0,0) ], 85 5: [ (0,0,0,1) ], 86 10: [ (1,0,0,0) ] 87 } 88 Vec3f[] velocities.timeSamples = { 89 0: [ (120,240,480) ], 90 5: [ (-120,-240,-480) ], 91 10: [ (0,0,0) ] 92 } 93 Vec3f[] angularVelocities.timeSamples = { 94 0: [ (0,0,864) ], 95 5: [ (0,0,-864) ], 96 10: [ (0,0,0) ] 97 } 98} 99 100def PointInstancer "OneInstanceUnalignedData" ( 101 references = </Base> 102) { 103 int[] protoIndices = [ 0 ] 104 Vec3f[] positions.timeSamples = { 105 0: [ (0,0,0) ], 106 1: [ (0,0,0) ], 107 6: [ (25,50,100) ], 108 10: [ (0,0,0) ] 109 } 110 Quath[] orientations.timeSamples = { 111 0: [ (1,0,0,0) ], 112 2: [ (1,0,0,0) ], 113 7: [ (0,0,0,1) ], 114 10: [ (1,0,0,0) ] 115 } 116 Vec3f[] velocities.timeSamples = { 117 0: [ (0,0,0) ], 118 1: [ (120,240,480) ], 119 6: [ (-120,-240,-480) ], 120 10: [ (0,0,0) ] 121 } 122 Vec3f[] angularVelocities.timeSamples = { 123 0: [ (0,0,0) ], 124 2: [ (0,0,864) ], 125 7: [ (0,0,-864) ], 126 10: [ (0,0,0) ] 127 } 128} 129 130def PointInstancer "OneInstanceVelocityScale" ( 131 references = </OneInstance> 132) { 133 float motion:velocityScale = 2.0 134} 135 136def PointInstancer "MultiInstance" ( 137 references = </Base> 138) { 139 int[] protoIndices = [ 0, 1, 1 ] 140 Vec3f[] positions.timeSamples = { 141 0: [ (0,0,0), (0,0,1), (0,0,2) ], 142 5: [ (25,50,100), (25,50,101), (25,50,102) ], 143 10: [ (0,0,0), (0,0,1), (0,0,2) ] 144 } 145 Quath[] orientations.timeSamples = { 146 0: [ (1,0,0,0), (1,0,0,0), (0,0,0,1) ], 147 5: [ (0,0,0,1), (0,0,0,1), (1,0,0,0) ], 148 10: [ (1,0,0,0), (1,0,0,0), (0,0,0,1) ] 149 } 150 Vec3f[] velocities.timeSamples = { 151 0: [ (120,240,480), (120,240,480), (120,240,480) ], 152 5: [ (-120,-240,-480), (-120,-240,-480), (-120,-240,-480) ], 153 10: [ (0,0,0), (0,0,0), (0,0,0) ] 154 } 155 Vec3f[] angularVelocities.timeSamples = { 156 0: [ (0,0,864), (0,0,864), (0,0,-864) ], 157 5: [ (0,0,-864), (0,0,-864), (0,0,864) ], 158 10: [ (0,0,0), (0,0,0), (0,0,0) ] 159 } 160} 161 162def PointInstancer "MultiInstanceMask" ( 163 inactiveIds = [ 1 ] 164 references = </MultiInstance> 165) { 166} 167 168def PointInstancer "OneInstanceProtoXform" ( 169 references = </OneInstance> 170) { 171 172 def "Protos" { 173 def Cube "Proto1" () { 174 ColorFloat[] primvars:displayColor = [(0,1,0)] 175 double3 xformOp:rotateXYZ = (0, 0, 180) 176 uniform token[] xformOpOrder = ["xformOp:rotateXYZ"] 177 } 178 def Cube "Proto2" () { 179 ColorFloat[] primvars:displayColor = [(0,1,0)] 180 } 181 } 182} 183 184def PointInstancer "MultiInstanceForExtents" ( 185 references = </Base> 186) { 187 int[] protoIndices = [ 0, 1, 1 ] 188 Vec3f[] positions.timeSamples = { 189 0: [ (0,0,0), (0,0,0), (0,0,0) ], 190 10: [ (25,25,25), (-25,25,25), (0,50,0) ] 191 } 192 Quath[] orientations.timeSamples = { 193 0: [ (1,0,0,0), (1,0,0,0), (0,0,0,1) ], 194 10: [ (0,0,0,1), (0,0,0,1), (1,0,0,0) ] 195 } 196 Vec3f[] velocities.timeSamples = { 197 0: [ (60,60,60), (-60,60,60), (0,120,0) ], 198 10: [ (60,60,60), (-60,60,60), (0,120,0) ] 199 } 200 Vec3f[] angularVelocities.timeSamples = { 201 0: [ (0,0,432), (0,0,432), (0,0,-432) ], 202 10: [ (60,60,60), (-60,60,60), (0,120,0) ] 203 } 204} 205 206 207def PointInstancer "OneInstanceDifferingNumberPositionsAndVelocities" ( 208 references = </Base> 209) { 210 int[] protoIndices = [ 0 ] 211 Vec3f[] positions.timeSamples = { 212 0: [ (0,0,0) ], 213 2: [ (2,2,0) ], 214 4: [ (4,4,0) ], 215 6: [ (6,6,0) ] 216 } 217 Vec3f[] velocities.timeSamples = { 218 0: [ (2,4,0) ], 219 2: [ (2,6,0) ], 220 3: [ (2,8,0) ], 221 4: [ (2,8,0) ], 222 6: [ (2,10,0) ] 223 } 224} 225 226def PointInstancer "OneInstanceUnalignedPositionsAndVelocities" ( 227 references = </Base> 228) { 229 int[] protoIndices = [ 0 ] 230 Vec3f[] positions.timeSamples = { 231 0: [ (0,0,0) ], 232 2: [ (2,2,0) ], 233 4: [ (4,4,0) ], 234 6: [ (6,6,0) ] 235 } 236 Vec3f[] velocities.timeSamples = { 237 0: [ (2,4,0) ], 238 1: [ (2,6,0) ], 239 4: [ (2,8,0) ], 240 6: [ (2,10,0) ] 241 } 242} 243 244def PointInstancer "OneInstanceUnalignedPositionsOnly" ( 245 references = </Base> 246) { 247 int[] protoIndices = [ 0 ] 248 Vec3f[] positions.timeSamples = { 249 0: [ (0,0,0) ], 250 2: [ (2,2,0) ], 251 4: [ (4,4,0) ], 252 6: [ (6,6,0) ] 253 } 254} 255 256def PointInstancer "OneInstanceDifferingNumberOrientationsAndAngularVelocities" ( 257 references = </Base> 258) { 259 int[] protoIndices = [ 0 ] 260 Vec3f[] positions.timeSamples = { 261 0: [ (0,0,0) ], 262 2: [ (2,2,0) ], 263 4: [ (4,4,0) ], 264 6: [ (6,6,0) ] 265 } 266 Quath[] orientations.timeSamples = { 267 0: [ (1,0,0,0) ], 268 2: [ (1,0,0,0) ], 269 4: [ (0,0,0,1) ], 270 6: [ (1,0,0,0) ] 271 } 272 Vec3f[] angularVelocities.timeSamples = { 273 0: [ (0,0,0) ], 274 2: [ (0,0,864) ], 275 3: [ (0,0,0) ], 276 4: [ (0,0,-864) ], 277 6: [ (0,0,0) ] 278 } 279} 280 281def PointInstancer "OneInstanceUnalignedOrientationsAndAngularVelocities" ( 282 references = </Base> 283) { 284 int[] protoIndices = [ 0 ] 285 Vec3f[] positions.timeSamples = { 286 0: [ (0,0,0) ], 287 2: [ (2,2,0) ], 288 4: [ (4,4,0) ], 289 6: [ (6,6,0) ] 290 } 291 Quath[] orientations.timeSamples = { 292 0: [ (1,0,0,0) ], 293 2: [ (1,0,0,0) ], 294 4: [ (0,0,0,1) ], 295 6: [ (1,0,0,0) ] 296 } 297 Vec3f[] angularVelocities.timeSamples = { 298 0: [ (0,0,0) ], 299 1: [ (0,0,864) ], 300 4: [ (0,0,-864) ], 301 6: [ (0,0,0) ] 302 } 303} 304 305def PointInstancer "OneInstanceUnalignedOrientationsOnly" ( 306 references = </Base> 307) { 308 int[] protoIndices = [ 0 ] 309 Vec3f[] positions.timeSamples = { 310 0: [ (0,0,0) ], 311 2: [ (2,2,0) ], 312 4: [ (4,4,0) ], 313 6: [ (6,6,0) ] 314 } 315 Quath[] orientations.timeSamples = { 316 0: [ (1,0,0,0) ], 317 2: [ (1,0,0,0) ], 318 4: [ (0,0,0,1) ], 319 6: [ (1,0,0,0) ] 320 } 321} 322 323def PointInstancer "OneInstanceUnalignedVelocitiesAndAccelerations" ( 324 references = </Base> 325) { 326 int[] protoIndices = [ 0 ] 327 Vec3f[] positions.timeSamples = { 328 0: [ (0,0,0) ], 329 2: [ (2,2,0) ], 330 4: [ (4,4,0) ], 331 6: [ (6,6,0) ] 332 } 333 Vec3f[] velocities.timeSamples = { 334 0: [ (2,4,0) ], 335 2: [ (2,6,0) ], 336 4: [ (2,8,0) ], 337 6: [ (2,10,0) ] 338 } 339 Vec3f[] accelerations.timeSamples = { 340 0: [ (2,4,0) ], 341 1: [ (2,6,0) ], 342 4: [ (2,8,0) ], 343 6: [ (2,10,0) ] 344 } 345} 346 347def PointInstancer "OneInstanceDiffNumberVelocitiesAndAccelerations" ( 348 references = </Base> 349) { 350 int[] protoIndices = [ 0 ] 351 Vec3f[] positions.timeSamples = { 352 0: [ (0,0,0) ], 353 2: [ (2,2,0) ], 354 4: [ (4,4,0) ], 355 6: [ (6,6,0) ] 356 } 357 Vec3f[] velocities.timeSamples = { 358 0: [ (2,4,0) ], 359 2: [ (2,6,0) ], 360 4: [ (2,8,0) ], 361 6: [ (2,10,0) ] 362 } 363 Vec3f[] accelerations.timeSamples = { 364 0: [ (2,4,0) ], 365 2: [ (2,6,0) ], 366 3: [ (2,7,0) ], 367 4: [ (2,8,0) ], 368 6: [ (2,10,0) ] 369 } 370} 371 372def PointInstancer "OneInstanceDiffNumberPositionsAndVelocitiesAndAccelerations" ( 373 references = </Base> 374) { 375 int[] protoIndices = [ 0 ] 376 Vec3f[] positions.timeSamples = { 377 0: [ (0,0,0) ], 378 2: [ (2,2,0) ], 379 4: [ (4,4,0) ], 380 6: [ (6,6,0) ] 381 } 382 Vec3f[] velocities.timeSamples = { 383 0: [ (2,4,0) ], 384 2: [ (2,6,0) ], 385 3: [ (2,7,0) ], 386 4: [ (2,8,0) ], 387 6: [ (2,10,0) ] 388 } 389 Vec3f[] accelerations.timeSamples = { 390 0: [ (2,4,0) ], 391 2: [ (2,6,0) ], 392 3: [ (2,7,0) ], 393 4: [ (2,8,0) ], 394 6: [ (2,10,0) ] 395 } 396} 397 398def PointInstancer "OneInstancePositionsAndVelocitiesOnly" ( 399 references = </Base> 400) { 401 int[] protoIndices = [ 0 ] 402 Vec3f[] positions.timeSamples = { 403 0: [ (0,0,0) ], 404 2: [ (2,2,0) ], 405 4: [ (4,4,0) ], 406 6: [ (6,6,0) ] 407 } 408 Vec3f[] velocities.timeSamples = { 409 0: [ (2,4,0) ], 410 2: [ (2,6,0) ], 411 4: [ (2,8,0) ], 412 6: [ (2,10,0) ] 413 } 414} 415 416def PointInstancer "OneInstanceAcceleration" ( 417 references = </Base> 418) { 419 int[] protoIndices = [ 0 ] 420 Vec3f[] positions.timeSamples = { 421 0: [ (0,0,0) ], 422 5: [ (25,50,100) ], 423 10: [ (0,0,0) ] 424 } 425 Quath[] orientations.timeSamples = { 426 0: [ (1,0,0,0) ], 427 5: [ (0,0,0,1) ], 428 10: [ (1,0,0,0) ] 429 } 430 Vec3f[] velocities.timeSamples = { 431 0: [ (120,120,120) ], 432 5: [ (120,240,480) ], 433 10: [ (0,0,0) ] 434 } 435 Vec3f[] angularVelocities.timeSamples = { 436 0: [ (0,0,864) ], 437 5: [ (0,0,-864) ], 438 10: [ (0,0,0) ] 439 } 440 Vec3f[] accelerations.timeSamples = { 441 0: [ (24,24,24) ], 442 5: [ (24,48,72) ], 443 10: [ (0,0,0) ] 444 } 445} 446 447def PointBased "NoPoints" ( 448 references = </Base> 449) { 450 Vec3f[] points.timeSamples = { 451 0: [ ], 452 5: [ ], 453 10: [ ] 454 } 455 Vec3f[] velocities.timeSamples = { 456 0: [ ], 457 5: [ ], 458 10: [ ] 459 } 460} 461 462def PointBased "OnePointNoSamples" ( 463 references = </Base> 464) { 465 Vec3f[] points = [ (0,0,0) ] 466 Vec3f[] velocities = [ (120,240,480) ] 467} 468 469 470def PointBased "OnePointNoVelocities" ( 471 references = </Base> 472) { 473 Vec3f[] points.timeSamples = { 474 0: [ (0,0,0) ], 475 5: [ (25,50,100) ], 476 10: [ (0,0,0) ] 477 } 478} 479 480def PointBased "OnePoint" ( 481 references = </Base> 482) { 483 Vec3f[] points.timeSamples = { 484 0: [ (0,0,0) ], 485 5: [ (25,50,100) ], 486 10: [ (0,0,0) ] 487 } 488 Vec3f[] velocities.timeSamples = { 489 0: [ (120,240,480) ], 490 5: [ (-120,-240,-480) ], 491 10: [ (0,0,0) ] 492 } 493} 494 495def PointBased "OnePointAcceleration" ( 496 references = </Base> 497) { 498 Vec3f[] points.timeSamples = { 499 0: [ (0,0,0) ], 500 5: [ (25,50,100) ], 501 10: [ (0,0,0) ] 502 } 503 Vec3f[] velocities.timeSamples = { 504 0: [ (120,120,120) ], 505 5: [ (120,240,480) ], 506 10: [ (0,0,0) ] 507 } 508 Vec3f[] accelerations.timeSamples = { 509 0: [ (24,24,24) ], 510 5: [ (24,48,72) ], 511 10: [ (0,0,0) ] 512 } 513} 514 515def PointBased "OnePointDifferingNumberPositionsAndVelocities" ( 516 references = </Base> 517) { 518 Vec3f[] points.timeSamples = { 519 0: [ (0,0,0) ], 520 2: [ (2,2,0) ], 521 4: [ (4,4,0) ], 522 6: [ (6,6,0) ] 523 } 524 Vec3f[] velocities.timeSamples = { 525 0: [ (2,4,0) ], 526 2: [ (2,6,0) ], 527 3: [ (2,8,0) ], 528 4: [ (2,8,0) ], 529 6: [ (2,10,0) ] 530 } 531} 532 533def PointBased "OnePointUnalignedPositionsAndVelocities" ( 534 references = </Base> 535) { 536 Vec3f[] points.timeSamples = { 537 0: [ (0,0,0) ], 538 2: [ (2,2,0) ], 539 4: [ (4,4,0) ], 540 6: [ (6,6,0) ] 541 } 542 Vec3f[] velocities.timeSamples = { 543 0: [ (2,4,0) ], 544 1: [ (2,6,0) ], 545 4: [ (2,8,0) ], 546 6: [ (2,10,0) ] 547 } 548} 549 550def PointBased "OnePointUnalignedPositionsOnly" ( 551 references = </Base> 552) { 553 Vec3f[] points.timeSamples = { 554 0: [ (0,0,0) ], 555 2: [ (2,2,0) ], 556 4: [ (4,4,0) ], 557 6: [ (6,6,0) ] 558 } 559} 560 561def PointBased "OnePointUnalignedVelocitiesAndAccelerations" ( 562 references = </Base> 563) { 564 Vec3f[] points.timeSamples = { 565 0: [ (0,0,0) ], 566 2: [ (2,2,0) ], 567 4: [ (4,4,0) ], 568 6: [ (6,6,0) ] 569 } 570 Vec3f[] velocities.timeSamples = { 571 0: [ (2,4,0) ], 572 2: [ (2,6,0) ], 573 4: [ (2,8,0) ], 574 6: [ (2,10,0) ] 575 } 576 Vec3f[] accelerations.timeSamples = { 577 0: [ (2,4,0) ], 578 1: [ (2,6,0) ], 579 4: [ (2,8,0) ], 580 6: [ (2,10,0) ] 581 } 582} 583 584def PointBased "OnePointDiffNumberVelocitiesAndAccelerations" ( 585 references = </Base> 586) { 587 Vec3f[] points.timeSamples = { 588 0: [ (0,0,0) ], 589 2: [ (2,2,0) ], 590 4: [ (4,4,0) ], 591 6: [ (6,6,0) ] 592 } 593 Vec3f[] velocities.timeSamples = { 594 0: [ (2,4,0) ], 595 2: [ (2,6,0) ], 596 4: [ (2,8,0) ], 597 6: [ (2,10,0) ] 598 } 599 Vec3f[] accelerations.timeSamples = { 600 0: [ (2,4,0) ], 601 2: [ (2,6,0) ], 602 3: [ (2,7,0) ], 603 4: [ (2,8,0) ], 604 6: [ (2,10,0) ] 605 } 606} 607 608def PointBased "OnePointDiffNumberPositionsAndVelocitiesAndAccelerations" ( 609 references = </Base> 610) { 611 Vec3f[] points.timeSamples = { 612 0: [ (0,0,0) ], 613 2: [ (2,2,0) ], 614 4: [ (4,4,0) ], 615 6: [ (6,6,0) ] 616 } 617 Vec3f[] velocities.timeSamples = { 618 0: [ (2,4,0) ], 619 2: [ (2,6,0) ], 620 3: [ (2,7,0) ], 621 4: [ (2,8,0) ], 622 6: [ (2,10,0) ] 623 } 624 Vec3f[] accelerations.timeSamples = { 625 0: [ (2,4,0) ], 626 2: [ (2,6,0) ], 627 3: [ (2,7,0) ], 628 4: [ (2,8,0) ], 629 6: [ (2,10,0) ] 630 } 631} 632 633def PointBased "OnePointPositionsAndVelocitiesOnly" ( 634 references = </Base> 635) { 636 Vec3f[] points.timeSamples = { 637 0: [ (0,0,0) ], 638 2: [ (2,2,0) ], 639 4: [ (4,4,0) ], 640 6: [ (6,6,0) ] 641 } 642 Vec3f[] velocities.timeSamples = { 643 0: [ (2,4,0) ], 644 2: [ (2,6,0) ], 645 4: [ (2,8,0) ], 646 6: [ (2,10,0) ] 647 } 648} 649 650def PointBased "OnePointVelocityScale" ( 651 references = </OnePoint> 652) { 653 float motion:velocityScale = 2.0 654} 655 656def PointBased "MultiPoints" ( 657 references = </Base> 658) { 659 Vec3f[] points.timeSamples = { 660 0: [ (0,0,0), (0,0,1), (0,0,2) ], 661 5: [ (25,50,100), (25,50,101), (25,50,102) ], 662 10: [ (0,0,0), (0,0,1), (0,0,2) ] 663 } 664 Vec3f[] velocities.timeSamples = { 665 0: [ (120,240,480), (120,240,480), (120,240,480) ], 666 5: [ (-120,-240,-480), (-120,-240,-480), (-120,-240,-480) ], 667 10: [ (0,0,0), (0,0,0), (0,0,0) ] 668 } 669}