Custom properties in existing classes
See original GitHub issueSome generically named properties like speed and rotating and paused etc. don’t really belong directly in existing classes IMO. I’d like a .custom property (a simple hash) that I can assign such properties to. Not in extensions of existing classes, but in their objects:
var block = new THREE.Mesh(geo, material);
block.custom.speed = 1; // instead of block.speed = 1
block.speed is not very safe, forward compatibility wise, especially with the lib being in dev.
Assigning my own .custom to the prototype won’t work however, because then all objects share 1 custom hash:
THREE.Object3D.prototype.custom = {};
It’s a feature request, but very simple: add this.custom = {}; to the Object3D constructor.
Issue Analytics
- State:
- Created 12 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Use Custom Properties for a Class - CloudShare Support
Go to the Class Details page of the class where you want to add or edit custom properties. · Click the Properties tab....
Read more >Using CSS custom properties (variables) - MDN Web Docs
Custom properties (sometimes referred to as CSS variables or cascading variables) are entities defined by CSS authors that contain specific ...
Read more >A Complete Guide to Custom Properties | CSS-Tricks
Everything important and useful to know about CSS Custom Properties. Like that they are often referred to as "CSS Variables" but that's not ......
Read more >4. Implementing a Custom Property Class - Python Courses eu
We define a class with the name 'our_property' so that it will not be mistaken for the existing 'property' class. This class can...
Read more >Make Java Properties available across classes?
Load the properties once using and store the Properties somewheres that others classes can pull from. If that is a MyProperties ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

To be honest, I don’t yet understand what you wanted. But if you think this issue is closed, then it’s closed 😃
But… couldn’t you do that on the application level? Sometimes I add my custom data to objects on my apps just like this: