Material database xml feed
Material database xml feed
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?
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?
Re: Material database xml feed
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?
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?
Re: Material database xml feed
Your wish is my command - use jquery and load this url:
http://indigorenderer.com/materials/mat ... son?q=blue
You can then iterate over the materials with json.
$.loadJSON("http://indigorenderer.com/materials/mat ... son?q=blue", function(response){
$.each(response, function(){
alert(this.name);
});
});
Ben
http://indigorenderer.com/materials/mat ... son?q=blue
You can then iterate over the materials with json.
$.loadJSON("http://indigorenderer.com/materials/mat ... son?q=blue", function(response){
$.each(response, function(){
alert(this.name);
});
});
Ben
Re: Material database xml feed
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>
Re: Material database xml feed
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.
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.
Re: Material database xml feed
Thanks Ben !
Works Ok now.
Works Ok now.
Re: Material database xml feed
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
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>
Re: Material database xml feed
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);
});
});
});
Re: Material database xml feed
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 33 guests