Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Fixed object changes out-of-sync with outliner options #28270

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 24 additions & 10 deletions editor/js/Sidebar.Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,11 @@ function SidebarScene( editor ) {

function getScript( uuid ) {

if ( editor.scripts[ uuid ] !== undefined ) {
if ( editor.scripts[ uuid ] === undefined ) return '';

return ' <span class="type Script"></span>';
if ( editor.scripts[ uuid ].length === 0 ) return '';

}

return '';
return ' <span class="type Script"></span>';

}

Expand Down Expand Up @@ -494,26 +492,42 @@ function SidebarScene( editor ) {

signals.refreshSidebarEnvironment.add( refreshUI );

/*
signals.objectChanged.add( function ( object ) {

let options = outliner.options;
const options = outliner.options;

for ( let i = 0; i < options.length; i ++ ) {

let option = options[ i ];
const option = options[ i ];

if ( option.value === object.id ) {

option.innerHTML = buildHTML( object );
const openerElement = option.querySelector( ':scope > .opener' );

const openerHTML = openerElement ? openerElement.outerHTML : '';

option.innerHTML = openerHTML + buildHTML( object );

return;

}

}

} );
*/

signals.scriptAdded.add( function () {

signals.objectChanged.dispatch( editor.selected );

} );

signals.scriptRemoved.add( function () {

signals.objectChanged.dispatch( editor.selected );

} );


signals.objectSelected.add( function ( object ) {

Expand Down