HDK 에서 volume 의 field 이름 지정하기.

HDK 에서 volume data의 field 이름을 지정할려면..

GEO_AttributeHandle attributeHandle;
int def = -1;

gdp->addPrimAttrib("name", sizeof(int), GB_ATTRIB_INDEX, &def);
attributeHandle = gdp->getPrimAttribute("name");
// Set the name of the primitive
attributeHandle.setElement(volumeGdp);
attributeHandle.setString(cellDataName);

먼저 primattrib를 name 하나 만들어주고...
attributeHandle에서 setString 을 가지고 field 이름을 만들어준다.

이름에 .x .y .z 값을 뒤에 붙여주게 되면 후디니가 알아서 parsing 해서 vector field 로 만들어준다.
(기본적으로 후디니에서 vector3 값을 저장하는 볼륨은 없는 듯함)

만트라와 후디니는 기본적으로 velocity 값은 vel.x vel.y vel.z 의 볼륨 field name 으로 가져온다.

The common convention in Houdini is to use the index geometry primitive attribute "name" to store semantic information about the meaning of the volume. The convention is to use .x, .y, and .z to identify the respective components of vector volumes such as velocity fields. Thus the three primitive volumes vel.xvel.y, and vel.z will be grouped by Mantra and Houdini into a logical vector-valued volume named vel. SOP group fields can use @name=vel.* to select only the velocity primitive volumes.


* setElement 로 primitive 를 지정한뒤.
  setString 으로 "name" attribute 의 값을 string 으로 지정한다. ==> 이게 결론.

'OLD POSTS' 카테고리의 다른 글

SlimDX with WPF (directx10)  (0) 2010.12.16
WPF의 D3DImage 를 가지고 DirectX 사용하기. (4.0)  (0) 2010.12.16
OGRE3D FOR IPHONE 1.7.1  (0) 2010.08.27
OGRE3D for iPhone.  (0) 2010.08.26
Python Expression For Nuke.  (0) 2010.07.20