11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Houdiniで最初から使えるPythonのモジュールってどれだけあるの?

Last updated at Posted at 2019-09-14

どうも、ゲームエフェクト屋です。

Houdiniで普通にインストールしただけの状態でPythonからどれくらいの
モジュールが利用可能なのかふと気になって少し調べました。

Pythonでは利用可能なモジュールの一覧をhelp('modules')で取得出来ます。
Houdini17.5.378(Windows)のメインメニューの Windows から Python Shell を起動して上記コマンドを実行するとこれだけのモジュールが出てきます。

Python 2.7.15 (default, Apr  8 2019, 15:38:59) [MSC v.1916 64 bit (AMD64)] on win32
Houdini 17.5.378 hou module imported.
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')

Please wait a moment while I gather a list of all available modules...

No handlers could be found for logger "OpenGL.Tk"
BaseHTTPServer      codecs              itertools           repr
Bastion             codeop              itsdangerous        requests
CGIHTTPServer       collections         jinja2              rexec
Canvas              colorschemeutils    json                rfc822
ConfigParser        colorsys            karmautils          rigtoolutils
Cookie              commands            keyword             rlcompleter
Crypto              compileall          layermuting         rmands
Dialog              compiler            lib2to3             robotparser
DocXMLRPCServer     contextlib          lightpanel          roptoolutils
EC2                 contextoptionseditor linecache           rpyc
FileDialog          cookielib           loadHelpcardOTLExample runpy
FixTk               cop2toolutils       locale              sas
HTMLParser          copnettoolutils     logging             scenegraphdetails
HelpCard            copy                loptoolutils        sched
MimeWriter          copy_reg            loputils            sdl2otl
OpenGL              crowds              lxml                select
PIL                 crowdstoolutils     macpath             sets
PySide2             csv                 macurl2path         setuptools
Queue               ctypes              mailbox             sgmllib
ScrolledText        curl                mailcap             sha
SimpleDialog        curses              mako                shadingutils
SimpleHTTPServer    datetime            markupbase          shelfutils
SimpleXMLRPCServer  dbg                 markupsafe          shelve
SocketServer        dbhash              marshal             shlex
StringIO            decimal             math                shopclerks
Tix                 defaultstatetools   md5                 shoptoolutils
Tkconstants         defaulttoolmenus    metaexpr            shutil
Tkdnd               defaulttools        mhlib               sidefx_bend
Tkinter             demjson             mimetools           sidefx_lop_edit
UserDict            difflib             mimetypes           sidefx_lop_stagemanager
UserList            digitalassetsupport mimify              sidefx_stroke
UserString          dircache            mmap                signal
_LWPCookieJar       dis                 modulefinder        simplejson
_MozillaCookieJar   displaymessage      msilib              simtracker
__builtin__         distutils           mssbuild            site
__future__          doctest             msvcrt              six
_abcoll             dopclothproxy       multifile           skytoolutils
_ast                dopclothtoolutils   multiprocessing     slo2otl
_bisect             dopfetoolutils      muscletoolutils     smtpd
_bsddb              dopgeofiltertoolutils mutex               smtplib
_codecs             dopinstance         mvexportutils       sndhdr
_codecs_cn          dopparticlefluidtoolutils netrc               snippetmenu
_codecs_hk          doppoptoolutils     new                 socket
_codecs_iso2022     doppyrotoolutils    nntplib             soptoolutils
_codecs_jp          doprbdtoolutils     nodegraph           soputils
_codecs_kr          dopreltoolutils     nodegraphalign      sqlite3
_codecs_tw          dopsbdtoolutils     nodegraphautoscroll sre
_collections        dopsmoketoolutils   nodegraphbase       sre_compile
_csv                dopstatictoolutils  nodegraphconnect    sre_constants
_ctypes             doptoolutils        nodegraphdisplay    sre_parse
_elementtree        dopwiretoolutils    nodegraphdispopts   ssl
_functools          dragdroputils       nodegraphedittext   stagemanager
_hashlib            drivertoolutils     nodegraphfastfind   stat
_heapq              ds2hda              nodegraphflags      stateutils
_hotshot            dumbdbm             nodegraphfurutils   statvfs
_hou                dummy_thread        nodegraphgestures   string
_io                 dummy_threading     nodegraphhooks      stringold
_json               easy_install        nodegraphhotkeys    stringprep
_locale             ecdsa               nodegraphinfo       stroketoolutils
_lsprof             email               nodegraphlayout     strop
_md5                encodings           nodegraphpalettes   struct
_multibytecodec     ensurepip           nodegraphpopupmenus subprocess
_multiprocessing    errno               nodegraphprefs      sunau
_osx_support        exceptions          nodegraphrename     sunaudio
_pdg                expression_functions nodegraphselectpos  symbol
_pyio               expressionmenu      nodegraphselectposhooks symtable
_random             filecmp             nodegraphsnap       sys
_sha                fileinput           nodegraphstates     sysconfig
_sha256             fileutils           nodegraphtitle      tabnanny
_sha512             finddeprecated      nodegraphtopui      tarfile
_socket             flask               nodegraphui         taskgraphtable
_sqlite3            flask_script        nodegraphutils      telnetlib
_sre                fnmatch             nodegraphvellumutils tempfile
_ssl                formatter           nodegraphview       terraintoolutils
_strptime           fpformat            nodesearch          test
_struct             fractions           nodeselectionutil   textwrap
_subprocess         ftplib              nodethemes          this
_symtable           functools           nodeutils           thread
_threading_local    furtoolutils        nose                threading
_usdHoudini         furutils            nt                  time
_usdMantra          future_builtins     ntpath              timeit
_warnings           gamedevutils        nturl2path          tkColorChooser
_weakref            gasresizedynamic    numbers             tkCommonDialog
_weakrefset         gc                  numpy               tkFileDialog
_winreg             generateHDAToolsForOTL objecttoolutils     tkFont
abc                 generate_proto      opcode              tkMessageBox
aifc                genericpath         operator            tkSimpleDialog
alignutils          genshi              opnode_sum          toaiff
antigravity         getopt              optixdownload       token
anydbm              getpass             optparse            tokenize
argparse            gettext             os                  toolprompts
args2hda            githubdownloader    os2emxpath          toolutils
array               glob                paginate            toptoolutils
assetauthortools    gzip                paramiko            trace
assetdownload       hashlib             parmutils           traceback
ast                 hdefereval          parser              ttk
asynchat            heapq               particletoolutils   tty
asyncore            hjson               pdb                 turtle
atexit              hjsonrpc            pdg                 types
audiodev            hmac                pdgjob              uiutils
audioop             hotkeys             perfmon_sum         unicodedata
autorig             hotshot             pickle              unittest
autorigs            hou                 pickletools         urllib
bakeanimation       hou_settings        pipes               urllib2
base64              houdiniInterpreter  pkg_resources       urllib3
bdb                 houdini_external_editor pkgutil             urlparse
beaker              houdiniengineutils  platform            user
binascii            houdinihelp         plistlib            uu
binhex              houdiniinternals    popen2              uuid
bisect              houpythonportion    poplib              vexpressionmenu
bookish             houxmlrpc           poselib             viewerstate
bsddb               hqrop               posespacedeform     viewportmeasuretool
bvhviewer           hqueue              posixfile           volumetoolutils
bz2                 hrender             posixpath           vopcallbacks
cPickle             hrpyc               poster              vopfxmenu
cProfile            hscp                pprint              vopnettoolutils
cStringIO           htmlentitydefs      profile             voptoolutils
calendar            htmllib             pstats              warnings
canvaseventtypes    httplib             pty                 wave
certifi             husd                pxr                 weakref
cgi                 husdshadertranslators py_compile          webbrowser
cgitb               hutil               pyclbr              webob
channelwranglesnippet idlelib             pycurl              werkzeug
charactertoolutils  idna                pydoc               whichdb
chardet             ihooks              pydoc_data          whoosh
charpicker          imageop             pyexpat             winsound
chopnettoolutils    images2gif          pygments            wsgiref
choptoolutils       imaplib             pyro2               xdrlib
chunk               imghdr              pyside2uic          xml
click               imp                 pythonscriptmenu    xmllib
cloud               importlib           quickplanes         xmlrpclib
cloudEULA           imputil             quopri              xxsubtype
cloudsubmit         index_help          radialmenu          zipfile
cloudtoolutils      inlinecpp           random              zipimport
cmath               inspect             re                  zlib
cmd                 introspect          render              
code                io                  rendertracker       

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

