Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Project filesize increase

    Scheduled Pinned Locked Moved PYTHON Development
    1 Posts 0 Posters 103 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 03/05/2012 at 12:57, xxxxxxxx wrote:

      Hello,

      Hoping someone might know the reason for this problem which is affecting my C4D project.

      I'm using a Python script to change the alpha value of a series of textures which are applied to objects in my scene. An ObjectList node iterates through the objects and once I have identified the material tag associated with the object I set its alpha.

      It has all been working well but I've noticed things slowing down in my project file and just noticed that the file size is increasing for no obvious reason! I suspect that the materials which I'm updating are somehow storing the data they are being set with by my Python script. When I delete the materials the file size goes down substantially.

      The snippet of code I'm using to change the material alpha is:

      mat = tag.GetMaterial()

      alphashader = c4d.BaseList2D(c4d.Xcolor)
      alphashader[c4d.COLORSHADER_COLOR] = c4d.Vector(alphaValue) #assigning value of half transparence
      mat[c4d.MATERIAL_ALPHA_SHADER] = alphashader #set the shader to the alpha channel
      mat.InsertShader(alphashader)
                      
                          
      #internal update of the material
      mat.Update(True, True)
      mat.Message(c4d.MSG_UPDATE)
      c4d.EventAdd()

      Hope you can help!

      1 Reply Last reply Reply Quote 0
      • First post
        Last post