Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi all
Is it possible to deactivate user data or a tab from xpresso?
Hi,
@Passion3D said in XPresso: enable/disable user data:
DESC_HIDE
DESC_EDITABLE
BaseList2D.GetUserDataContainer
.SetUserDataContainer
Cheers, zipit
Here's the test I took. By putting my script in a python tag on my object, it works. But in an xpresso python node, nothing happens. Test.c4d
If you delete the tag, keeping only the xpresso node, it doesn't work.
hi,
you almost have everything. You could simply create some port to ease your life. Here, I've added an input port for the object, a bool and an integer. Output port is replaced by a bool.
you can use GetDepth to be sure you can access a subdescid or your code could stop working.
You don't need the two "If" you can simply pass the value of the flag. (or in this case the inverse) I'm not using the ouput port here. But you should.
import c4d def main(): global Output1 Output1 = True h1 = obj.GetUserDataContainer() for descID, container in h1: if descID.GetDepth() < 2: continue if descID[1].id == UserDataID: container[c4d.DESC_HIDE] = not Flag obj.SetUserDataContainer(descID,container)
Cheers, Manuel
Work fine Thanks a lot Manuel