540個程でしょうか。
_builtin みたいなのはほっとくとしても結構いっぱいありますね。

気になったところがいくつかありました。
karmautils はもうKarmaを先取りしてあるんでしょうか。
husd はUSDを扱うものでしょうか?気になりますね。
nodegraph シリーズ、dop シリーズ は多いですね
PySide2TKinter などのUI系、numpymath などの算術系もデフォルトで使えます。
画像を扱うPIL、簡易データベースを扱うsqlite3もすぐに使える状態なので便利です。

モジュールのメンバーは組み込み関数の dir で確認出来ます。
気になる husddir をかけて中身を見てみると

>>> for i in dir(husd):
...     print i
... 
GetEditorNodesForLayer
GetLabelForLayer
GetRootLayerStackInfo
GetScalarTypeFromAttr
GetShortString
GetValue
Gf
HUSD_ATTRIBUTE_TYPE_TOKEN
HUSD_PARM_CONTROLLER_PREFIX
HUSD_PRIMITIVE_PATH
HUSD_PROPERTY_CATEGORY
HUSD_PROPERTY_NAME
HUSD_PROPERTY_VALUETYPE
HUSD_RELATIONSHIP_TYPE_TOKEN
OrderedDict
QtCore
QtGui
QtWidgets
SceneGraphDetails
Sdf
TEMPLATE_TYPE_MAP
TYPE_TEMPLATE_MAP
Tf
ToString
Usd
UsdGeom
UsdHoudini
UsdMantra
__builtins__
__doc__
__file__
__name__
__package__
__path__
addParmsToGroup
appendSpareParm
attrutils
bakeAnimation
convertFromGf
createAttributesForParmTemplateGroup
createClassForNodeType
createParmForAttr
createParmForRelationship
createParmTemplateForAttr
createParmTemplateForProperty
createParmTemplateForRelationship
createParmTemplateGroupForPrim
createPropertyForParmTemplate
createSchemaHeader
fixParmName
getParmForProperty
getParmTemplateGroupForPrim
getPropertyClassForParmTemplate
getScalarValue
groupby
hdefereval
hou
houdinihelp
importPropsAtPrim
isGfType
isUsdAttrParm
isValidParm
listPropsAtNode
math
parmValueToUsd
parmutils
populateScalarValue
primpicker
propsOnPrim
re
scenegraphdetails
typeutils
usdTypeForParmTemplate
warnings

