Hello @lednevandrey,
Welcome to the Maxon developers forum and its community, it is great to have you with us!
Getting StartedBefore creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.
Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment. Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support. Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.
About your First QuestionThe issue with your script is that you never insert your bitmap shaders. A shader must be inserted into a scene graph just like any other node before it can be used. Referencing a shader in a shader parameter does not replace inserting a shader. While for shaders this might be a bit surprising for beginners, one can look at it from an generator object angle to gain clarity. You would not expect to be able to link a that cube object into the document first. From this angle it is a bit more obvious that shaders are not any different and must be inserted before being linked anywhere.
In most cases shaders are owned by the material which use them and inserted with c4d.BaseList2D.InsertShader(). But there is some complexity to how shaders are structured when shaders own shaders. See Base Shader Manual: Access and Structure (C++) for details. The manual is for C++ but also applies to Python.
So, for the displacement part it should be for example something like this.
import c4d import mxutils # ... path: str = storage.LoadDialog(type=c4d.FILESELECTTYPE_IMAGES, title="Select a texture for the Displacement channel") if path: # The mxutils.CheckType call is here so that we can be sure that allocation did not fail. Then # we insert the shader into the document by attaching it to the material which itself # is being inserted into the document. shader: c4d.BaseShader = mxutils.CheckType(c4d.BaseShader(c4d.Xbitmap) material.InsertShader(shader) # Now we can link the file in the shader, and shader in the material. A shader can only # be linked/used once by a material in the classic APU of Cinema 4D. So, if we wanted # to use #path twice, we would have insert a second shader for the second usage. shader[c4d.BITMAPSHADER_FILENAME] = path material[c4d.MATERIAL_DISPLACEMENT_SHADER] = shaderCheers,
Ferdinand