Saturday, February 25, 2006

Gimp Gradient

dennishmiller over at CGTalk was wondering if it was possible to import gradients into Cinema 4D. Now to be honest, I had never heard of such fileformat before and already knew that Cinema 4D couldn't import such files so I set out to make an importer.

It turns out there are several gradient formats, but I chose the Gimp Gradient .ggr, because its uses a very easy text based file layout which made it alot easier to code into Cinema 4D.
Originally I wanted to be able to create an import plugin which would load the gradient, then create a standard C4D Material, and would assign the gradient to its color channel.
Sadly my knowledge of the Cinema 4D material/shader system is kinda limited and I ended up creating a whole new gradient shader that has a small little import button, of which you would select a .ggr file and the shader would create a necessary gradient for you.
Turn out quite well for a couple hours work me thinks.

Now the shader specifically works with .ggr files located at http://pdfb.wiredworkplace.net/cpt-city/www/
I been lazy with this one, and it does next to no error checking, so if the fileformat don't match exactly, it just wont import... but all the .ggr files located at that link worked fine.
Another thing to note, the shader ignores three settings stored in the gradient file,
1. The Blend type (because I don't have much control over this)
2. The Color Type (Shader uses RGB)
3. Alpha's (Cannot set an alpha value with C4D gradients, so i just ignored it)

Besides that, it looks like it works ok

You can download the windows version of the plugin by clicking this link: Clickey

Comments on "Gimp Gradient"

 

post a comment