• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by marcool1251 · Apr 09, 2018 at 07:33 PM · materialsruntimetexturesdownloadfiles

Grab Image/texture from MTL file and apply to a game object

Hello,

I have an obj and mtl file. When I add both files to my project, I am able to drag the obj in as a game object. I believe that the mtl also applies to the obj because the obj will come with a certain color if the mtl file specifies it. How can I get an image that is contained as a link within the mtl file applied to the obj game object?

Here is what is contained inside the mtl file:


 newmtl body1
     Ns 10.0000
     Ni 1.5000
     d 1.0000
     Tr 0.0000
     Tf 1.0000 1.0000 1.0000 
     illum 2
     Ka 0.5000 0.5000 0.5000
     Kd 1.000 1.000 1.000
     Ks 0.0000 0.0000 0.0000
     Ke 0.0000 0.0000 0.0000
     map_Kd  -o 0 -22.843 0 -s 20.26 22.843 1 https://machinecore.farmcp.com/Ziing3Server/Ziing3.aspx?req=image&maharam&fmt=jpg&qlty=80&mat=466194-005&raw=true&dpi=100
 



The link at the end is what is the image is. If I were to copy and paste this into a browser, it would download the image. I'm wondering if there's a way to grab this image and apply it to a game object (ideally its corresponding obj). Any help or guidance is appreciated.


Thank you

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image

Answer by Nebukam · Apr 11, 2018 at 08:16 PM

Check this : https://docs.unity3d.com/ScriptReference/WWW.LoadImageIntoTexture.html You will need to manually extract the url from the mtl file yourself tho.

Comment
marcool1251

People who like this

1 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image marcool1251 · Apr 12, 2018 at 11:50 PM 0
Share

Thanks! I'll give this a try and let you know if it works for me.

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

78 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Assigning textures in project panel to materials dynamically or via editor scripts 1 Answer

How do I attach a Created Material A Texture, NormalMap and OcclussionMap? 0 Answers

Creating multiple assets from the same texture 0 Answers

How to download and load a scene during runtime? 4 Answers

Accessing multiple texture materials on objects 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges