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
    • Recent
    • Tags
    • Users
    • Login

    accessing paint tool command

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 463 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

      On 22/09/2014 at 06:55, xxxxxxxx wrote:

      hi everyone.. i have a python script that create dinamically a vertexmap based on the mesh topology, and assign it to every vertexmap shader in the material of the object.. i want to dinamically apply on the vertex map  the command "apply to all" of the paint tool (managing also the settings.. smooth, bleed, etc). Is it possible?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 22/09/2014 at 15:45, xxxxxxxx wrote:

          
        #This script activates the vertex paint tool. And executes the "Apply All" button  
        #Get the ID's from here:  ..\..\..\..\resource\modules\ca\res\description	oolcapaint.h  
          
        import c4d  
        def main() :     
          
          doc.SetAction(1021286)  #Makes the paint tool active  
          tool = doc.GetAction()  
          tool = c4d.plugins.FindPlugin(tool, c4d.PLUGINTYPE_TOOL)       
          c4d.CallButton(tool, c4d.ID_CA_PAINT_TOOL_APPLY_ALL)  
           
          c4d.EventAdd()  
          
        if __name__=='__main__':  
          main()
        

        -ScottA

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 22/09/2014 at 23:49, xxxxxxxx wrote:

          thankyou for your reply! i'll try it

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 23/09/2014 at 00:50, xxxxxxxx wrote:

            i don't get how to set the settings of the tool.. the data container of the plugin is empty.

            plus i wish to make it work on a only-in-memory object (not an object placed in the document)

            basically what i'm trying to do is to retrieve the object from a cache a generator(hypernurmbs,loft, custom generator) build a vertexmap on it based on some rules, dinamicaly change the vertexmap (most of all smoothing it), assign the vertex map to the generator and place it in the vertexmap shader of the material. i only miss the dinamic smoothing of the vertex map

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 23/09/2014 at 01:27, xxxxxxxx wrote:

              all righ.. i've found the enum for the tool and now i'm accessing the data..

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                On 23/09/2014 at 01:59, xxxxxxxx wrote:

                allright.. i have an issue, this code:

                tool[ID_CA_PAINT_TOOL_SMOOTH]=int(smooth)
                tool[ID_CA_PAINT_TOOL_SPLINE]=op[ID_USERDATA,4]
                tool[ID_CA_PAINT_TOOL_MODE]=6
                c4d.CallButton(tool, c4d.ID_CA_PAINT_TOOL_APPLY_ALL)
                tool[ID_CA_PAINT_TOOL_MODE]=3
                c4d.CallButton(tool, c4d.ID_CA_PAINT_TOOL_APPLY_ALL)

                raise an invalid cross-thread call error. it's illegal.. i think that is for the button calling... what can i do?

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 23/09/2014 at 02:23, xxxxxxxx wrote:

                  here is messy.. during the animation every frame raise the cross-thread error.. how can i apply the vertex map modification without problem? anyone... please... sigh...

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