WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 12-07-2011, 09:35 AM
EnvisMJ EnvisMJ is offline
Member
 
Join Date: May 2009
Location: Purdue University, West Lafayette, Indiana
Posts: 44
Apply a texture to a submesh

Is there a way to apply a texture to a single mesh within a model? I'm using this:

Code:
model = viz.add('Models/DynamicObjects/Vial_Default.IVE')
labelMat = viz.addTexture('Textures/VialLabels/Ampicillin & Sulbactam 1.5gm vial - WHITE.png')

vial = model.getChild("Vial-GEODE")
label = model.getChild("Label-GEODE")
cap = model.getChild("Cap-GEODE")

label.texture(labelMat)
But it isn't doing anything.

My goal is to import a single model of a vial, and within Vizard, apply a different label as needed.

Ex.
Reply With Quote
  #2  
Old 12-07-2011, 09:55 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
First off, I would avoid using getChild unless you need to modify the transform of the child. If you just need to change the texture, then use the optional node parameter of the texture command:
Code:
model.texture(labelMat,node='Label-GEODE')
Are you getting any error messages? Can you send us the model?
Reply With Quote
  #3  
Old 12-13-2011, 07:44 AM
EnvisMJ EnvisMJ is offline
Member
 
Join Date: May 2009
Location: Purdue University, West Lafayette, Indiana
Posts: 44
Nope, no error messages.

Code:
******************************************************************************
** Loading bulks.py
******************************************************************************
Loading File: Models/DynamicObjects/Vial_Default.IVE
** Load Time: 0.51 seconds

The texture application doesn't seem to be doing anything, I'm just left with a floating green and white via. Not sure why the green, the texture for the glass seems not to be loading either.

See attached files
Attached Files
File Type: zip Vial_Default.zip (719.0 KB, 900 views)
Reply With Quote
  #4  
Old 12-13-2011, 08:34 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Are you exporting the model from max? If so, it looks like you didn't export the model with a texture applied to the label. If you don't export with a texture applied, then there will not be any texture coordinates assigned to the sub-mesh. This is why the texture does not appear when you apply it within Vizard. Try assigning some placeholder texture to the label within max and reexport it.
Reply With Quote
  #5  
Old 12-28-2011, 11:34 AM
EnvisMJ EnvisMJ is offline
Member
 
Join Date: May 2009
Location: Purdue University, West Lafayette, Indiana
Posts: 44
So in the process of trying to implement that, I've run into another issue, or some part of the same one.

I've been through the process of exporting the model from Maya->Max->Vizard at least a dozen times now with every variation I can think of. But still for some reason, the texture file for the glass and cap portion of the vial is coming in corrupted or something.



In the image (Sorry if it's huge), on the right you can see how the texture looks in Photoshop, Maya and Max, but in Vizard (on the left) it appears green with much higher contrast on the cap.

Two other coworkers and I are pretty stumped, any help would be appreciated.


Texture File:
Reply With Quote
  #6  
Old 12-29-2011, 10:34 AM
EnvisMJ EnvisMJ is offline
Member
 
Join Date: May 2009
Location: Purdue University, West Lafayette, Indiana
Posts: 44
Nevermind on that last problem. "Embed image data in binary files" was checked on the exporter.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to render a texture of the transparent object and then blur it whj Vizard 1 09-25-2012 03:15 PM
Avatar texture swaping sleiN13 Vizard 5 06-24-2011 12:48 AM
How to apply shader and render texture to an object whj Vizard 0 04-23-2010 12:23 PM
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM
how I can get my texture to appear exactly as is defined mspusch Vizard 1 04-23-2005 12:12 PM


All times are GMT -7. The time now is 02:40 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC