On 11/01/2013 at 13:25, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Isn't this the same as what I posted in my first post? And would this really create auser-defined material (one that the user set as default earlier)?
It depends on what the actual integer representation of the plugin ID for a vray advanced
material is. I do not not have vray, so i cannot test it, but i highly doubt it is 5703, because
third party plugin ids are usually longer. 5703 sounds more something that c4d uses for its
native 'types' . if i am wrong about the number, the code steve has posted is the same as
the code you have posted on your first posting. i think he just wanted to stress that it is
more convenient to use the string form of an ID than the actual number.
myVrayMaterial = c4d.BaseMaterial(c4d.ID_VRAYBRDF_MATERIAL)
that is the way in c4d to instantiate a subtype of an base class - you pass the plugin ID of
the subtype to the constructor of the base class. this also includes any type of plugin class
which has been derived from this base class.
i am not sure hat you mean with user defined. your code does the same , as if you would
createa material from scratch in the material editor. your code has nothing to do with loading
a material preset. if you want to do something like that you should check c4d.documents.