提交 b60af57e 编写于 作者: T tschw 提交者: Mr.doob

Editor: Fixed texture load issues. (#9487)

* Editor: Fixed texture load issues.

* Don't update twice, but forbid enabling empty maps.
上级 5a172915
......@@ -893,6 +893,8 @@ Sidebar.Material = function ( editor ) {
}
refreshUI();
}
if ( textureWarning ) {
......
......@@ -44,6 +44,11 @@ UI.Texture = function ( mapping ) {
name.style.border = '1px solid #ccc';
dom.appendChild( name );
var form = document.createElement( 'form' );
form.appendChild( input );
form.style.display = 'none';
dom.appendChild( form );
var loadFile = function ( file ) {
if ( file.type.match( 'image.*' ) ) {
......@@ -58,6 +63,7 @@ UI.Texture = function ( mapping ) {
var texture = new THREE.CanvasTexture( canvas, mapping );
texture.sourceFile = file.name;
form.reset();
scope.setValue( texture );
......@@ -79,6 +85,7 @@ UI.Texture = function ( mapping ) {
texture.needsUpdate = true;
scope.setValue( texture );
form.reset();
if ( scope.onChangeCallback ) scope.onChangeCallback();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册