PPGLayout Texture Conrtol

Discussions concerning programming of SOFTIMAGE©
Post Reply
homam
Posts: 49
Joined: 16 Mar 2013, 23:15
Location: Montreal
Contact:

PPGLayout Texture Conrtol

Post by homam » 07 Apr 2015, 04:09

Hello,

My plugin property page have a texture control widget added as following:

Code: Select all

var obj = CreatePrim("Sphere", "MeshSurface", null, null);

// Creating PPG and adding Texture Control Widget to it
var oPSet=obj.AddProperty("CustomProperty",false,"Demo") ;
oPSet.AddParameter2("inUVs", siString );
var oPPGLayout = oPSet.PPGLayout ;
oPPGLayout.AddItem("inUVs", "Texture Projection", siControlTextureSpace);

InspectObj( oPSet, "", "Check out this layout created from scripting" );
The PPG shows the texture widget successfully however creating new texture projection with the new button or selecting existing texture projection from the dropdown list always returns the following error:


// ERROR : 2003-SetInstanceDataValue - Interface not supported.
SetInstanceDataValue(null, "sphere.Demo.inUVs", "Texture_Projection");


Any clues how to get the texture widget works as expected?

Thanks,

User avatar
nburtnyk
Posts: 4
Joined: 13 Mar 2013, 01:38
Location: Newport Beach, California
Contact:

Re: PPGLayout Texture Conrtol

Post by nburtnyk » 09 Apr 2015, 23:12

We're having the same issue and looking for a solution.

homam
Posts: 49
Joined: 16 Mar 2013, 23:15
Location: Montreal
Contact:

Re: PPGLayout Texture Conrtol

Post by homam » 10 Apr 2015, 03:50

I'm coding my custom widget for now. It is sad reinventing the wheel. :(

I can share it when it is done. It is C# though.

Regards,

luceric
Posts: 1251
Joined: 22 Jun 2009, 00:08

Re: PPGLayout Texture Conrtol

Post by luceric » 10 Apr 2015, 04:35

The error tells you that the parameter must be an object that implement a special API and not just a simple string. It's not possible to create that object with add parameter 2, it must be using one of the shader parameter definition methods, for example spdl

User avatar
nburtnyk
Posts: 4
Joined: 13 Mar 2013, 01:38
Location: Newport Beach, California
Contact:

Re: PPGLayout Texture Conrtol

Post by nburtnyk » 10 Apr 2015, 18:52

Thanks Luc-Eric.

I assume this means it's impossible to have a texture space parameter on a self-installed custom property then?
We have to define the custom property with SPDL instead? #-o

luceric
Posts: 1251
Joined: 22 Jun 2009, 00:08

Re: PPGLayout Texture Conrtol

Post by luceric » 10 Apr 2015, 22:23

right, I don't think that special UV Data selection object is accessible from the SDK. it was created to be automatically managed for shaders.

homam
Posts: 49
Joined: 16 Mar 2013, 23:15
Location: Montreal
Contact:

Re: PPGLayout Texture Conrtol

Post by homam » 12 Apr 2015, 03:56

Since this is not accessible from the SDK why we have siControlTextureSpace exposed :-\
Anyways thanks Luc-Eric for confirming this. That means I'm not totally reinventing the wheel :)

Best Regards,

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests