I have a bunch of scattered points, but I need somehow get Nulls on each point in /obj level.
Is there a way to do that?
Basically, I'm trying to export my scene with Houdini2Ae tool (https://vimeo.com/186204479) into after effects, and it selects object nodes in /obj level. As my points are inside the object, it doesn't read coordinates, but I don't want to do it manually either because I think it would be very stupid.
Is there a way to send each point coordinate up one level, and assign Null node?
If anyone of you is familiar with C4d, I'm trying to get “external compositing” tag and get 3d nulls and camera.
Scattered point positions to the nulls (obj level)
3218 12 2- brokenkeyframe
- Member
- 56 posts
- Joined: Sept. 2015
- Offline
- Andr
- Member
- 900 posts
- Joined: Feb. 2016
- Offline
- brokenkeyframe
- Member
- 56 posts
- Joined: Sept. 2015
- Offline
Andr
so you want to create as many new null nodes as your scattered points, and assign them their position?
You could do it in python, but it seems not very efficient to create so many objects..
Yes. I know it's not very efficient, but there is no other way to get nulls in Ae without doing so. I thought that python should do something similar, will try to look into it, thanks!
I just ditched C4d, and trying to recreate projects with Houdini. In all fairness, Houdini is great, but there are some caveats in Houdini/Ae workflow
- Andr
- Member
- 900 posts
- Joined: Feb. 2016
- Offline
- brokenkeyframe
- Member
- 56 posts
- Joined: Sept. 2015
- Offline
- tamte
- Member
- 8449 posts
- Joined: July 2007
- Offline
- brokenkeyframe
- Member
- 56 posts
- Joined: Sept. 2015
- Offline
tamteThanks for the reply, but this doesn't work.(or it might. but it is a quite long process to iterate).
To avoid scripting you can also make your points into packed primitives (by packing and copying something to them)
Then export as alembic and read on the scene level as alembic hierarchy
Talking about scripts, it might sound funny for some of you but I was able to get a position and print that position of each point.
print(p.attribValue("P"))
Edited by brokenkeyframe - July 14, 2019 15:34:35
- mrCatfish
- Member
- 731 posts
- Joined: Dec. 2006
- Offline
Create one null and call it “null0” or similar, and in the translation X, Y, Z, put these expression, (assuming the object with the points you want to have nulls for is called “TARGET”):
Now just Ctrl+C this node and Ctrl+v as many times as you need to. (You can just go into “update never” mode and hold down the paste key combo until you have a jillion nodes).
This extracts the digits from the name of the null, and uses this to look up the equivalent point number in the target object and find its position in X, Y and Z.
Sean
point("../TARGET", `opdigits(".")`, "P", 0) point("../TARGET", `opdigits(".")`, "P", 1) point("../TARGET", `opdigits(".")`, "P", 2)
Now just Ctrl+C this node and Ctrl+v as many times as you need to. (You can just go into “update never” mode and hold down the paste key combo until you have a jillion nodes).
This extracts the digits from the name of the null, and uses this to look up the equivalent point number in the target object and find its position in X, Y and Z.
Sean
Edited by mrCatfish - July 15, 2019 09:45:41
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
CG Supervisor
Machine FX - Cinesite MTL
- a1ex3d
- Member
- 4 posts
- Joined: April 2019
- Offline
In the CreateNull hda asset (in the script section) add inside loop
null.setParms({"t":pos})
if you have world transform in main geo (in most cases) add before loop
parent = node.parent()
trn = parent.worldTransform()
and inside loop mult pos with trn
pos = p.position()*trn
null.setParms({"t":pos})
if you have world transform in main geo (in most cases) add before loop
parent = node.parent()
trn = parent.worldTransform()
and inside loop mult pos with trn
pos = p.position()*trn
Edited by a1ex3d - Feb. 7, 2023 05:17:00
- toadstorm
- Member
- 359 posts
- Joined: April 2017
- Offline
Here's a quick and painless Python script you can run as a shelf tool. Includes orientations (orient attribute only) as well as positions from points.
import hou import toolutils def points_to_nulls(): # prompt for object to convert prompt = toolutils.selectionPrompt(hou.sopNodeTypeCategory()) scene_viewer = toolutils.sceneViewer() sel = scene_viewer.selectObjects(prompt) for index, i in enumerate(sel): out = i.displayNode() geo = out.geometry() name_prefix = i.name() # iterate over all points and get position/orientation for pt in geo.iterPoints(): pos = pt.position() rot = None try: rot = pt.attribValue("orient") except hou.OperationFailed: pass # if there's an orient attribute, convert to eulers if rot is not None: rot = hou.Quaternion(rot).extractEulerRotates() # create a new null and apply transforms nullname = name_prefix + "_" + str(index+1) null = hou.node("/obj").createNode("null", nullname) null.parm("tx").set(pos[0]) null.parm("ty").set(pos[1]) null.parm("tz").set(pos[2]) if rot is not None: null.parm("rx").set(rot[0]) null.parm("ry").set(rot[1]) null.parm("rz").set(rot[2]) points_to_nulls()
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
- MirHadi
- Member
- 143 posts
- Joined: July 2015
- Offline
toadstorm
Here's a quick and painless Python script you can run as a shelf tool. Includes orientations (orient attribute only) as well as positions from points.
That's brilliant.
I want to do the opposite, I have a bunch of tracked points from 3DEqulizer (obj level) and I want to make a point cloud out of nulls (sop level) in order to generate a mesh properly.
would you please show me how I change the script to do that?
thank youuuuuuu
Edited by MirHadi - Feb. 10, 2023 06:05:33
- CYTE
- Member
- 669 posts
- Joined: Feb. 2017
- Offline
- MirHadi
- Member
- 143 posts
- Joined: July 2015
- Offline
-
- Quick Links