1

I was wondering if there is a way to hide custom properties we add to objects in our add-ons - to keep them from being displayed on the side (N) panel: enter image description here

Some type of "internal only" option?

As an artist, I've always hated how addons clutter up this area. Especially when we (the user) want to maintain our own custom properties that get exported to game engines and such. It makes a mess. I saw a similar question here Hide custom properties in the UI panel with python, but I believe it was misunderstood.

Robert
  • 1,265
  • 1
  • 13
  • 29
  • 1
    Have you considered storing your data on global properties (bpy.props) or in a external file? (a .txt file in the addon folder should do the trick) – Tareyes Sep 08 '19 at 21:24
  • Would there be a way to store object-specific properties in those? For example, if I have an object reference, can I access the properties that relate to that object specifically? Or would I need to use some type of searching system? – Robert Sep 08 '19 at 21:42
  • That's the tricky part: if you are willing to use a single custom property (maybe on the scene, which custom properties are less used) to store a dictionary in, you could use that to store a list of the objects' id_data and the name they have in the .txt (for that you can use bpt.props to I guess). This way you still have a custom property, but one is less than 20... If not you could tag all the objects affected by your addon, so you can create a search system only between them based on the name (or even better, based on the name of their mesh, which name doesn't get changed often) – Tareyes Sep 08 '19 at 21:59
  • A modal timer would be perfect, because you can momentarily store the id_datas in your modal operator and trigger a simple function every minute or whatever that checks if their name have been changed (or you can just place that function in other modal operators if you have them in your addon). – Tareyes Sep 08 '19 at 22:08
  • If you have time to spare I guess you could even set up a subprocess in python, which is basically a parallel script that runs on python, not on Blender, where you can store all the variables you want: it's a bit faster and it's easier to change variables, but of course you still need a .txt to store your variables for future sessions. I say it's easier to change variables because in a .txt file if you want to change an old variable you need to re-write the whole file. – Tareyes Sep 08 '19 at 22:16
  • To sum up, if I had to do it, I would use a single custom prop with a huge dictionary in it (like dict = {"objList" = [], "mergeWith"=[[],[],[]], "MM"=[]}), or I would create a modal timer with a .txt, or even better a subprocess where I can write/read my data with a save_pre handler that tells the subprocess to save its variables in a .txt file (for long time storage/backup). The latter seems the best one, but I'm not putting it in an uffcial answer because I haven't tried it (maybe I will tomorrow). P.S. sorry for the thousands comments – Tareyes Sep 08 '19 at 22:23
  • Thanks for your advice. It would be a major modification, so I may try it with future add-ons. But I guess I will keep cluttering up the user properties for now. Hopefully they will at least give users an option to hide add-on properties in the future. Or maybe define two separate property locations - one for user and one for the system. – Robert Sep 09 '19 at 13:58
  • 2
    When Developer Extras is disabled, the properties should not show up... so artists won't see them (usually). – p2or Sep 10 '19 at 10:49
  • I forgot about seeing that option. I didn't even realize mine was enabled. That's fantastic. Thanks for pointing that out. Set it as the answer and I will accept. I assume they will still be part of the object when you export meta-data, but at least it isn't cluttering up the area, visually. – Robert Sep 10 '19 at 12:09

1 Answers1

0

p2or: When Developer Extras is disabled, the properties should not show up... so artists won't see them (usually).

Answer by p2or. Leaving this here until he returns and posts this as an answer. To sum it up, there is no reason to hide these properties because they are not shown to users unless Developer Extras is enabled.

Robert
  • 1,265
  • 1
  • 13
  • 29