Random Rotate 180º



  • On 07/11/2016 at 11:13, xxxxxxxx wrote:

    Hi, would you anyone be able to do a plugin that activates Tools>Arrange Objects>Randomize and rotates 180º on the Y axis? I do this all the time, so it would be great to have a one click solution. thanks!
     
    Greg



  • On 08/11/2016 at 12:31, xxxxxxxx wrote:

    Hi Greg,
    This can be done with a simple script.

    Put this code in the script manager and save it. Then drag the python icon to someplace in your UI.
    Every time you click it. The tool will execute and rotate the active object

    import c4d  
    def main() :      
        
      c4d.CallCommand(c4d.ID_MODELING_RANDOMIZE_TOOL)  
      tool = c4d.plugins.FindPlugin(c4d.ID_MODELING_RANDOMIZE_TOOL, c4d.PLUGINTYPE_TOOL)  
      if tool is not None:  
          rotY = c4d.utils.Rad(180)  
          tool[c4d.MDATA_RANDOMIZE_ROTATE] = c4d.Vector(0, rotY, 0)  
          c4d.CallButton(tool, c4d.MDATA_NEWTRANSFORM)  
            
      c4d.EventAdd()              
      
    if __name__=='__main__':  
      main()
    

    -ScottA



  • On 08/11/2016 at 20:37, xxxxxxxx wrote:

    You are awesome! Thank you ScottA!



  • On 09/11/2016 at 08:29, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Hi Greg,
    This can be done with a simple script.

    wow
    thats awesome
    thank you, incredibly useful


Log in to reply