# Cycles Nodes - object location in another object's space?

• The Object Info node gives me access to the location of the shaded object('s origin) in World Space
• The Texture Coordinate node gives me access to the coordinates of the shading point in the Object Space of any object.

How in a shader tree, could I retrieve the location of the shaded object in another object's space? For instance, the location of the shaded object in its parent's space?

Somehow apply the parent's inverse transform to the Object Info > Location?

• Subtracting Combine XYZ (drived with parent world coordinates) from Object Info - is not what you are looking for? – Serge L Mar 11 '19 at 5:56
• @Serge L That is a partial solution, yes, as long as you can be sure that only translations are involved? Maybe the best that can be reached conveniently. It just seems odd to me that location isn't available in other bases.. you could do it in OSL, I think, if Cycles had it fully hooked up.. you could get to the transformation matrices of named objects.. but I don't think it's there, in the Cycles implementation. – Robin Betts Mar 11 '19 at 6:23
• @Serge L maybe rotations are all that screw it.. by taking the transformed 0,0,0 and 1,1,1 you could deal with translation and scale... – Robin Betts Mar 11 '19 at 6:40
• Too bad, it is currently not implemented. You can track it here : developer.blender.org/T52154 . Related question : blender.stackexchange.com/questions/81793/… – cppBeginner Jul 17 at 1:21
• @cppBeginner Thanks for bringing me back to this question! I'd forgotten it. Not in OSL.. it doesn't provide the space of a named object? But ordinary shader nodes can do it.. see answer. – Robin Betts Jul 17 at 7:54

• Wow. Thank for sharing. Do you know any other nodes that receive Object as input besides "Texture Coordinate"? e.g. Is it possible to get the object name in string? – cppBeginner Jul 17 at 8:13
• Don't think so, other than self ... there's Object Info > Location, (which I could have used here) and Camera space is available via Camera Data, ( So, for example, you could tell where the camera is, without using drivers, the way many people do.. I think I've done that myself..) – Robin Betts Jul 17 at 8:23