cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are working to address an issue with subscription email notifications. In the meantime, be sure to check your favorite boards for new topics.

Pro/TOOLKIT: how to assign a texture with ProMdlVisibleTexturepropsSet()

AndreasHellmann
3-Visitor

Pro/TOOLKIT: how to assign a texture with ProMdlVisibleTexturepropsSet()

Hi to everyone,

 

did anyone manage to assign a texture to a surface using Pro/TOOLKIT???

I managed to use the "new" (starting with Creo2 M140) Toolkit function ProMdlVisibleAppearancepropsGet() and ProMdlVisibleAppearancepropsSet() to assign a color to a comp/surface etc.

 

ProMdlVisibleTexturepropsSet() works as expected. But it seems that this isn't enough to display a texture on a surface. I think I must use ProMdlVisibleTextureplacementpropsSet() to define how the texture is placed/projected and so on. This function always returns -2 (INVALID INPUT)....

 

Before I paste some code here - WAS ANYONE HERE ABLE TO DO THIS?

Any tricks on how to define the ProSurfaceTexturePlacementProps object/pointer???

 

THANKS.

 

Andreas

 

 

 

Andreas

6 REPLIES 6

Hi,

 

I hope that you asked PTC Support the same question 🙂


Martin Hanák

I have done that in pro develop in the past. But there are some stuff that didn't work at the moment, also inside the Coloring / Appearance section (remove color has some bugs). We have written Marc Fischer to that, but he is on vocation atm.

 

Br,

Eike

Thanks for the replies also when they do not help to solve the problem.

 

My problem here in Germany is that I have only one Creo license and one toolkit license. And I am no longer allowed to open a case for PTC's customer support although I am paying 1.000 Euro "maintainance" PER MONTH.................

I have to ask a reseller and that's usually a complete waste of time; I could also ask my neighbor's dog.

 

Andreas

I understand the reseller problem, so I working for one. Such calls costs much of time so you need to help PTC to understand, prove it and check if it solved, ... . So it's cost effective for a reseller too. Fast you're spending a day of work and so we everytime check if it's a showstopper, or can we life with a workaround.

 

So I'm not able atm to check your problem and also not able to open a case for you (so I don't have the time atm). We have just push in the set appeareance problems as a bug and I try to add this, but didn't think they will fix it if it's a bug because we didn't program out the case and push in the code, ... .

 

Sorry

 

Br,

Eike

 

Hi all, Andreas, The first step is to verify that config.pro 'texture' option is 'yes'. The tricky part of the function is ProAsmitem - the usual initialization: ProAsmitem item; memset( &item, '\0', sizeof(item)); Setting the ProAsmitem, assuming that the part's ProMdl is mdl and it was initialized somehow (ProMdlCurrentGet or ProAsmcomppathMdlGet or ProMdlInit) ... ProMdlToModelitem( mdl, &item.item); item.name[0] = '\0';//redundant ProAsmcomppathInit( mdl, NULL, 0, &item.path); //for part or //ProSelectionAsmcomppathGet( sel, &item.path); //for a selected component in case of an assembly... The rest is straightforward - for testing - you should assign an existing texture to a model via UI, retrieve the texture with ProMdlVisibleTexturepropsGet(&item, &props); modify props.texture_map member with another bitmap - try to use one from the default library: strcpy( props.texture_map, "limestone-bump.jpg"); // for example and assign the modified texture to the model with : ProMdlVisibleTexturepropsSet(&item, &props); repaint window. HIH. Feliks.
CAD_Jimmy
10-Marble
(To:FV)

hi all,

 

I get same problem in ProSurfaceTextureplacementpropsSet(),

the function always return PRO_TK_BAD_INPUTS.

 

I can use the ProSurfaceTexturepropsSet() set the surface texture image,

the part view also show the image,but actually the UI dialog ->color texture option is "off"

this problem make the part view blurred,

so i want to use the ProSurfaceTextureplacementpropsSet() improve the view,

but it's always return PRO_TK_BAD_INPUTS.

 

anyone know how to change the color texture option to image?

or

 know how to use ProSurfaceTextureplacementpropsSet()?

 

thanks!!! 

Top Tags