Strange behavior Layer Shader



  • On 09/09/2013 at 01:48, xxxxxxxx wrote:

    Because you cannot add images to a layer in for example the luminance channel, I defined a default material with a layer with 3 images in the luminance channel.
    For test purposes I print out the names and the file names of the images.
    However, when I change the sequence (the order) of the images in the layer, when printing the sequence (the order) does not seemed to be changed.
    Am I missing something here?

    import c4d
    #Welcome to the world of Python
      
    def main() :
      
        mat1 = doc.SearchMaterial("MatPython")
        shd = mat1[c4d.MATERIAL_LUMINANCE_SHADER]
      
        lshd1 = shd.GetDown()
        print "lshd1 naam filenaam:",lshd1[c4d.ID_BASELIST_NAME], lshd1[c4d.BITMAPSHADER_FILENAME]
        lshd2 = lshd1.GetNext()
        print "lshd2 naam filenaam:",lshd2[c4d.ID_BASELIST_NAME], lshd2[c4d.BITMAPSHADER_FILENAME]
        lshd3 = lshd2.GetNext()
        print "lshd3 naam filenaam:",lshd3[c4d.ID_BASELIST_NAME], lshd3[c4d.BITMAPSHADER_FILENAME]
      
      
    if __name__=='__main__':
        main()
    


  • On 09/09/2013 at 01:54, xxxxxxxx wrote:

    Update:
    I change the sequence (the order) manually, so I see the changed sequence (order) in the material, but not when I run the script.  Then the sequence (order)does not seem to be changed?
    Here a more simpler script, printing all image names + files under the layer in the luminance channel.

    import c4d
    #Welcome to the world of Python
      
      
    def main() :
        mat1 = doc.SearchMaterial("MatPython")
        shd = mat1[c4d.MATERIAL_LUMINANCE_SHADER]
      
        lshd = shd.GetDown()
        while lshd is not None:
            print "lshd naam filenaam:",lshd[c4d.ID_BASELIST_NAME], lshd[c4d.BITMAPSHADER_FILENAME]
            lshd = lshd.GetNext()
      
    if __name__=='__main__':
        main()
    


  • On 10/09/2013 at 04:32, xxxxxxxx wrote:

    Any suggestions: program error, c4d error?



  • On 11/09/2013 at 06:15, xxxxxxxx wrote:

    Anyone?
    It is getting very frustrating?
    What I see is not what I get!?



  • On 11/09/2013 at 09:37, xxxxxxxx wrote:

    Hi Pim,

    sorry I did not have the time to look at your topic until now. As I mentioned in your other posting, after I corrected myself,

    Originally posted by xxxxxxxx

    That you can not add new shaders or re-order them is also not possible with C++ (or at least not ovbious from the documentation).

    The order in the shader hierarchy does not represent the order in the layer shader. I can not tell you why this is the case, but it's been this way forever. Not even the C++ API (seems to) offer(s) the ability to reorder the shaders. I can ask the developers about the C++ API if you want, maybe there is something undocumented. But since you are using Python, you are limited in that anyway.

    Best regards,
    -Niklas



  • On 11/09/2013 at 11:05, xxxxxxxx wrote:

    Ok, thanks.
    The keyword is "not possible to re-order".


Log in to reply