티스토리 뷰

728x90
반응형

후디니 digital asset을 내보낸것을 불러와서

후디니 에셋 파라미터를 스크립트로 제어해보자

<후디니>

https://ing-min.tistory.com/179

 

unity_houdini_part1. houdini Engine Unity package

1. 유니티에서 이 패키지를 연다. error Unable to connect to the Houdini Engine server Unable to connect to the Houdini Engine server (socket mode). Make sure you started the HARS server located in Houdini. HARS was running: False ---------------

ing-min.tistory.com

후디니에서 디지털 에셋내보내기 

저장경로 - 유니티 에셋

 

<유니티>

using UnityEngine;
using UnityEngine.UI;
using HoudiniEngineUnity;

public class Wave : MonoBehaviour
{
    public Slider waveHeightSlider;
    public Slider noiseScaleSlider;
    public Slider noiseSeedSlider;
    public HEU_HoudiniAsset houdiniAsset;

    private void Start()
    {
        // Set initial values for sliders
        waveHeightSlider.value = 0f;
        noiseScaleSlider.value = 0f;
        noiseSeedSlider.value = 0f;

        // Add listeners to the sliders
        waveHeightSlider.onValueChanged.AddListener(ChangeWaveHeight);
        noiseScaleSlider.onValueChanged.AddListener(ChangeNoiseScale);
        noiseSeedSlider.onValueChanged.AddListener(ChangeNoiseSeed);
    }

    private void ChangeWaveHeight(float newValue)
    {
        ChangeParameter("wave_height", newValue);
    }

    private void ChangeNoiseScale(float newValue)
    {
        ChangeParameter("noise_scale", newValue);
    }

    private void ChangeNoiseSeed(float newValue)
    {
        ChangeParameter("noise_seed", newValue);
    }

    private void ChangeParameter(string paramName, float newValue)
    {
        if (houdiniAsset == null)
        {
            Debug.LogError("Houdini Asset is not assigned in the inspector");
            return;
        }

        // Set the value of the parameter
        HEU_ParameterUtility.SetFloat(houdiniAsset,paramName, newValue);

        // Recook the asset to apply the changes
        houdiniAsset.RequestCook(bCheckParametersChanged: true, bAsync: true, bSkipCookCheck: false, bUploadParameters: true);
    }
}

 

https://youtu.be/J_dUTntd8lA

(옛날 버전이라 코드가 바뀜)

728x90
반응형
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함
반응형