static private void createCurve() { if (!HoudiniHost.isInstallationOk()) { HoudiniHost.displayHoudiniEngineInstallInfo(); return; } // Create game object. GameObject game_object = new GameObject("curve"); // Add HAPI Object Control script component. HoudiniAssetCurve asset = game_object.AddComponent <HoudiniAssetCurve>(); asset.prAssetSubType = HAPI_AssetSubType.HAPI_ASSETSUBTYPE_CURVE; // Do first build. bool build_result = asset.buildAll(); if (!build_result) // Something is not right. Clean up and die. { DestroyImmediate(game_object); return; } // Set new object name from asset name. string asset_name = asset.prAssetInfo.name; game_object.name = asset_name; // Select the new houdini asset. GameObject[] selection = new GameObject[1]; selection[0] = game_object; Selection.objects = selection; }
static private void createMergerAsset() { if (!HoudiniHost.isInstallationOk()) { HoudiniHost.displayHoudiniEngineInstallInfo(); return; } // Create game object. GameObject game_object = new GameObject("HoudiniMergerAsset"); // Add HAPI Object Control script component. HoudiniAssetMerger asset = game_object.AddComponent <HoudiniAssetMerger>(); asset.prAssetSubType = HAPI_AssetSubType.HAPI_ASSETSUBTYPE_DEFAULT; // Do a test build to see if things are ok. bool build_result = asset.buildClientSide(); if (!build_result) // Something is not right. Clean up and die. { DestroyImmediate(game_object); return; } // Select the new houdini asset. GameObject[] selection = new GameObject[1]; selection[0] = game_object; Selection.objects = selection; }
static private void loadHipFile() { if ( !HoudiniHost.isInstallationOk() ) { HoudiniHost.displayHoudiniEngineInstallInfo(); return; } string hip_file_path = HoudiniGUIUtility.promptForHIPPath(); HoudiniAssetUtility.loadHipFile( hip_file_path ); }
static private void createHAPIObject() { if ( !HoudiniHost.isInstallationOk() ) { HoudiniHost.displayHoudiniEngineInstallInfo(); return; } string asset_file_path = HoudiniGUIUtility.promptForOTLPath(); HoudiniAssetUtility.instantiateAsset( asset_file_path ); }
static private void convertToInputAsset() { if (!HoudiniHost.isInstallationOk()) { HoudiniHost.displayHoudiniEngineInstallInfo(); return; } foreach (GameObject obj in Selection.gameObjects) { bool not_an_asset = (obj.GetComponent <HoudiniAsset>() == null); bool has_mesh_filter = (obj.GetComponent <MeshFilter>() != null); if (not_an_asset && has_mesh_filter) { obj.AddComponent <HoudiniAssetInput>(); } } }
static private void about() { HoudiniHost.displayHoudiniEngineInstallInfo(); }