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).
Hello! I would like to automate the replacement of materials loaded in Alembic.
How can I change the attached python code to replace the material with a material with the same name as the one applied in Alembic?
I would appreciate your advice.
I am new to the forum, so please forgive my unfamiliarity.
import re import c4d def main(): doc = c4d.documents.GetActiveDocument() oplist = doc.GetObjects() if not oplist: return matlist = doc.GetMaterials() if not matlist: return if oplist: for op in oplist: opname = op.GetName() mat = doc.SearchMaterial(opname) if not mat: for mat in matlist: mname = mat.GetName() mname = mat.GetName() match = re.match(opname, mname) if match: textag = c4d.TextureTag() textag.SetMaterial(mat) textag[c4d.TEXTURETAG_PROJECTION]=c4d.TEXTURETAG_PROJECTION_UVW op.InsertTag(textag) c4d.EventAdd() if __name__==‘__main__’: main()