[Sidefx-houdini-list] data type conversion

Antoine Durr antoinedurr at gmail.com
Mon Mar 7 18:56:08 EST 2011


You could do an attribute SOP to first rename myData to myDataOrig,  
then attribcreate myData as a vector, setting the values to $myData1,  
$myData2, $myData3, then an attribute SOP to delete myDataOrig.

Or, you could do exactly this in VOPs (probably faster) but you'd  
still need to follow it up with an attribute SOP to delete the original.

Or, you could use the unix SOP in ascii mode:

sed 's/myData 3 float/myData 3 vector/'

This will simply retype the attribute in the header of the geo  
without  ever reading it into Houdini.

-- Antoine


On Mar 7, 2011, at 2:33 PM, Greg Massie wrote:

> Hey All,
>
> What's the most efficient way of recasting one data type to  
> another. I have two examples I'm trying to deal with:
>
> I have:  myData[0] myData[1] myData[2]    (float3)
> I want:  myData[x] myData[y] myData[z]     (vector)
>
> also:
>
> I have myData of type float and I want myData of type int.
>
> The data is coming from an external source and is a lot of points  
> so ideally I want to do it with as little copying of data as possible.
>
> Greg
>
>
>
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list




More information about the Sidefx-houdini-list mailing list