PDA

View Full Version : Creating a custom 'function' in XPresso


cdesign
06-11-2007, 06:59 PM
I'm wondering if it's possible to create what I would call a custom 'function' in XPresso?

What I'm want to do is create a single XPresso script that contains a complex calculation (with three inputs and one output) and then use that script in many other XPresso scripts.

Now.. I've already tried to do this by creating an XPresso script (attached to a null object) and adding my own inputs and output to the root XGroup of the script. I then drag the XPresso tag that contains this 'function' script into another script (attached to an different object). This creates an Object node that references my custom script. I can then add input ports to this Object node for my three custom input values, but I don't seem to be able to add a port for my custom output -- it just doesn't show up in the contextual menu. Am I doing something wrong or am I just not understanding how XGroups can be connected?

thanks. john

Srek
06-11-2007, 07:38 PM
You can create this as a Group and store the group in the Xpresso Pool.
Cheeck the Xpresso pool for some examples.
The way you are currently trying is rather complicated and error prone in comparison.
Cheers
Björn

cdesign
06-11-2007, 08:04 PM
Srek.. I have looked at the Pool idea, but isn't something stored in the Pool just a preset? I want to be able to change the original script in one place and have the change felt throughout my project. Is that possible with an item in the Pool?

The root of my problem is that I have a complex calculation that I'm using throughout the a project. But I may need to change the calculation at a later date. I don't want to have to make changes in dozens of locations.

Srek
06-12-2007, 07:39 AM
Sorry, what you are looking for (instancing / subroutines) is not possible with Xpresso currently.
Cheers
Björn

cdesign
06-12-2007, 01:45 PM
How about with Coffee or a Coffee node inside of an XPresso script?

tcastudios
06-12-2007, 01:59 PM
Using a Coffee expressionTag plugin would most likely work.
You can then just edit the .cof file and reload Plugins and all tags will be updated.

Cheers
Lennart

tcastudios
06-12-2007, 02:07 PM
OTOH. If you have your xpresso tags you might have the parameters that you want to
change globaly "open".
Create a new "master " xpresso tag somewhere in the scene, drag all your "slave" xpresso tags into the master xpresso editor and connect userdata sliders to each open input.


Cheers
Lennart

CGTalk Moderation
06-12-2007, 02:07 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.