PDA

View Full Version : Xpresso custom attributes ?


InfinitySpiral
01-05-2013, 01:30 PM
Hi I am new to xpresso and Cinema 4D and have few questions.I have previous experience with Softimage ICE and Houdini .
Is it possible in xpresso to store custom data and using it later inside the same xpresso tag.
The simplest example would be to store point position as a custom attribute of geometry and than use it in later state in same xpresso tag.From looking around all I could find is, people use duplicate of the same geometry and using it as a reference for the point position .
And how about custom attributes saved per point or per object and possibility to transferring them from one object to another.From what I am seeing this is not possible or maybe I am missing something.Also as I see xpresso doesn't have dynamic atributes like point velocity, mass, friction and point generators but if it had you wouldn't need TP I guess :) .

It's great that you can drag any attribute and control it but not be able to store custom attributes and be able to transfer them from one object to another it
it makes xpresso somehow limited only to simple piping and math operations(expressions).
I tried to use Python node but this is also kind of limited from what i see because the data it's self contained and you can't pull it later with node like get data for example.
As I saw in TP you kind of have that ability to store data to particle groups and than pass it to another group but in Xpresso this seems not possible.And TP looks kind of slow to me.
Simplest thing I need right now is a way to save custom attributes, so is this posible some how in xpresso?
I like Cinema 4D a lot , especially after R14 but I think Maxon needs to boost xpresso a lot (use ICE as reference for example)and make it multithreaded. Than Cinema will be best 3d application that has a great workflow and simplicity combined with flexibility.

littledevil
01-05-2013, 03:21 PM
hi,

xpresso is quite old compared to Ops and ICE (alomst 9 years now). as a result of
that xpresso is a lot more conservative when it comes to complex setups, because
it was once build for computationally less intensive tasks. but this doesn't mean
things are impossible in xpresso. Xpresso wants to be more a link value x in a cyclic
fashion to value y language, rather than a implement the newest IK-algorithm
within 24 hours language. for your specific question - there are three ways to store
data in xpresso.

the first one would be a memory node. it stores input data up to a defined history level.
a history level of three means, that you can look up to three values into the past.

then there are userdata. userdata are c4ds way to store specific user data. they
can be attached to everything, objects/tags/nodes/etc, because they are just
a graphic frontend for the methods c4d itself uses to store data in a document
(descriptions/basecontainers). due to this relation userdata also have the same
interface as native c4d objects have - the attribute manager. to add user data,
simply select the object/tag/material/node/whatever you want to host the data.
the attribute manager will now display the object. in the attribute manager menu
bar click on UserData/Add User Data. this will give you an interface for userdata
creation. after that you can access the userdata in the xpresso node interface
just like any other node value.

the last option would be python/coffee. both scripting languages a tied directly into
xpresso with their respective nodes. this is the most versatile method to store data
(as a global variable in a script node). this would also be the way to store large data
arrays and compute them.

one of the major drawbacks of xpresso is that it cannot compute arrays per default.
a port always means a single ouput or input. unlike ICE or OPs you cannot directly
work with arrays of data (unless you use some hacky methods like storing your data,
in the vectors of a point object for example). if you want to do this kind of things
within c4d you should use python nodes or scripts and do all the stuff inside them.

my conclusion - although xpresso is at its core quite similar to ICE and the operator
system of Houdini, there are some huge difference in ways how they are meant to
be used. while Ops and ICE were clearly designed as visual programming languages,
Xpresso never denies the fact that it is also one, but it does not emphasize this
characteristic as clearly as Ops and ICE it do.

because maxon did quite well with this approach, it is very unlikely that they will
change their mind in the near future and rebuild xpresso to something that is more
like ICE or Ops.

Srek
01-05-2013, 03:27 PM
Storing single data elements is easy using the memory node, user data or in case or TP particle channels. What isn't easy is storing data fields. Everything that needs an iteration to be accessed can not be stored using Xpresso, you should look for a Python or COFFEE solution in this case.

InfinitySpiral
01-05-2013, 04:22 PM
Little_Devil Thank you very much for the fast respond .Yea I actually found that you can store single data elements on custom user data but my point was more how to store point position data for example or any attributes based on group of points, sorry for not being clear .The terminology here is a little bit different than ICE and Houdini.In ICE and VEX VOP in general you don't have to iterate trough points on the object because they are represented as per point data on object as you mention. I didn't know about the memory node and I will check it out.
Srek Thank you for clearing that.I hope this will get improved in future.

littledevil
01-05-2013, 05:41 PM
Little_Devil Thank you very much for the fast respond .Yea I actually found that you can store single data elements on custom user data but my point was more how to store point position data for example or any attributes based on group of points, sorry for not being clear .The terminology here is a little bit different than ICE and Houdini.In ICE and VEX VOP in general you don't have to iterate trough points on the object because they are represented as per point data on object as you mention. I didn't know about the memory node and I will check it out.
Srek Thank you for clearing that.I hope this will get improved in future.

those limitations i have described also apply to the memory node. c4d does not allow
you to create data arrays at all. even c4d itself uses an iterative approach when comes
to arrays (particles), such data is passed one by one through the ports and the connected
nodes are executed multiple times for each calculation. the only 'workarround' for this is
using a data type that natively supports arrays like a PointObject and store your data
within this array (the point vectors). or you pass your data one by one into python node
which builds internally an data array. but you won't be able to pass this array out of that
python node due to the array limitation unless you use the described 'workarround'.

edit :the most common workflow for that what you described woulf be in c4d.

1. create a bunch of (object) nodes which contain data you need
2. create a python node
3. for each node : feed the whole node data with a link port into the python node
4. do stuff in python

at least i am doing it that way. the advantage is you do not have to know the whole
c4d api, you can just point and click the data you need. (compared to a script or plugin).

InfinitySpiral
01-05-2013, 05:59 PM
Thanks again this is very helpful.

CGTalk Moderation
01-05-2013, 05:59 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.