General discussion about Indigo Materials - material requests, material developement, feedback, etc..
-
benn
- Posts: 1046
- Joined: Mon Dec 08, 2008 12:47 pm
- Location: Wellington, New Zealand
-
Contact:
Post
by benn » Mon Jul 06, 2009 10:07 am
If you want to do some cool hacks with the material database - you might like this url:
http://indigorenderer.com/materials/mat ... xml?q=blue
It lets you search the materials database (just a fulltext search) and get the results as xml - which you can use to create a nice little UI for searching and using Indigo materials.
We've been thinking of opensourcing the material database so that you could run your own database in your organisation - might be handy if you had several hundred materials you share with other people in your company. Is anyone in this situation?
-
Whaat

- Posts: 1827
- Joined: Fri Dec 22, 2006 6:15 am
- Location: Canada
-
Contact:
Post
by Whaat » Mon Jul 06, 2009 1:23 pm
Ben,
I am able to open a web page using the SketchUp API but I am not sure how to call a function to get the XML feed without opening the user's web browser. Any ideas?
-
Whaat

- Posts: 1827
- Joined: Fri Dec 22, 2006 6:15 am
- Location: Canada
-
Contact:
Post
by Whaat » Mon Jul 06, 2009 4:22 pm
This code does nothing. Can you please tell me what's missing?
Code: Select all
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.load("http://indigorenderer.com/materials/materials/search.json?q=blue");
$.loadJSON("http://indigorenderer.com/materials/materials/search.json?q=blue", function(response){
$.each(response, function(){
alert(this.name);
});
});
});
</script>
</head>
<body>
</body>
</html>
-
suvakas

- Posts: 2613
- Joined: Mon Sep 04, 2006 11:08 pm
- Location: Estonia
-
Contact:
Post
by suvakas » Mon Jul 06, 2009 11:46 pm
Hey Ben,
Would you be so kind and put the material and image urls back to xml please?
Strange, you just fixed the paths yesterday, but now the image and pigm url elements are gone completely? Those are kind of important.
-
benn
- Posts: 1046
- Joined: Mon Dec 08, 2008 12:47 pm
- Location: Wellington, New Zealand
-
Contact:
Post
by benn » Wed Jul 08, 2009 12:42 am
Fixed!
-
suvakas

- Posts: 2613
- Joined: Mon Sep 04, 2006 11:08 pm
- Location: Estonia
-
Contact:
Post
by suvakas » Wed Jul 08, 2009 1:14 am
Thanks Ben !
Works Ok now.
-
Whaat

- Posts: 1827
- Joined: Fri Dec 22, 2006 6:15 am
- Location: Canada
-
Contact:
Post
by Whaat » Wed Aug 26, 2009 4:13 pm
ben,
Please take a look at this. I am using this code and I can't get the material names to display. Can you please post a full working example of how to use jquery to do the material database search? You would save me a world of frustration. Thanks
Code: Select all
<script type="text/javascript">
$(document).ready(function(){
$.getJSON("http://indigorenderer.com/materials/materials/search.json?q=blue", function(data){
$.each(data, function(i,item){
alert(data[i].name);
});
});
});
</script>
-
Whaat

- Posts: 1827
- Joined: Fri Dec 22, 2006 6:15 am
- Location: Canada
-
Contact:
Post
by Whaat » Wed Aug 26, 2009 4:24 pm
What do ya know? This works.
Code: Select all
$(document).ready(function(){
$.getJSON("http://indigorenderer.com/materials/materials/search.json?q=blue", function(data){
$.each(data, function(i,item){
alert(item.material.name);
});
});
});
-
benn
- Posts: 1046
- Joined: Mon Dec 08, 2008 12:47 pm
- Location: Wellington, New Zealand
-
Contact:
Post
by benn » Wed Aug 26, 2009 6:51 pm
Awesome! I'll help you out with the jquery stuff tomorrow if you have any other questions?

Who is online
Users browsing this forum: No registered users and 4 guests