Accessing parameters of objects in OM [solved]
-
On 02/08/2016 at 04:29, xxxxxxxx wrote:
(solution) Sorry I just realised to modify an object with a python node, an instance needs to be fed into the link port rather than the object directly, I used the Object Index node to get the instance output, check the updated dropbox link below, alternative solutions welcome!
Hello,
I'm trying to control spline point handle/tangent properties, this is not possible via xpresso so my approach is to try it with a python node, since I am comfortable with xpresso.
My progress so far: https://www.dropbox.com/s/pxyzf5m7bmnx2jn/SplineTangentPython.c4d?dl=0
It seems to be setting the tangent without issue, except its not applying the new tangent value to the spline.Sorry I know I'm really out of my depth here, but I was hoping someone could point me in the right direction.
So far I've seen methods to affect an object which is "active"/selected, or access the object which the xpresso tag is attached to, or access object at top of the OM list, but I can't find a way of just getting access to an object in the object manager by name. I don't mind using the active object approach, but since this is a python node I believe it would change/break as soon as I select some other object as I carry on working in my scene. And all the other approaches also seem volatile, what if I want to do the process with more objects etc.
-
On 02/08/2016 at 04:40, xxxxxxxx wrote:
For example, based on the info from this thread:
http://www.c4dcafe.com/ipb/forums/topic/81563-access-object-from-python-node-in-xpresso/I can get my node to work if I put this in my python node:
op.GetNodeMaster().GetOwner().GetObject().SetTangent(1,Input2*-1,Input2)This works because the xpresso node is attached to the spline in question.
My question is, is it possible to modify the spline using an input port (link port) like in my example, or is it possible to modify/access the spline (or any other object in Object manager) via it's name.
Using a link port would be my favoured solution since this will allow me to iterate link lists etc in xpresso and batch affect them using the python node. -
On 02/08/2016 at 05:02, xxxxxxxx wrote:
There's a "Link" input port type in the Python node:
Cheers,
Niklas