提交 4d3da59e 编写于 作者: M Mr.doob

Editor: Added button for generating new UUID.

上级 c184fec3
...@@ -12,10 +12,17 @@ Sidebar.Object3D = function ( signals ) { ...@@ -12,10 +12,17 @@ Sidebar.Object3D = function ( signals ) {
// id // id
var objectIdRow = new UI.Panel(); var objectIdRow = new UI.Panel();
var objectId = new UI.Input().setWidth( '150px' ).setColor( '#444' ).setFontSize( '12px' ).setDisabled( true ); var objectId = new UI.Input().setWidth( '115px' ).setColor( '#444' ).setFontSize( '12px' ).setDisabled( true );
var objectIdRenew = new UI.Button( '' ).setMarginLeft( '7px' ).onClick( function () {
objectId.setValue( THREE.Math.generateUUID() );
update();
} );
objectIdRow.add( new UI.Text( 'Id' ).setWidth( '90px' ).setColor( '#666' ) ); objectIdRow.add( new UI.Text( 'Id' ).setWidth( '90px' ).setColor( '#666' ) );
objectIdRow.add( objectId ); objectIdRow.add( objectId );
objectIdRow.add( objectIdRenew );
container.add( objectIdRow ); container.add( objectIdRow );
...@@ -259,6 +266,7 @@ Sidebar.Object3D = function ( signals ) { ...@@ -259,6 +266,7 @@ Sidebar.Object3D = function ( signals ) {
if ( selected ) { if ( selected ) {
selected.id = objectId.getValue();
selected.name = objectName.getValue(); selected.name = objectName.getValue();
if ( selected.parent !== undefined ) { if ( selected.parent !== undefined ) {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
THREE.Math = { THREE.Math = {
PI2: Math.PI * 2, PI2: Math.PI * 2,
generateUUID: function () { generateUUID: function () {
// http://www.broofa.com/Tools/Math.uuid.htm // http://www.broofa.com/Tools/Math.uuid.htm
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册