View Full Version : Xpresso/Coffee query
10-20-2005, 09:41 PM
I have a series of questions about Xpresso and Coffee.
First is it true that Coffee runs faster then an Xpresso expression that does the same thing?
Next, is Xpresso simply a visual representation of some of the things that can be done with coffee?
If so, is it possible to 'export' a Xpresso expression into Coffee? Sort of like how Dreamweaver can be build in the design window, simply plugging in the code where it should go. (I know that dreamweaver's html isn't the cleanest)
Would it run faster as code if so?
If it can't, is that something that would useful to people?
It would be useful to me if nothing else just so I could start to learn coffee. I'm getting decent at Xpresso, learning a lot of new stuff about it everyday. There's just not enough hours in a day to learn everything!
Just some things I was wondering about today :)
10-20-2005, 10:07 PM
1) In some cases yes, in others no.
2) Not quite, there are some things xpresso can do that raw coffee currently can't, each node executes some C++ code.
3) No (see above).
4) See Above
5) Possibly, but i'd rather more effort was put into making xpresso faster, and an echo system ws put in place for each command that you call within cinema rather than looking to xpresso for that (after all expresso whilst being expressions also does a little bit more than that). I have a primer on using COFFEE and the COFFEE node on my website among the tutorials if you want to get started with it.
10-20-2005, 10:13 PM
Thanks for the fast reply mdme_sadie, I was hoping you'd pop in for the answer :)
I'm more than a bit hesitant to jump into coffee, I did once write enough to make a gear turn another gear in the pre-Xpresso days... Perhaps once I am a bit more comfortable with Xpresso and all it's nodes I will try and tackle the next step.
10-20-2005, 10:22 PM
Ooo, instead of starting another thread, quick (Hopefully!) question. I'm trying to get an Xpresso expression to, in the simplest possible example to...
Have tp emit particles.
after they collide with a deflection, they go to another pgroup.
Part I need help with...
-->Have a counter keep track of the total number of particles that have entered the new group. Not at a given time, but the total number to have even been in the group. As of now, the number decreases as soon as the particles die. So if by the end of the timeline, 99 particles have entered the group, the counter reads 99. Even if only a few of the particles are still alive (I need it so the particles die, there would be far to many, otherwise I'd just keep the buggers alive and keep it simple).<--
I hope my question is clear, this is just one application of this counter. I can think of many I could use it for. It's just the fastest way I could think to ask the question.
Thanks for any possible help!
10-20-2005, 10:32 PM
Create a userdata field on some object (like a null), and when the collision event occurs, as move the particle into the new group, increment the userdata value. You could just put in a COFFEE node, declare a variable, and increment that as well. I'm not sure which will be easier.
If you already have the particles switching groups on collision, then I think you're almost there.
10-20-2005, 10:35 PM
mdme_Sadie have been and are a fantastic helper in the coffee arena.
He, and a couple of others here at CGTalk have not hesitated to jumpstart many issues asked here.
My advice would be to get a little fluent with XPresso to get the feeling but as soon as possible use the COFFEE XPresso node. mdme_Sadie's COFFEE primer at his site is a very good start. And then when the COFFEE node feels "crowded" transfer the functions to a regular COFFEE Tag.
Second, have a project in your mind that you think will help in your own workflow.
Some sort of Gizmo/function that you miss in Cinema. This will make learning go faster since you know what you are after.
dload the SDK and get used to it. It is hard to get an overview what's in there(and what's not) but after a while you start to know what to look for at least.
Search "C.O.F.F.E.E" here at the forum and pretty much turns up!
As for speed XPresso vs COFFEE in my experience, (most of) the stuff I've moved over from XPresso to COFFEE runs much faster/smoother. But it could also be that setting the right order of nodes is harder in XPresso than getting it "correct" in COFFEE.
And as said, it really depends on what it is.
10-21-2005, 05:11 AM
Thanks for the advice tcastudios :), I think that I will try and ease into the depths of coffee as free time presents itself.
I'm attaching a file that shows where I am stuck right now. It's pretty straight forward. Any help would be... very helpful :bounce:
The reason it's not working is that pdeflector will give out results for all particles in the group that it is evaluating. Say you had three particles and the second one in the list was the one that had the collision, on that frame the pdeflector node would output "False:True:False". I don't think the math node can evaluate sub frame and will take the last value it gets so you will only see a change if it's the last particle in the list that has a collision, which is why it sometimes works.
10-21-2005, 05:28 PM
Thanks for the response JDP, I understand what you are saying. But I have no idea how to work around the subframe problem. Does anyone know how to address this issue? Anybody know any workarounds if there is no way to make my version work?
You could use a Coffee node (see attached). Or you could use a PPass node and get the particle count of the "To group" . HTH
10-21-2005, 07:19 PM
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.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.