Yes, I know about not using multiple events. I was playing with that, I thought that's the reason the button was not being called
Thank you @ferdinand
Yes, I know about not using multiple events. I was playing with that, I thought that's the reason the button was not being called
Thank you @ferdinand
Hi there, it throws no error. That’s the reason I don’t know what causes that! While I am using what Documentation says.
def oc_floor_material (self):
doc = c4d.documents.GetActiveDocument()
oc_material = c4d.BaseMaterial(1029501)
oc_material.SetName("Magic_Floor")
oc_material[c4d.OCT_MATERIAL_TYPE] = 2516
oc_multi_shader = c4d.BaseShader(1019397)
oc_material[c4d.OCT_MATERIAL_DIFFUSE_LINK] = oc_multi_shader
oc_material.InsertShader(oc_multi_shader)
c4d.CallButton(oc_multi_shader, c4d.MGMULTISHADER_ADD)
for index, file_path in enumerate(self.get_selected_filess()):
_, file_name = os.path.split(file_path)
file_name_lower = file_name.lower()
oc_base = c4d.BaseShader(1029508)
oc_correct = c4d.BaseShader(1029512)
oc_multi_shader [1050] = oc_base
oc_multi_shader [1051] = oc_base
oc_base[c4d.IMAGETEXTURE_FILE] = file_path
oc_base [c4d.ID_BASELIST_NAME] = "Color"
oc_base[1118] = 1
oc_material[c4d.OCT_MATERIAL_DIFFUSE_FLOAT] = 1
oc_multi_shader.InsertShader(oc_base)
c4d.EventAdd()
doc.InsertMaterial(oc_material)
edit (@ferdinand): Please use forum markup to embed code. See forum-features for details. Please also follow our support-procedures. Please also consolidate your postings. I have fixed your posting.
@sydney_ko said:
MoGraph Multi Shader belongs to C4D. To increase the number of inputs, I must click on add button. But it doesn’t do anything with my code
Guys, has anyone tried to call the add button of MoGraph multi shader?
I used c4d.CallButton (oc_multi, C4D.MGMULTISHADER_Add) but it keeps failing
hello,
I'm new here. I'm trying to create an import button to import only tiff files. but it still shows all types of files when the file browser gets opened. any help? Is there a thing to import multiple files?
c4d.storage.LoadDialog(c4d.FILESELECTTYPE_IMAGES, "Select Images", c4d.FILESELECT_LOAD, force_suffix=["tiff"])