New File Script

   7775   8   3
User Avatar
Member
82 posts
Joined: April 2019
Offline
Hi All

I want to know, How to Execute Hscript, when we open a new file in
Houdini.
I tried it with 456.cmd but it works only when we open an existing
hip file, and not a new file. Also, 123.cmd only works when Houdini starts.

———–Plz Help.

———–iamjaideep80
iamjaideep80 (Jaideep Khadilkar)
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Sure 123.cmd is run when starting hscript, as mentioned over on the mailing list. I suspect you are having troubles with where 123.cmd exists, and/or your HOUDINI variables.

Cheers,

J.C.
John Coldrick
User Avatar
Member
201 posts
Joined: July 2005
Offline
iamjaideep80
I want to know, How to Execute Hscript, when we open a new file in
Houdini.
I tried it with 456.cmd but it works only when we open an existing
hip file, and not a new file. Also, 123.cmd only works when Houdini starts.
———–iamjaideep80

Place your command in the 123.cmd file. Make sure the 123.cmd file is in a houdini/scripts folder somewhere on your path. Out of curiosity, what is it that you're trying to execute?
Cheers,
Rob
Digital Supervisor | Stargate Studios Toronto
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Does 123.cmd get run when you File->Open though? I'm not sure it does….
User Avatar
Member
4262 posts
Joined: July 2005
Offline
pbowmar
Does 123.cmd get run when you File->Open though? I'm not sure it does….


No. But 456.cmd does.

123.cmd only runs when you start up Houdini.
456.cmd runs whenever you start up Houdini or go File->Open.

If you do a File->New neither gets run and you get a nice clean empty hip file.
if(coffees<2,round(float),float)
User Avatar
Member
141 posts
Joined: July 2005
Offline
Wolfwood
pbowmar
Does 123.cmd get run when you File->Open though? I'm not sure it does….


No. But 456.cmd does.

123.cmd only runs when you start up Houdini.
456.cmd runs whenever you start up Houdini or go File->Open.

If you do a File->New neither gets run and you get a nice clean empty hip file.

Man this drove me crazy for some time and I ended up removing my scripts in the 456.cmd file as I would have it set my fps not knowing it would override what I had set in the file! arrggh!
Now I know.
/Rick
User Avatar
Member
82 posts
Joined: April 2019
Offline
Hi All………..

Hey Wolfwood, u r right. Thats what I want to ask. When we go to File-> New, no script is executed. I want to execute some script there. What should I do. I think Jason gave me the answer at Odforce. That there is no such script at this momment., in Houdini.
Want to know, if there is any hack for this.

——— iamjaideep80
iamjaideep80 (Jaideep Khadilkar)
User Avatar
Member
387 posts
Joined: July 2005
Offline
File->New. Shudder… I guess it's just long-time mistrust, but I always start a new Houdini session, and then delete stuff.

SESI: The help for 456.cmd does say that it is sourced upon a File->New
hdox/houdini/content/commands/guide/hscript_events.xml
path/scripts/456.cmd - Houdini runs this script after you open a saved scene or start a new scene with File > New.
Ahem. Maybe it should too.

Are you in the mood for a couple of crazy suggestions? :-)

You could create a hscript file which does the equivalent of File->New (blows everything away with oprm's, etc) and tie that to a hot-key Alias in 123.cmd. For example: put “alias SF10 $HOME/houdini/scripts/myFileNew.cmd” into 123.cmd. Shift+F10 is normally aliased to the Quit Houdini command. You'd probably not store this in $HOME though.

Using the “message” hscript command (and message's buttons) you could replicate the File->New pop-up. Then, add whatever else you want to do in myFileNew.cmd. The trouble is you'd have to try to change user's behaviour: to use Shift+F10 instead of File->New … j'yeah! Good luck with that.

Create an invisible node (in 123.cmd) which has a deletion script on it. . Put your special hscript commands in the deletion script. Then, when everything gets blown-away, the stuff in your deletion script is run! oooh. So Bad.. “That won't go wrong…” – Don't do this, i'm just kidding! … really.

Wait for SESI to fix File->New so that it sources 456.cmd

ben.
''You're always doing this: reducing it to science. Why can't it be real?'' – Jackie Tyler
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Wait for SESI to make all menus call scripts on disk that can be overridden with your own in HOUDINI_PATH.
  • Quick Links