Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
0
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
Add comment
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

· Add your reply
  • Sort: 
avatar image
1

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
Add comment · 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.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

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

(Unity Serializer) Materials doesn't load when loading a prefab at runtime. 1 Answer

How to Properly create & apply a normalmap and specular? (Hard Surface Shader Free) 2 Answers

Zbrush materials and textures in Unity 1 Answer

How to download game content (DLC) for storage and use later 1 Answer


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