[Sidefx-houdini-list] Startup method to set frame range

Rangi Sutton rsutton at cuttingedge.com.au
Thu Nov 21 18:58:38 EST 2013


123.cmd - on fresh scene
456.cmd - on open of existing hip
123.py - python on fresh scene
456.py - python on existing hip

IIRC, the python stuff means it won't call the hscript stuff, so you'd need
to put a source command in the python scripts to call the hscript stuff if
you want both world.

Below...

$CE_NAMING_EXPR is a path to a houdini .expr file to source some hexpr
function.

The script makes a /out/ce_ver_cntl node if it doesn't exist.

HTH,
r.


$ cat 456.py

# 456.py gets read when a new houdini is opened
# By virtue of being found somewhere in HOUDINI_PATH/scripts
# So we use it here to init scene file

# Create a CE Version Cntl rop, bare minimum for a CE scene file
# And read the naming expressions used for rendering

import hou

# This creates errors when doing an "import hou" in python
# Which flags render jobs to be in error. Waiting on sidefx response.

if hou.node('/out/ce_ver_cntl') == None:
    new_ver_cntl=hou.node('/out').createNode("ce_ver_cntl")
    new_ver_cntl.setName('ce_ver_cntl')
    hou.hscript("exread $CE_NAMING_EXPR")

# Read the hscript version of this file

hou.hscript("source " + hou.findFile("scripts/456.cmd"))



On 22 November 2013 09:49, Benjamin Laidlaw <ben_laidlaw at hotmail.com> wrote:

> 123.cmd was the trigger word I needed. Found a couple threads to discover
> the example 123.cmd and defaultscene.cmd that ships with Houdini, plus the
> hscript tset, frange, and fcur, and now Antoine's script makes sense.  Do
> wish there was the equivalent python examples for a quick comparison that
> shipped with it, plus a help card about that.
> Thanks all.
>
> > ------------------------------
> >
> > Message: 3
> > Date: Wed, 20 Nov 2013 13:13:55 -0600 (CST)
> > From: Daniele Colajacomo <dani at livingpicturesinc.com>
> > To: sidefx-houdini-list at sidefx.com
> > Subject: Re: [Sidefx-houdini-list] Startup method to set frame range
> > Message-ID:
> >       <1076361706.44572.1384974835186.JavaMail.zimbra at 3dsite.com>
> > Content-Type: text/plain; charset=utf-8
> >
> > I thought there used to be a 456.cmd  that was read in if it existed.
> > that's where I usually put all my startup commands for houdini
> >
> > d
> >
> >
> > ----- Original Message -----
> > > Hi,
> > >   If you're trying to set up scripts en-masse, I would put a bunch of
> > >   commands into a script, and then make a shell script that basically
> does:
> > >
> > > setjob foo123
> > > cat "hscript_setup_commands" | hscript blank_hip_file.hip
> > > mv blank_ hip_file.hip foo123_fx_v1.hip
> > >
> > > You can call your csh script something like "setup_hip_file.csh".  The
> > > 'hscript_setup_commands' file would have something like:
> > >
> > > frange $FS $FE
> > >
> > > assuming that $FS and $FE are setenv'ed by the setjob command above.
> > >
> > > Another approach is to make a main menu entry that resets the frame
> range.
> > > That's handy because if you inherit a file from another shot, you can
> easily
> > > reset the frange to what it's supposed to be.  All that does is look
> at two
> > > env vars anyway!
> > >
> > > -- Antoine
> > >
> > >
> > > On Nov 20, 2013, at 10:31 AM, Benjamin Laidlaw <
> ben_laidlaw at hotmail.com>
> > > wrote:
> > >
> > > > Ok scratch that and revise...
> > > > How about when you are setting up FX dept task and directories at the
> > > > beginning of a project with a creation script, and you're creating
> the
> > > > initial frame range based on the first edit of the project, what
> would be
> > > > a way to set that in for the hip files.
> > > > Thanks Antoine
> > > >
> > > >> ------------------------------
> > > >>
> > > >> Message: 4
> > > >> Date: Tue, 19 Nov 2013 19:17:11 -0800
> > > >> From: Antoine Durr <antoinedurr at gmail.com>
> > > >> To: sidefx-houdini-list at sidefx.com
> > > >> Subject: Re: [Sidefx-houdini-list] Startup method to set frame range
> > > >> Message-ID: <3108BF9C-EE84-444B-97C2-B8FAD26563B5 at gmail.com>
> > > >> Content-Type: text/plain; charset=us-ascii
> > > >>
> > > >> I would advise against doing an auto-frame-range resetting.
>  Instead, pop
> > > >> up a query asking if they want to reset, though even that will get
> > > >> annoying fast, esp. if you reset your frame range to add some at
> the head
> > > >> so that you can do preroll.
> > > >>
> > > >> At various places, we actually launch houdini with a wrapper
> script, which
> > > >> really does:
> > > >>
> > > >> houdini <hip_file> <startup_script>
> > > >>
> > > >> that way the script is always run (Houdini launches whatever you
> add to
> > > >> the command line, one by one).
> > > >>
> > > >> -- Antoine
> > > >>
> > > >> On Nov 19, 2013, at 5:59 PM, Benjamin Laidlaw <
> ben_laidlaw at hotmail.com>
> > > >> wrote:
> > > >>
> > > >>> What is the best way to set the frame range on a sequence of shots
> at
> > > >>> startup, like with a 123.py?
> > > >>>
> > > >>> Say all my shots traditionally start at frame 1001 and for each
> shot the
> > > >>> edit calls out the frame numbers. In the end it will shotgun/tank,
> and
> > > >>> there is some built in stuff for that, but was curious about other
> > > >>> methods too.
> > > >>>
> > > >>> _______________________________________________
> > > >
> > > >
> > > > _______________________________________________
> > > > Sidefx-houdini-list mailing list
> > > > Sidefx-houdini-list at sidefx.com
> > > > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> > >
> > > _______________________________________________
> > > Sidefx-houdini-list mailing list
> > > Sidefx-houdini-list at sidefx.com
> > > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> > >
> >
> > --
> > Daniele Colajacomo
> > President/CEO
> > Living Pictures
> > 310-5792191
> >
> >
> > ------------------------------
>
>
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>



More information about the Sidefx-houdini-list mailing list