Disabling user data


Hi everyone!
I’m wondering if there’s a way to gray-out some userdata when certain criteria are met…basically I would like to prevent some sliders to be edited while other switches are On). Can this be done with coffee or something else maybe ?



Well, it can be done with Python. However, not very comfortable.
See this Thread on plugincafe, there is an example of how to set the limit of a userdata entry. Using the same technique you should be able to grey it out or even hide userdata.



Hey, thanks for your advice, I’ll try to search those forums too… what i’m missing is probably how to call attributes (like hidden or disabled) for userdata. I’m trying to decript maxon SDK but sometimes its a bit off my reach :slight_smile:



look for a file in the resouces folder in your main c4d root folder that is called “lib_description.h.” this file will tell you what each value of a user data container does to the container(for example, hide is set to the integer 15, so by acessing the boolean contained in 15 you can hide,show the data).


This is so weird.
Right now I’m working on a C++ plugin using some hide description code in it. And I noticed that this code results in the ID value of 15:


The first thing I thought was. I gotta tell this to avd007 and tell him about it. And poof here you are talking about it the same time I found it.
That’s so spooky.:slight_smile:

I don’t know if this code: DESC_HIDE, TRUE works in Python. I haven’t tried it yet.



Hey guys, thanks for your reply!
I found that string…now its just a matter to learn how to use it :slight_smile: But basically its not a coffee or xpresso thing, Its only for python, right ?



interesting! it probably has to be something like:


but this only works on dynamic data objects(c4d user data is dynamic). this will not work with any long value… i think. curious to try it out tho! thanks for the heads up scott!


I just got a chance to test it and it works.
Here’s an example:

import c4d
from c4d import gui

def main():

	UD = op.GetUserDataContainer()		 #Get the the container for all UD entries

	for descId, container in UD:		   #Loop through all the id's in the container
	  if descId[1].id == 1:				#The specific UD you want to hide
	   if op[c4d.ID_USERDATA,1] == 0.1:	#If the UD value is set to 10%
		  container[c4d.DESC_HIDE] = True  #Set it to hidden in memory
		  op.SetUserDataContainer(descId, container) #Execute that hidden setting from memory

if __name__=='__main__':



This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.