[Closed] Disable user properties
DenisT has provided a great solution to your problem – but if I might suggest – you may want to additionally think about why your users are attempting to edit the User Properties.
On a recent project we had to manage a lot of User Properties and initially users were editing these properties by hand, making errors and creating more work for TAs. What was required was a UI that gave clear feedback about different objects in the scene and which attributes were applied.
A few things to take note:
-
writing and reading user properties can be finicky – especially when multiple lines are involved. Any text can go into a user property – so you will likely want to roll your own write function to ensure the items are valid. The built in one doesn’t do well with accidental carriage returns or newlines.
-
Lots of things use User Properties. Max uses it when you add/remove/clear UV channels for example. Some 3rd party plugins or scripts that users have individual installed use them. Choose a naming convention for your User Properties that are easily identifiable as that which belongs to your project.
-
I found using dotnet’s Listview a great way to show the user the applied User Properties. Roll your own draw methods to control icons associated with the object to help the user visualize their attributes. For example, a damage user property would show as a damaged object icon next to the object’s name.
-
There is psychology involved here in that the user should be encouraged to work WITH your system rather than ‘hacking’ their own solution and trying to fix it on their own. Hopefully they will trust the project’s tools to help them.
i stopped using user properties as a source of info interchange more than 8 years ago… because it’s too open for any user to overwrite. that was the main reason.
It’s also slower than getappdata, though that is only relevant if you are scanning all scene objects looking for one specific property.
sorry for a slight hijack, with the talk of getappdata/setappdata. has anyone got sample code of how its exported from the SDK ? i’ve looked at the utility example in the samples and I’m a little confused, with
GetAppDataChunk function, what/who is the owner class_ID/SuperClassID and how does that relate to the script version