Index  | Recent Threads  | List Attachments  | Help  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password

Sweet Home 3D Forum

No member browsing this thread
Thread Status: Active
Total posts in this thread: 1
[ Jump to Last Post ]
Post new Thread
Previous Thread This topic has been viewed 3264 times and has 0 replies Next Thread
Advanced Member

Joined: May 3, 2010
Post Count: 223
Status: Offline
Reply to this Post  Reply with Quote 
Reading a texture from a plugin


Been trying an idea, for something I want to implement, and it works well, it requires loading an image to be used as a texture.

This is where I run in to the problem.

Can read the texture without problems from my desktop, which is okay for me.
The trouble I'm having is, reading the texture from a "resources" folder located with the class files in the plugin.

Tried looking through many the Sweet Home scr files, where images are loaded for texture and icons, to try and learn how to do this, also read many articles on the the Internet. Still failing to read the texture from within the plugin though! sad

At first I was trying:

this.sunflow.parameter("texture", "/resources/my_texture.png");


this.sunflow.parameter("texture", "/com/eteks/sweethome3d/plugin/advancedrendering/resources/my_texture.png");

Am I on the right lines with?

java.net.URL imageURL = AdvancedPhotoRenderer.class.getResource("resources/my_texture.png");

Thought it might help explaining what I've tried. Used the second method (replaced with the path to my desktop) to successfully read the texture.

Thank you in advance for any help offered!
It's really frustrating having lots of ideas, getting stuck and feeling bad asking for help, when should be able to work it out. sad

[Oct 10, 2010 5:23:51 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
© Copyright 2006-2018 eTeks - All rights reserved