publishing/sharing camera object

   6176   13   2
User Avatar
Member
60 posts
Joined: Feb. 2011
Offline
I can't seem to figure this out or find any information on publishing assets, specifically a camera object. If I have a camera object with animated translation/rotations, what is the best way to share this with someone? I can delete everything else in the scene and save it for them to merge into their scene, but is there an easier method? I can't seem to figure out how to export the camera object into its own scene. i guess I can copy and paste it into a new scene and save, is that the best method?

thanks!
z
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi,
You can turn a camera into an asset just like anything else in Houdini. simple scene attached with otl.

Things to note with otls.

Name and version them correctly, see the scene for ideas.
Select your camera > shift + c to turn into a subnet > then from the RMB menu select > create digital asset .
Make sure you have a global otl library that everyone can see on the network. You can alter the houdini .env file and add searchable paths for otls.
When I want to version up my otl asset I always RMB and select the operator type manager, then you can RMB on the otl and duplicate it , this way you get a nice clean new version.

Rob

Attachments:
reast_mycamera_v001.otl (7.3 KB)
mycamera.hip (31.5 KB)

Gone fishing
User Avatar
Member
60 posts
Joined: Feb. 2011
Offline
Hi Rob,

thanks! this is really helpful. I didn't know about duplicating digital assets in this way and have been editing the original which updates all the instances and that's no good. thanks for this tip for a new clean version.

I had a problem with houdini crashing when I put the camera into a subnet and doing create digital asset. When I opened houdini up again a lot of the nodes were not in their menu folders in the tab menu, they were all lumped together in a Digital Asset folder and I'm not sure how to fix things again…

Also, is there ever a time when you wouldn't put it into a subnet first?

thanks for your help,
z

circusmonkey
Hi,
You can turn a camera into an asset just like anything else in Houdini. simple scene attached with otl.

Things to note with otls.

Name and version them correctly, see the scene for ideas.
Select your camera > shift + c to turn into a subnet > then from the RMB menu select > create digital asset .
Make sure you have a global otl library that everyone can see on the network. You can alter the houdini .env file and add searchable paths for otls.
When I want to version up my otl asset I always RMB and select the operator type manager, then you can RMB on the otl and duplicate it , this way you get a nice clean new version.

Rob
User Avatar
Member
60 posts
Joined: Feb. 2011
Offline
ok, i restarted one more time and things back to normal, phew!
User Avatar
Staff
3465 posts
Joined: July 2005
Online
the simplest way would be to opscript out the parameters
that way you can just run the script to get the animation from any camera into any shot
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
60 posts
Joined: Feb. 2011
Offline
michael,

this is a cool idea, not sure if I completely understand how to implement it since I'm new to this game… but from what I gather you mean that I can create a camera object using hscript commands that will create the object and specify all the animation channels for this camera and then write these hscript commands to a script. then i could pass this script on to someone else and when they run the script it will create a camera object in their scene. is that correct? or am i way off

thanks
z

arctor
the simplest way would be to opscript out the parameters
that way you can just run the script to get the animation from any camera into any shot
User Avatar
Staff
3465 posts
Joined: July 2005
Online
yep.

just try this:

make a camera
give it a meaningful name and animate it's parameters
in a textport:
/obj -> help opscript

read through that and you'll get a good idea of what's going on

then try this:
/obj ->opscript YOURCAMERA > /location/on/disc/myCamera.cmd

have a look at the cmd file in a text editor and you'll see it's just the hscript commands to make the camera

in a new houdini you can do File > Run Script > /location/on/disc/myCamera.cmd
and you should have your camera in the new scene

HTH
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
1390 posts
Joined: July 2005
Offline
Another idea is to make custom camera object and teach it of using chops, then save all relevant camera parms as *.chan files (good for Nuke/maya/xsi) or *.clip.
User Avatar
Member
60 posts
Joined: Feb. 2011
Offline
many thanks arctor and symek for your help. the opscript camera is a great and easy idea to share cameras in houdini.

symek, your idea is cool and great for sharing cameras across packages. I'm going to test that out and figure out how to import that data into maya, cool!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
If you don't want to use a digital asset, you can use an old school method that was used before assets were around going all the way back to PRISMS.

Have a look at the two hscript commands mread and mwrite.

http://www.sidefx.com/docs/houdini12.0/commands/mwrite [sidefx.com]
http://www.sidefx.com/docs/houdini12.0/commands/mread [sidefx.com]

mwrite in the textport allows you to write out the entire scene file or just the animation channels for operators which can be read in with mread.

mread can merge in the entire contents of a scene file or specified objects.

Before assets, you would build generic networks and template objects and use mread to load in pre-set up cameras, lights, objects, materials and more.

Check 'em out!
There's at least one school like the old school!
User Avatar
Member
1390 posts
Joined: July 2005
Offline
thanks Jeff, I always loved mwrite -c! really, the only problem is, that it can't write a hip for a selected object, can it?
User Avatar
Member
60 posts
Joined: Feb. 2011
Offline
awesome, that's really cool (and old school ) jeff! houdini really is one giant rabbit hole of rabbit holes…

is there a way to execute a command every time a hip file is opened? I can use the pre-render script with a mantra ROP, but I can't seem to figure out how to auto-run a script like mread each time a hip file is opened. or maybe that is not a best practice…
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
No mwrite can't write out a single object but that isn't how things evolved prior to HDA's. It was far more common to keep selected key files around and data mine them with mread.

PRISMS files had a .mot extension hence the m prefix btw.

Assets solved a lot of issues including the ability to write out a portion of a hip file wrapped up in a subnet.

If I were to share just the camera information, I would opscript out the parameters which include animation to disk as a .cmd file and simply load that on top of a camera in the new scene, as long as the parm names match.
There's at least one school like the old school!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
zephyr707
Is there a way to execute a command every time a hip file is opened? I can use the pre-render script with a mantra ROP, but I can't seem to figure out how to auto-run a script like mread each time a hip file is opened. or maybe that is not a best practice…

Look at the 456.cmd for hscript and 456.py if you prefer python. These two files are always run every time you launch a new Houdini session or open up a new file from Houdini.

What ever you want to do and if it works for you, go for it. I see nothing wrong with putting an mread command in side the 456.cmd file.
There's at least one school like the old school!
  • Quick Links