やはりUSD絡みの様ですね。
更にhelp( husd.scenegraphdetails ) などとしてみると


>>> help( husd.scenegraphdetails )
Help on module husd.scenegraphdetails in husd:

NAME
    husd.scenegraphdetails

FILE
    c:\progra~1\sideef~1\houdin~1.378\houdini\python2.7libs\husd\scenegraphdetails.py

CLASSES
    PySide2.QtWidgets.QFrame(PySide2.QtWidgets.QWidget)
        SceneGraphDetails
    
    class SceneGraphDetails(PySide2.QtWidgets.QFrame)
     |  Method resolution order:
     |      SceneGraphDetails
     |      PySide2.QtWidgets.QFrame
     |      PySide2.QtWidgets.QWidget
     |      PySide2.QtCore.QObject
     |      PySide2.QtGui.QPaintDevice
     |      Shiboken.Object
     |      __builtin__.object
     |  
     |  Methods defined here:
     |  
     |  __init__(self, pane)
     |  
~~~~~~~~以下略~~~~~~~~~~

なんとなくUSDのシーングラフを編集出来るインターフェイスの様に見えます。

dirでモジュールの中身を調べて使えそうなものを探していきhelpで使い方を確認しながら自分が気になるモジュールを物色していけます。
こんな風にPythonで出来ることの幅を広げていくのもオススメです。
せっかく用意して下さっているモジュールを使わない手は無いですね。

というわけで皆様良きHoudini Pythonライフを。

11
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?