1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821
|
/**
* @author mrdoob / http://mrdoob.com/
*/
Sidebar.Object = function ( editor ) {
var strings = editor.strings;
var signals = editor.signals;
var container = new UI.Panel();
container.setBorderTop( '0' );
container.setPaddingTop( '20px' );
container.setDisplay( 'none' );
// Actions
/*
var objectActions = new UI.Select().setPosition( 'absolute' ).setRight( '8px' ).setFontSize( '11px' );
objectActions.setOptions( {
'Actions': 'Actions',
'Reset Position': 'Reset Position',
'Reset Rotation': 'Reset Rotation',
'Reset Scale': 'Reset Scale'
} );
objectActions.onClick( function ( event ) {
event.stopPropagation(); // Avoid panel collapsing
} );
objectActions.onChange( function ( event ) {
var object = editor.selected;
switch ( this.getValue() ) {
case 'Reset Position':
editor.execute( new SetPositionCommand( editor, object, new THREE.Vector3( 0, 0, 0 ) ) );
break;
case 'Reset Rotation':
editor.execute( new SetRotationCommand( editor, object, new THREE.Euler( 0, 0, 0 ) ) );
break;
case 'Reset Scale':
editor.execute( new SetScaleCommand( editor, object, new THREE.Vector3( 1, 1, 1 ) ) );
break;
}
this.setValue( 'Actions' );
} );
container.addStatic( objectActions );
*/
// type
var objectTypeRow = new UI.Row();
var objectType = new UI.Text();
objectTypeRow.add( new UI.Text( strings.getKey( 'sidebar/object/type' ) ).setWidth( '90px' ) );
objectTypeRow.add( objectType );
container.add( objectTypeRow );
// uuid
var objectUUIDRow = new UI.Row();
var objectUUID = new UI.Input().setWidth( '102px' ).setFontSize( '12px' ).setDisabled( true );
var objectUUIDRenew = new UI.Button( strings.getKey( 'sidebar/object/new' ) ).setMarginLeft( '7px' ).onClick( function () {
objectUUID.setValue( THREE.Math.generateUUID() );
editor.execute( new SetUuidCommand( editor, editor.selected, objectUUID.getValue() ) );
} );
objectUUIDRow.add( new UI.Text( strings.getKey( 'sidebar/object/uuid' ) ).setWidth( '90px' ) );
objectUUIDRow.add( objectUUID );
objectUUIDRow.add( objectUUIDRenew );
container.add( objectUUIDRow );
// name
var objectNameRow = new UI.Row();
var objectName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () {
editor.execute( new SetValueCommand( editor, editor.selected, 'name', objectName.getValue() ) );
} );
objectNameRow.add( new UI.Text( strings.getKey( 'sidebar/object/name' ) ).setWidth( '90px' ) );
objectNameRow.add( objectName );
container.add( objectNameRow );
// position
var objectPositionRow = new UI.Row();
var objectPositionX = new UI.Number().setPrecision( 3 ).setWidth( '50px' ).onChange( update );
var objectPositionY = new UI.Number().setPrecision( 3 ).setWidth( '50px' ).onChange( update );
var objectPositionZ = new UI.Number().setPrecision( 3 ).setWidth( '50px' ).onChange( update );
objectPositionRow.add( new UI.Text( strings.getKey( 'sidebar/object/position' ) ).setWidth( '90px' ) );
objectPositionRow.add( objectPositionX, objectPositionY, objectPositionZ );
container.add( objectPositionRow );
// rotation
var objectRotationRow = new UI.Row();
var objectRotationX = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
var objectRotationY = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
var objectRotationZ = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
objectRotationRow.add( new UI.Text( strings.getKey( 'sidebar/object/rotation' ) ).setWidth( '90px' ) );
objectRotationRow.add( objectRotationX, objectRotationY, objectRotationZ );
container.add( objectRotationRow );
// scale
var objectScaleRow = new UI.Row();
var objectScaleLock = new UI.Checkbox( true ).setPosition( 'absolute' ).setLeft( '75px' );
var objectScaleX = new UI.Number( 1 ).setPrecision( 3 ).setRange( 0.001, Infinity ).setWidth( '50px' ).onChange( updateScaleX );
var objectScaleY = new UI.Number( 1 ).setPrecision( 3 ).setRange( 0.001, Infinity ).setWidth( '50px' ).onChange( updateScaleY );
var objectScaleZ = new UI.Number( 1 ).setPrecision( 3 ).setRange( 0.001, Infinity ).setWidth( '50px' ).onChange( updateScaleZ );
objectScaleRow.add( new UI.Text( strings.getKey( 'sidebar/object/scale' ) ).setWidth( '90px' ) );
objectScaleRow.add( objectScaleLock );
objectScaleRow.add( objectScaleX, objectScaleY, objectScaleZ );
container.add( objectScaleRow );
// fov
var objectFovRow = new UI.Row();
var objectFov = new UI.Number().onChange( update );
objectFovRow.add( new UI.Text( strings.getKey( 'sidebar/object/fov' ) ).setWidth( '90px' ) );
objectFovRow.add( objectFov );
container.add( objectFovRow );
// left
var objectLeftRow = new UI.Row();
var objectLeft = new UI.Number().onChange( update );
objectLeftRow.add( new UI.Text( strings.getKey( 'sidebar/object/left' ) ).setWidth( '90px' ) );
objectLeftRow.add( objectLeft );
container.add( objectLeftRow );
// right
var objectRightRow = new UI.Row();
var objectRight = new UI.Number().onChange( update );
objectRightRow.add( new UI.Text( strings.getKey( 'sidebar/object/right' ) ).setWidth( '90px' ) );
objectRightRow.add( objectRight );
container.add( objectRightRow );
// top
var objectTopRow = new UI.Row();
var objectTop = new UI.Number().onChange( update );
objectTopRow.add( new UI.Text( strings.getKey( 'sidebar/object/top' ) ).setWidth( '90px' ) );
objectTopRow.add( objectTop );
container.add( objectTopRow );
// bottom
var objectBottomRow = new UI.Row();
var objectBottom = new UI.Number().onChange( update );
objectBottomRow.add( new UI.Text( strings.getKey( 'sidebar/object/bottom' ) ).setWidth( '90px' ) );
objectBottomRow.add( objectBottom );
container.add( objectBottomRow );
// near
var objectNearRow = new UI.Row();
var objectNear = new UI.Number().onChange( update );
objectNearRow.add( new UI.Text( strings.getKey( 'sidebar/object/near' ) ).setWidth( '90px' ) );
objectNearRow.add( objectNear );
container.add( objectNearRow );
// far
var objectFarRow = new UI.Row();
var objectFar = new UI.Number().onChange( update );
objectFarRow.add( new UI.Text( strings.getKey( 'sidebar/object/far' ) ).setWidth( '90px' ) );
objectFarRow.add( objectFar );
container.add( objectFarRow );
// intensity
var objectIntensityRow = new UI.Row();
var objectIntensity = new UI.Number().setRange( 0, Infinity ).onChange( update );
objectIntensityRow.add( new UI.Text( strings.getKey( 'sidebar/object/intensity' ) ).setWidth( '90px' ) );
objectIntensityRow.add( objectIntensity );
container.add( objectIntensityRow );
// color
var objectColorRow = new UI.Row();
var objectColor = new UI.Color().onChange( update );
objectColorRow.add( new UI.Text( strings.getKey( 'sidebar/object/color' ) ).setWidth( '90px' ) );
objectColorRow.add( objectColor );
container.add( objectColorRow );
// ground color
var objectGroundColorRow = new UI.Row();
var objectGroundColor = new UI.Color().onChange( update );
objectGroundColorRow.add( new UI.Text( strings.getKey( 'sidebar/object/groundcolor' ) ).setWidth( '90px' ) );
objectGroundColorRow.add( objectGroundColor );
container.add( objectGroundColorRow );
// distance
var objectDistanceRow = new UI.Row();
var objectDistance = new UI.Number().setRange( 0, Infinity ).onChange( update );
objectDistanceRow.add( new UI.Text( strings.getKey( 'sidebar/object/distance' ) ).setWidth( '90px' ) );
objectDistanceRow.add( objectDistance );
container.add( objectDistanceRow );
// angle
var objectAngleRow = new UI.Row();
var objectAngle = new UI.Number().setPrecision( 3 ).setRange( 0, Math.PI / 2 ).onChange( update );
objectAngleRow.add( new UI.Text( strings.getKey( 'sidebar/object/angle' ) ).setWidth( '90px' ) );
objectAngleRow.add( objectAngle );
container.add( objectAngleRow );
// penumbra
var objectPenumbraRow = new UI.Row();
var objectPenumbra = new UI.Number().setRange( 0, 1 ).onChange( update );
objectPenumbraRow.add( new UI.Text( strings.getKey( 'sidebar/object/penumbra' ) ).setWidth( '90px' ) );
objectPenumbraRow.add( objectPenumbra );
container.add( objectPenumbraRow );
// decay
var objectDecayRow = new UI.Row();
var objectDecay = new UI.Number().setRange( 0, Infinity ).onChange( update );
objectDecayRow.add( new UI.Text( strings.getKey( 'sidebar/object/decay' ) ).setWidth( '90px' ) );
objectDecayRow.add( objectDecay );
container.add( objectDecayRow );
// shadow
var objectShadowRow = new UI.Row();
objectShadowRow.add( new UI.Text( strings.getKey( 'sidebar/object/shadow' ) ).setWidth( '90px' ) );
var objectCastShadow = new UI.THREE.Boolean( false, strings.getKey( 'sidebar/object/cast' ) ).onChange( update );
objectShadowRow.add( objectCastShadow );
var objectReceiveShadow = new UI.THREE.Boolean( false, strings.getKey( 'sidebar/object/receive' ) ).onChange( update );
objectShadowRow.add( objectReceiveShadow );
var objectShadowRadius = new UI.Number( 1 ).onChange( update );
objectShadowRow.add( objectShadowRadius );
container.add( objectShadowRow );
// visible
var objectVisibleRow = new UI.Row();
var objectVisible = new UI.Checkbox().onChange( update );
objectVisibleRow.add( new UI.Text( strings.getKey( 'sidebar/object/visible' ) ).setWidth( '90px' ) );
objectVisibleRow.add( objectVisible );
container.add( objectVisibleRow );
// frustumCulled
var objectFrustumCulledRow = new UI.Row();
var objectFrustumCulled = new UI.Checkbox().onChange( update );
objectFrustumCulledRow.add( new UI.Text( strings.getKey( 'sidebar/object/frustumcull' ) ).setWidth( '90px' ) );
objectFrustumCulledRow.add( objectFrustumCulled );
container.add( objectFrustumCulledRow );
// renderOrder
var objectRenderOrderRow = new UI.Row();
var objectRenderOrder = new UI.Integer().setWidth( '50px' ).onChange( update );
objectRenderOrderRow.add( new UI.Text( strings.getKey( 'sidebar/object/renderorder' ) ).setWidth( '90px' ) );
objectRenderOrderRow.add( objectRenderOrder );
container.add( objectRenderOrderRow );
// user data
var timeout;
var objectUserDataRow = new UI.Row();
var objectUserData = new UI.TextArea().setWidth( '150px' ).setHeight( '40px' ).setFontSize( '12px' ).onChange( update );
objectUserData.onKeyUp( function () {
try {
JSON.parse( objectUserData.getValue() );
objectUserData.dom.classList.add( 'success' );
objectUserData.dom.classList.remove( 'fail' );
} catch ( error ) {
objectUserData.dom.classList.remove( 'success' );
objectUserData.dom.classList.add( 'fail' );
}
} );
objectUserDataRow.add( new UI.Text( strings.getKey( 'sidebar/object/userdata' ) ).setWidth( '90px' ) );
objectUserDataRow.add( objectUserData );
container.add( objectUserDataRow );
//
function updateScaleX() {
var object = editor.selected;
if ( objectScaleLock.getValue() === true ) {
var scale = objectScaleX.getValue() / object.scale.x;
objectScaleY.setValue( objectScaleY.getValue() * scale );
objectScaleZ.setValue( objectScaleZ.getValue() * scale );
}
update();
}
function updateScaleY() {
var object = editor.selected;
if ( objectScaleLock.getValue() === true ) {
var scale = objectScaleY.getValue() / object.scale.y;
objectScaleX.setValue( objectScaleX.getValue() * scale );
objectScaleZ.setValue( objectScaleZ.getValue() * scale );
}
update();
}
function updateScaleZ() {
var object = editor.selected;
if ( objectScaleLock.getValue() === true ) {
var scale = objectScaleZ.getValue() / object.scale.z;
objectScaleX.setValue( objectScaleX.getValue() * scale );
objectScaleY.setValue( objectScaleY.getValue() * scale );
}
update();
}
function update() {
var object = editor.selected;
if ( object !== null ) {
var newPosition = new THREE.Vector3( objectPositionX.getValue(), objectPositionY.getValue(), objectPositionZ.getValue() );
if ( object.position.distanceTo( newPosition ) >= 0.01 ) {
editor.execute( new SetPositionCommand( editor, object, newPosition ) );
}
var newRotation = new THREE.Euler( objectRotationX.getValue() * THREE.Math.DEG2RAD, objectRotationY.getValue() * THREE.Math.DEG2RAD, objectRotationZ.getValue() * THREE.Math.DEG2RAD );
if ( object.rotation.toVector3().distanceTo( newRotation.toVector3() ) >= 0.01 ) {
editor.execute( new SetRotationCommand( editor, object, newRotation ) );
}
var newScale = new THREE.Vector3( objectScaleX.getValue(), objectScaleY.getValue(), objectScaleZ.getValue() );
if ( object.scale.distanceTo( newScale ) >= 0.01 ) {
editor.execute( new SetScaleCommand( editor, object, newScale ) );
}
if ( object.fov !== undefined && Math.abs( object.fov - objectFov.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'fov', objectFov.getValue() ) );
object.updateProjectionMatrix();
}
if ( object.left !== undefined && Math.abs( object.left - objectLeft.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'left', objectLeft.getValue() ) );
object.updateProjectionMatrix();
}
if ( object.right !== undefined && Math.abs( object.right - objectRight.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'right', objectRight.getValue() ) );
object.updateProjectionMatrix();
}
if ( object.top !== undefined && Math.abs( object.top - objectTop.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'top', objectTop.getValue() ) );
object.updateProjectionMatrix();
}
if ( object.bottom !== undefined && Math.abs( object.bottom - objectBottom.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'bottom', objectBottom.getValue() ) );
object.updateProjectionMatrix();
}
if ( object.near !== undefined && Math.abs( object.near - objectNear.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'near', objectNear.getValue() ) );
if ( object.isOrthographicCamera ) {
object.updateProjectionMatrix();
}
}
if ( object.far !== undefined && Math.abs( object.far - objectFar.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'far', objectFar.getValue() ) );
if ( object.isOrthographicCamera ) {
object.updateProjectionMatrix();
}
}
if ( object.intensity !== undefined && Math.abs( object.intensity - objectIntensity.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'intensity', objectIntensity.getValue() ) );
}
if ( object.color !== undefined && object.color.getHex() !== objectColor.getHexValue() ) {
editor.execute( new SetColorCommand( editor, object, 'color', objectColor.getHexValue() ) );
}
if ( object.groundColor !== undefined && object.groundColor.getHex() !== objectGroundColor.getHexValue() ) {
editor.execute( new SetColorCommand( editor, object, 'groundColor', objectGroundColor.getHexValue() ) );
}
if ( object.distance !== undefined && Math.abs( object.distance - objectDistance.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'distance', objectDistance.getValue() ) );
}
if ( object.angle !== undefined && Math.abs( object.angle - objectAngle.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'angle', objectAngle.getValue() ) );
}
if ( object.penumbra !== undefined && Math.abs( object.penumbra - objectPenumbra.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'penumbra', objectPenumbra.getValue() ) );
}
if ( object.decay !== undefined && Math.abs( object.decay - objectDecay.getValue() ) >= 0.01 ) {
editor.execute( new SetValueCommand( editor, object, 'decay', objectDecay.getValue() ) );
}
if ( object.visible !== objectVisible.getValue() ) {
editor.execute( new SetValueCommand( editor, object, 'visible', objectVisible.getValue() ) );
}
if ( object.frustumCulled !== objectFrustumCulled.getValue() ) {
editor.execute( new SetValueCommand( editor, object, 'frustumCulled', objectFrustumCulled.getValue() ) );
}
if ( object.renderOrder !== objectRenderOrder.getValue() ) {
editor.execute( new SetValueCommand( editor, object, 'renderOrder', objectRenderOrder.getValue() ) );
}
if ( object.castShadow !== undefined && object.castShadow !== objectCastShadow.getValue() ) {
editor.execute( new SetValueCommand( editor, object, 'castShadow', objectCastShadow.getValue() ) );
}
if ( object.receiveShadow !== undefined && object.receiveShadow !== objectReceiveShadow.getValue() ) {
object.material.needsUpdate = true;
editor.execute( new SetValueCommand( editor, object, 'receiveShadow', objectReceiveShadow.getValue() ) );
}
if ( object.shadow !== undefined ) {
if ( object.shadow.radius !== objectShadowRadius.getValue() ) {
editor.execute( new SetValueCommand( editor, object.shadow, 'radius', objectShadowRadius.getValue() ) );
}
}
try {
var userData = JSON.parse( objectUserData.getValue() );
if ( JSON.stringify( object.userData ) != JSON.stringify( userData ) ) {
editor.execute( new SetValueCommand( editor, object, 'userData', userData ) );
}
} catch ( exception ) {
console.warn( exception );
}
}
}
function updateRows( object ) {
var properties = {
'fov': objectFovRow,
'left': objectLeftRow,
'right': objectRightRow,
'top': objectTopRow,
'bottom': objectBottomRow,
'near': objectNearRow,
'far': objectFarRow,
'intensity': objectIntensityRow,
'color': objectColorRow,
'groundColor': objectGroundColorRow,
'distance': objectDistanceRow,
'angle': objectAngleRow,
'penumbra': objectPenumbraRow,
'decay': objectDecayRow,
'castShadow': objectShadowRow,
'receiveShadow': objectReceiveShadow,
'shadow': objectShadowRadius
};
for ( var property in properties ) {
properties[ property ].setDisplay( object[ property ] !== undefined ? '' : 'none' );
}
}
function updateTransformRows( object ) {
if ( object.isLight ||
( object.isObject3D && object.userData.targetInverse ) ) {
objectRotationRow.setDisplay( 'none' );
objectScaleRow.setDisplay( 'none' );
} else {
objectRotationRow.setDisplay( '' );
objectScaleRow.setDisplay( '' );
}
}
// events
signals.objectSelected.add( function ( object ) {
if ( object !== null ) {
container.setDisplay( 'block' );
updateRows( object );
updateUI( object );
} else {
container.setDisplay( 'none' );
}
} );
signals.objectChanged.add( function ( object ) {
if ( object !== editor.selected ) return;
updateUI( object );
} );
signals.refreshSidebarObject3D.add( function ( object ) {
if ( object !== editor.selected ) return;
updateUI( object );
} );
function updateUI( object ) {
objectType.setValue( object.type );
objectUUID.setValue( object.uuid );
objectName.setValue( object.name );
objectPositionX.setValue( object.position.x );
objectPositionY.setValue( object.position.y );
objectPositionZ.setValue( object.position.z );
objectRotationX.setValue( object.rotation.x * THREE.Math.RAD2DEG );
objectRotationY.setValue( object.rotation.y * THREE.Math.RAD2DEG );
objectRotationZ.setValue( object.rotation.z * THREE.Math.RAD2DEG );
objectScaleX.setValue( object.scale.x );
objectScaleY.setValue( object.scale.y );
objectScaleZ.setValue( object.scale.z );
if ( object.fov !== undefined ) {
objectFov.setValue( object.fov );
}
if ( object.left !== undefined ) {
objectLeft.setValue( object.left );
}
if ( object.right !== undefined ) {
objectRight.setValue( object.right );
}
if ( object.top !== undefined ) {
objectTop.setValue( object.top );
}
if ( object.bottom !== undefined ) {
objectBottom.setValue( object.bottom );
}
if ( object.near !== undefined ) {
objectNear.setValue( object.near );
}
if ( object.far !== undefined ) {
objectFar.setValue( object.far );
}
if ( object.intensity !== undefined ) {
objectIntensity.setValue( object.intensity );
}
if ( object.color !== undefined ) {
objectColor.setHexValue( object.color.getHexString() );
}
if ( object.groundColor !== undefined ) {
objectGroundColor.setHexValue( object.groundColor.getHexString() );
}
if ( object.distance !== undefined ) {
objectDistance.setValue( object.distance );
}
if ( object.angle !== undefined ) {
objectAngle.setValue( object.angle );
}
if ( object.penumbra !== undefined ) {
objectPenumbra.setValue( object.penumbra );
}
if ( object.decay !== undefined ) {
objectDecay.setValue( object.decay );
}
if ( object.castShadow !== undefined ) {
objectCastShadow.setValue( object.castShadow );
}
if ( object.receiveShadow !== undefined ) {
objectReceiveShadow.setValue( object.receiveShadow );
}
if ( object.shadow !== undefined ) {
objectShadowRadius.setValue( object.shadow.radius );
}
objectVisible.setValue( object.visible );
objectFrustumCulled.setValue( object.frustumCulled );
objectRenderOrder.setValue( object.renderOrder );
try {
objectUserData.setValue( JSON.stringify( object.userData, null, ' ' ) );
} catch ( error ) {
console.log( error );
}
objectUserData.setBorderColor( 'transparent' );
objectUserData.setBackgroundColor( '' );
updateTransformRows( object );
}
return container;
};
|