Skip to content

Conversation

@marwie
Copy link
Contributor

@marwie marwie commented Dec 8, 2025

Related issue: #32485

Description

Currently the inspector does not provide access to the objects and keys that are being controlled by the inspector UI.

This PR adds storing the parameters (object + key) in the parameters group to be accessible for external inspector tools (e.g. chrome extensions).

This contribution is funded by Needle

@sunag sunag changed the title Store parameters object+key Inspector: Store parameters object+key Dec 8, 2025
this.paramList = new Item( name );

/** @type {Array<{ object:object, key:string, editor:object, subItem:Item }>} */
this.data = [];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this.objects?

};

}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some spaces in the code; you might need to format it using mrdoob code style.


this._addParameter( object, property, editor, subItem );

this._registerParameter( object, property, editor, subItem );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add _registerParameter() inside _addParameter() to simplify the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's what I did at first but the button method didnt call _addParameter - maybe an oversight?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add a method exception for the button; that would simplify things anyway.

/** @type {List} */
this.paramList = paramList;

/** @type {Array<ParametersGroup>} */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to remove the js-doc now; we can do this entirely in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this just be extra work later?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because it needed to be redone anyway.
You can follow js-doc? The style of js-doc we use is different.

Copy link
Contributor Author

@marwie marwie Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed :) If you prefer I can remove it (or change it to match the style if you can point me to an example or docs). I feel comfortable with js-doc (use it a lot in our js projects)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
* Adds the given vector to this instance.
*
* @param {Vector3} v - The vector to add.
* @return {Vector3} A reference to this vector.
*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants