Skip to content

youdiaozi/c4d-prototype-converter

 
 

Repository files navigation

Cinema 4D Prototype Converter

This plugin aids you in converting your Cinema 4D Python plugin prototype to a plugin.

Script Converter

This tool converts a Cinema 4D Python Script to a CommandData plugin. Scripts you convert with this tool should have a main() function.

Features

  • The main() function will be automatically converted to a CommandData.Execute() method

Prototype Converter

This tool converts a Cinema 4D Python Generator or Expression Tag to a ObjectData or TagData plugin.

Features

  • Converts UserData to description resource files

  • Converts main() and message() functions in your Python code to the respective plugin member method (GetVirtualObjects(), Execute(), Message())

  • Replaces uses of op[c4d.ID_USERDATA,X] with the automatically generated resource symbols

FAQ

How to install the Plugin?

Downloading the source code from GitHub is not sufficient as it will not include Git submodules. Check the [Releases][] page to find the latest downloadable release or use a Git client to clone the repository recursively into your Cinema 4D plugins directory.

Where to find the Plugin in Cinema 4D?

After you have installed the plugin, you can find it in the Cinema 4D Script menu.

How does the code refactoring work?

We use the lib2to3 module from the Python standard library to parse and transform your code so that it (somewhat) matches the way it needs to be for Python plugins and to adjust the indentation.

Ideas for the Future

  • Report possible errors during conversion (eg. referencing the variables doc or op in global functions without previously declaring them)

Acknowledgements

This project is sponsored by Maxon US and was created for Cineversity.com's CV-Toolbox.


Copyright © 2018 Niklas Rosenstein

About

A Cinema 4D plugin to convert plugin prototypes to actual Python plugins.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Makefile 0.1%