PDA

View Full Version : Need some help to get started with COFFEE


schyzomaniac
11-11-2009, 08:38 AM
Hi
I'm trying to dive into coffee, but it seems harder than I imagined to get the information I need. So I'm looking for a couple of quick'n'dirty answers to get my studies going.

- Right now, I'm basically just interested to type some coffee code using the coffee tag. What would be a good resource to help me learning?
I downloaded the SDK and the COFFEE SDK from maxon.net, but it's mostly C++ oriented. I'm looking for a decent help like the MEL or maxScript reference that come with Maya and 3ds max. Those have really good examples and explanations, as well as a great hyperlinked reference of all the commands.

- Is it possible to write into a textfile using the coffee tag?

If so:
- How do I open a file?
- How do I write data?
- How do I close a file?

I'm looking for the fastest solution. Path, filename, etc can all be hardcoded. It doesn't need to be elegant code.

But as stated above, the most important thing right now, would be access to a good documentation.

cheers,
Daniel

tcastudios
11-11-2009, 09:30 AM
Make sure you have dloaded the COFFEE SDK 95
under "Older SDK Downloads".

http://www.maxon.net/support/for-developers/older-sdk-downloads.html

Under References you have most of the info there is.

I.e. for reading and writing files see "Files" -> "BaseFile"

Cheers
Lennart

schyzomaniac
11-11-2009, 09:54 AM
Thanks Lennart
That documentation is much, much better than what I downloaded so far. This will definetly help me further.
Unfortunately (or fortunately, depends on) it already answered one of my questions.

"To avoid the possibility of C4D being used to spread viruses, C.O.F.F.E.E expressions (those that are included in .c4d files) cannot use any file functions or classes."

So I guess I can't access files with the coffee tag.

cheers,
Daniel

tcastudios
11-11-2009, 10:29 AM
You can read and write files using the ScriptManager, it
works the same as a COFFEE Menu plugin.

If you must treat files while running you can make a
COFFEE expression tag plugin.
Works the same as a COFFEE Tag.
You'll find a basic example in
COFFEE SDK 95 -> examples -> Basic Frameworks -> expressiontagplugin.cof

Cheers
Lennart

schyzomaniac
11-11-2009, 10:50 AM
Thanks again for all the infos.
Since I'm new to cinema, I only understood half of what you said in your last post, but the example you pointed me to will help me out for sure. ;)
Other than that, I guess it will just take some time to get used to all the different ways to solve problems in C4D.
I'm starting to learn my way around cinema since a couple of weeks, mostly with the courses offered at fxphd.com. So far it's looks like a powerfull, but yet beginner friendly app. But for my workflow I am missing a reliable way to get the camera data from cinema to nuke.
It's actually not that hard to write a .chan exporter (did one in xsi), so I wanted to give it a try with coffee.

Thanks again for all the pointers!
Daniel

CGTalk Moderation
11-11-2009, 10:50 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.