accessing paint tool command



  • 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?



  • 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



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

    thankyou for your reply! i'll try it



  • 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



  • 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..



  • 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?



  • 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...


Log in to reply