Skip to content

Commit b8903a4

Browse files
committed
Editor: Auto select material in material browser.
1 parent 294246b commit b8903a4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

editor/js/Sidebar.Project.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,19 @@ Sidebar.Project = function ( editor ) {
222222

223223
container.add( materials );
224224

225+
// events
226+
227+
signals.objectSelected.add( function ( object ) {
228+
229+
if ( object !== null ) {
230+
231+
var index = Object.values( editor.materials ).indexOf( object.material );
232+
listbox.selectIndex( index );
233+
234+
}
235+
236+
} );
237+
225238
return container;
226239

227240
};

0 commit comments

Comments
 (0)