Skip to content

Conversation

@GeorgeFuller
Copy link
Contributor

Context

There is currently no easy way to identify an actor when it is picked out of context of it's pipeline.

Results

GetObjectName and SetObjectName can now be called on actors.

Changes

Added objectName to the default values of actor along with a macro for get and set. This provides a feature that the c++ vtk library already has and matches its naming convention.

Testing

Tested within the context it was required, the CellPicker example, the example now console logs the name applied to the cone source when it is clicked.

@jourdain
Copy link
Collaborator

In vtk C++ those methods are on the vtkObject class, not on the actor. Which means, you should add them on the obj macro, not on the actor.

Also by default vtk.js let you add any attribute by calling obj.set({ objectName: 'Hello' }, true, true) and obj.get("objectName").objectName. Those are not as convenient as having a native function, but they do exist.

Copy link
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

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

please do not commit package-lock.json

@jourdain jourdain self-requested a review January 19, 2026 22:10
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.

3 participants