Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    1. Maxon Developers Forum
    2. GHebert
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    GHebert

    @GHebert

    0
    Reputation
    24
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    GHebert Unfollow Follow

    Latest posts made by GHebert

    • RE: Python script for texture baking

      Thanks, @m_adam!

      That should put me a step closer.

      posted in Cinema 4D SDK
      G
      GHebert
    • RE: Python script for texture baking

      Thanks for the response @pyr. We use Nuke to render out the UVs when a perspective camera can be used, but for some reason the spherical camera breaks the process.

      The UVs are tied to the geometry of the space, for example: a theater including walls and ceiling. We'll get a 3d model of the theater when the Lidar mapping is done and then we UV that. I'm not sure I understand your suggestion to render the texture on a plane with the correct uv layout. How would the theater UVs then be attached to a plane? I would love it if there was a clever way to do this that I hadn't thought of.

      posted in Cinema 4D SDK
      G
      GHebert
    • RE: Python script for texture baking

      The renders are spherical but the output needs to be baked out into UV space.

      These are for live event projections and the media server has a UV map of the space. So we create scenes in 3D and often render them spherically to preserve the 3D orientation of the scene, but the media server doesn't understand spherical projection so we bake them down.

      I'll have to look into callCommand.

      Would the command plug-in have to be installed on each render node? Could the callCommand be run from a python tag?

      posted in Cinema 4D SDK
      G
      GHebert
    • Python script for texture baking

      I'm working on a python tool for running the bake texture tag on launch of a project. The problem we have here is we do a lot of large scale animated spherical renders that need to be baked down to flat UVs. Running the bake texture tag on a single workstation can take hours and we often have a lot of them to do plus iterating the process every time there are revisions. We have a render farm but currently no way to distribute the baking process to the farm.

      What I'm trying to achieve is a script that will execute the bake texture tag when it's opened on a render node. For example, I'll set up a render to submit to our render farm through Deadline, but when the render node launches it will run the python script and bake the texture before it starts rendering.

      I wrote the following script that basically does what I want locally:

      obj = doc.GetFirstObject()
      tag = obj.GetFirstTag()
      doc.SetActiveTag(tag,c4d.SELECTION_NEW)
      c4d.CallButton(tag(), c4d.BAKETEXTURE_BAKE)
      

      It works as long as my object and bake texture tag are at the top of the hierarchy.

      I tried to put this into a python tag but I got an error:

      "RuntimeError: must be called from the main thread"

      So I guess I can't use the CallButton command from within the python tag.

      Any ideas how can get this to work?

      posted in Cinema 4D SDK
      G
      GHebert