Dynamically Add Massign to Material in Material Editor
-
I currently use
INCLUDE Massignin my .res file. However i would like to do this dynamically so that I can change the order at which it is placed in the Material Editor and Attribute Editor. Is there a way to do this?Additionally Also is there a way to hide settings from the Obaselist group or hide settings in the Material Editor but keep them in the Attribute editor?
-
Hey @ECHekman,
I currently use INCLUDE Massign in my .res file. However i would like to do this dynamically so that I can change the order at which it is placed in the Material Editor and Attribute Editor. Is there a way to do this?
There is no
INCLUDEwhich you could call programmatically inGetDDescription, but there is Description::LoadDescription. When Cinema 4D is asking you to update a certain part of your description, you could try to call it on your description instance but not with its id, butMassign. This is however very likely to fail or cause crashes, because your description is already being processed, I never tried this myself though.Another approach could be to allocate a dummy description, then load your resource (e.g.,
Massign) into that dummy description, to then copy parameters bit by bit into your active/actual description passed intoGetDDescription.But the whole approach of a 'dynamic include' is a bit backwards without context why it has to be this way. Because when you dynamically include something, this also means you have to remove existing data where it shall not be included anymore. Which is possible but unnecessary extra work. Also copying a whole partial description is not a great idea performance wise,
GetDDescriptionis being called a lot.The better approach would be to just include your partial description in your res file in the a place where it might appear and then dynamically change the parent of that container. As this workflow would be the common dynamic description workflow.
Additionally Also is there a way to hide settings from the Obaselist group or hide settings in the Material Editor but keep them in the Attribute editor?
No, both managers are more or less just a DescriptionCustomGui, they will always show the same data, unless you have access to the implementation (which you do not). When you would implement your own material dialog, with your own
DescriptionCustomGuiin it, you could mangle what is shown in this particular description view to your liking, there are multiple methods to highlight, filter, and modify a description on that class. To operate this dialog you would then set this description GUI to the material, shader or whateverBaseList2Dyou want to display, and then either filter or outright modify the description which is being displayed.Cheers,
Ferdinand