ポリゴン+テクスチャ形状をMayaからHoudiniに持ってきて、効率よくオブジェクトの置換しながら、配置する方法を考察する。 Here is a workflow example of bringing polygon+texture geometries from Maya to Houdini and swapping one from another efficiently. ファイルフォーマット (File Format): Houdiniがサポートしている形状フォーマットは、.GEO, .BGEOなどの内部フォーマットに加え、.DXF, .OBJ, .ABC (Alembic)などいろいろあるが、形状とテクスチャの両方をサポートしているのは.FBXのみ。ここではFBXを使用。サポートされている形状ファイルフォーマットのリストはこちら(英語)。 Houdini supports a number of file formats including .dfx, .obj, .abc (alembic) in addition to Houdini's own .geo and .bgeo, but .fbx is the only file format that handles both geometry AND texture, so that't the format I use here. A full list of supported geometry file format is here. FBX Import MayaのBonusToolsのLayout Toolを使って、いくつか小物をそれぞれ個別にFile -> Export SelectionでExport。実際のExport時には、TX,TY,TZ=0,0,0。 I've created a couple of props using the Layout tool in Maya BonusTools and individually exported (at TX,TY,TZ=0,0,0).
HoudiniでFBXファイルを読み込むには、File ->Import -> Filmbox FBX... To import a FBX file in Houdini, go to File ->Import -> Filmbox FBX...
一番上でファイルを指定、Material OptionsのImport Materials As:は”FBX Shader Nodes"にした方が最初は無難。"VOP Networks"にすると大量のノードが出来る。 Select a file at the top of the panel, set "Import Materials As" to "FBX Shader Nodes" unless you know what you are doing. Setting to "VOP Networks" will result a lot of shading nodes. 一つ目のファイル時には"Import"を押しても良いが、2個目以降は"Merge"をクリックしないと、読み込んだものを廃棄することになる。一個目からMergeをクリックするのがよいと思う。 Clicking "Import" (at the bottom) will flush the current scene; clicking "Merge" will add the fbx file to the current scene, so "Merge" is the one you'd want to use for second files and on, and for the first one too. basket.fbxとvase.fbxを読み込んだ直後の状態。Export時同様、どちらも原点に配置されている。 Here' I've imported basket.fbx and vase.fbx, both at the origin (as exported in Maya).
Network Viewには"basket_fbx"と"vase_fbx"の二つのSubnetが出来ている。 In the Network view, there are two subnet nodes, "basket_fbx" and "vase_fbx". このまま使ってもよいし、Subnetが邪魔だと思うのであれば、Subnetを選択、RMB->Extract Contentsとすれば、Subnetの中身をSceneビューに直接配置できる。 You could keep these nodes as they are, or if you are annoyed with them, select one subnet, and RMB->Extract Contents, and apply the same for the other subnet. 注意: 複数のFBXをImportした場合、それぞれのFBX Subnetの中に"materials"という名のマテリアル管理ノードがあり、それぞれをExtract Contentsとすると、二つ目以降はmaterials1, materials2, ... materialsnと名前が変わり、注意しないとgeometryノードからの参照が壊れてしまう。これは同じオブジェクト名を持つ異なるFBXファイルを読み込んだときも同じだと思う。 よって、Extract Contentsをする前に名前を変えるか、そのまま使うかにする。ここではそのまま使う。 Caution: When a FBX file is imported, there will be a FBX subnet that includes a "materials" node that contains all the shader subnets . If more than 2 FBX subnets are extracted, the second and subsequent "materials" will be renamed to "materials1", "materials2", ..., "materialsn", and this renaming invalidates the connections between geometry (groups) and actual materials because the path to the material is no longer true. The same goes true with geometry files with the same object name. You will have to check the paths when you do. Here, I keep the FBX subnets for the very reason. オブジェクトの効率良い置換: 効率よくオブジェクトを置換できるようにするためには、basketないしvaseのネットワークを編集していくよりも、第3のオブジェクトノードを作成、その中から二つのオブジェクトを参照できるようにする。このためには、geometryノードを作成、その中でobjectMergeノード二つ、switchノードを使用し、二つのオブジェクトの参照と置換が行えるようにする。 In order to place objects more efficiently while keeping the objects swappable, rather than editing the network for the basket or vase directly, the best approach is to create another object node and reference the two from here, and use the switch node to swap the two. 1. geometryノードの作成: SceneビューでTABキーを押し、'g', 'e', 'o'と打って、Geometryノードを選択+作成。geo1が作成された。 Create geometry node: Hit TAB key and then 'g', 'e', 'o' and select the 'Geometry' node.
2. 出来たgeo1をダブルクリック。中にfile1があるのが確認できる。これを用いてfbxを読むことも可能だが、その場合マテリアルが追随しない。よって今回はこれを使用しないので削除(選択してDelete)。 Double-click on 'geo1', will you find 'file1' node. This can be used to read a fbx file but materials won't be looked up this way (unless manually created and connected), so we won't be using this. Delete this. 3. geo1内でTABキーを押し、'o', 'b','j'と打って"Object Merge"を選択+作成。2度繰り返し二つ作成。 Within geo1, hit TAB key and 'o', 'b', 'j' and select "Object Merge" to create one. Repeat once more to create two.
4. object_merge1のパラメータビューで下の方に行き、Object 1の一番右の'+'アイコンをクリック、Choose Operatorを開き、basket_fbx > basket > basket_materialを選択。 In the parameter view, go to the bottom and find "Object 1" label and click on the '+' icon at the far right to open Choose Operator window and select basket_material (under basket_fbx > basket > basket_material).
5. 同様にobject_merge2で同じ要領でvase_materialを選択。 Repeat the same with object_merge2 to select vase_material. 6. TABキー、's', 'w', 'i'と打って、Switchノードを選択+作成。 Hit TAB key and 's', 'w', 'i' and create Switch node.
7. object_merge1のoutputをクリック、矢印を伸ばしてswitch1のInputをクリック。object_merge1がswitch1に接続される。同様にobject_merge2も接続。 Click on the output port of object_merge1, extend the curve toward switch1 and click on the input port. This will connect object_merge1 to connect1. Repeat the same with object2 to connect it to switch1 as well. 8. Copyノードを作成、switchノードを接続すれば、前回同様、他のオブジェクトを使ったコピーなどが可能になる。例はこちら。 Create a Copy node, and connect the switch node you could copy either one of object without reconnecting the rest of node networks.
この項終了。 End of this topic.