3D Texture support for scriptTOP

Hi,

It would be lovely if the scriptTOP supported the ability to load cubic np.arrays into 3D textures.

Thanks :slight_smile:

F

Hi @flowb,

EDIT: I misread the question - sorry about this. See 3D Texture support for scriptTOP - #5 by malcolm below…

this is already possible according to

currently though you can’t use the input to the Script TOP but must reference a TOP via the numpyArray method.

So something like:

a = op('tex3D1').numpyArray()
scriptOp.copyNumpyArray(a)

will work while directly accessing the input via scriptTOP.inputs[0] will fail due to the Script TOP only accepting 2D Inputs.

Added an RFE to support this directly.

cheers
Markus

Hi Markus,

The request was to be able to construct 3D textures in the scriptTOP by feeding 3D arrays from numpy into it. I understand that we can already transform 3D Textures into numpy arrays.

Sorry that the request wasn’t more clear.

I also saw that 3D texture support was added to many TOPs with the latest new release branch, though I didn’t see the scriptTOP mentioned in the release notes when I looked at it recently.

Thanks :slight_smile:

edit: looking at the example you posted and this sort of works in the current release. The only issue is see is that if you feed it a 3D Texture input, the result of the scriptTOP is a 2D Texture Array. I think that the scriptTOP might need to support some extra options to allow people to describe the desired end data type.

Thanks again

You can use the isCube or is3D keyword arguments into copyNumpyArray() to specify that. I’ll update the docs, which were missing this.

1 Like