I'm having problems with the Blender_Importer_2 and ss_importer2 scripts that came with structure synth 1.0. I used to import objects from SS into blender using the old ss_importer by David Bucciarelli but the problem was that it didn't come with color support. The export templates that came with SS 1.0 work perfectly but I'm having problems with the python scripts within blender: the Blender_Importer_2 shows this error message in the console when I try to run it:
I really don't see anything wrong with it, in fact I checked the old script that I was using and it has the same line of code... then I tried to use the ss_importer2 modded by SourceZuka (I think) and it also didn't work; it throws countless "material already added" messages in the console and creates the object with just one color.
I could use sunflow to render objects with many colors, and it works fine but I feel that its a little bit akward and slow to set AA levels, DOF, light sources and other things by typing them in the template.
I really don't know much about python so if anyone could help I'd be in your debt.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It could be the tabs, or spacing... I'm using linux. I'm not really a python expert, I just hacked that script to get it to work... But I do know that if the tabs aren't exactly right it will complain...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-08-10
Hi,
I experienced strange behaviour of the importer script. Well, at least I think so. Maybe it's just some stupid mistake I made because I know nearly nothing about Blender. At first, I had some trouble finding a version that worked, in the end I took the latest from the SVN. I don't get any error messages, but it seem as if the script applies materials to geometry rather randomly and not in the way it should. Some objects seemed to have multiple materials (even if not, they still had wrong materials, in one case everything was green, even though there was only one green object in the original scene).
Something completely different: Structure Synth is the most interesting and amazing program I discovered in quite some time. Continue the good work!
Henrik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Glad you liked Structure Synth! I'm afraid I'm not very familiar with Python either, but if anyone out there has managed to get the Blender/Structure Synth import working, please share your experience!
Regards, Mikael.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, Let me explain a little about the way the python script processes the colors.
It creates a new material for each unique color and uses a material name similar to the RGB value like 255.133.433 for example. When it finds a new color in the model it searches the existing materials to see if there is already a material with that color (based on name). If it finds an existing material it reuses that.
The problem is the object is imported as one mesh (each struct synth object merged into one mesh). I think this is better because you can apply modifiers such as subsurf on the entire thing, if you have 100 little objects you would have to select each one.
Anyway, blender currently has a limitation of 16 materials per mesh. So if your model has a nice rainbow spectrum of 32 colors, when the script gets through the 16th color and tries to create a new material and assign it to the mesh it will have a problem and you will get unexpected results. The script doesn't handle the error very well, but that's probally what's happening.
The way I got around this is maybe make the color change every 5 steps instead of 1 step in struct synth so you only end up with no more than 16 colors...
Maybe blender 2.5 will fix this problem, or maybe I'm missing something... but that's my understanding of the problem... :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BTW - I looked at trying to create one mesh for each struct object, and I was having problems with applying transformations to get the rotation and location right... My blend / python script experience is limited and I just modified the existing script to handle colors... If the script created one mesh for each struct synth object it would be able to handle many many colors... but there are disadvantages to that approach also...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-08-16
I know about the sixteen colour limitation and my scene had less than sixteen colours. I tried it again and documented what happened:
This is my simple test scene with only four colours. The green sphere is supposed to be a light source.
I imported the scene to Blender, assigned matte materials to red, blue and white and made green a light source (everything inside the luxrender exporter). Inside Blender, the colours look right (even though one time I tried it everything was green). That's what it looks like in luxrender:
Maybe that's not even an error in the importer script, but in luxrender (or the way I use any of these). The Blender renderer renders it right, with Yafaray, however, everything is white.
I hope that helps.
Henrik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-09-02
I'm sorry, it turns out that the problem I experienced is a bug in Luxrender that appears if you have light emitting surfaces on one object/mesh, and the importer script imports everything as one single object/mesh. You can read more about it here: http://www.luxrender.net/forum/viewtopic.php?f=16&t=2709
There also is a workaround but it is impractical if you have large and complex structures.
Henrik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-09-13
Is there nobody who is able to or wants to make this script acutally work? I'm not blaming those who wrote this, I couldn't do that at all, so thanks to you, but I would be really happy if it worked better. I experienced a (to me) new problem: I tried to import a structure to Blender with only two colors, but the "more than sixteen colors" error appeared. Inside Blender, I had an object with no geometry or a really small object, it appeared as a small dot, with sixteen materials, which all had the same color. In one case, I got the import to work by changing the Eisenscript (where does that name come from?) slightly, without changing the resulting structure.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hey, sorry to hear your frustrations. I modified the original script to support colors and didn't do it from scratch. It actually took me about a day to figure out how it worked and modify it. Many thanks to the people who contributed to the original script. During my modifications, I think I remember that if you run the import a script twice without creating a new blender scene, I got some color or material related errors. My suggestion is to start with a clean slate and have a new blender scene whenever running the script. I know it's a bad excuse and I could have spent more time to streamline it so it's bullet proof but I ran out of time and have been busy with other things. I'm living in china which is a foreign country for me and am in the process of starting a new job… life is a bit hectic now. sorry I can't spend more time on this now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there!
I'm having problems with the Blender_Importer_2 and ss_importer2 scripts that came with structure synth 1.0. I used to import objects from SS into blender using the old ss_importer by David Bucciarelli but the problem was that it didn't come with color support. The export templates that came with SS 1.0 work perfectly but I'm having problems with the python scripts within blender: the Blender_Importer_2 shows this error message in the console when I try to run it:
SyntaxError: invalid syntax
File "Blender_Importer_2.py". line 178
elif args[argsIndex] == "m":
^
SyntaxError: invalid syntax
I really don't see anything wrong with it, in fact I checked the old script that I was using and it has the same line of code... then I tried to use the ss_importer2 modded by SourceZuka (I think) and it also didn't work; it throws countless "material already added" messages in the console and creates the object with just one color.
I could use sunflow to render objects with many colors, and it works fine but I feel that its a little bit akward and slow to set AA levels, DOF, light sources and other things by typing them in the template.
I really don't know much about python so if anyone could help I'd be in your debt.
Thanks!
Hi,
I'm not into Python either, so I probably made an error when I added the new code suggested by SourceZuka (the new code was added at line 178 :-)).
The changes were suggested by Zuka here: http://www.luxrender.net/forum/viewtopic.php?f=14&t=585&p=17935#
I'll mail Zuka and ask for a complete python script.
PS: Try removing the tabs in the empty line 177 - these might break something.
Hey, finally logged in... had to try different browser, firefox gave me error message during login...
how do I post file here?
Hi, I don't think you can attach files :-(
If you mail the files to mikaelhc at gmail.com I'll add them to the sourceforge repository.
Regards, Mikael.
just emailed it to you...
It could be the tabs, or spacing... I'm using linux. I'm not really a python expert, I just hacked that script to get it to work... But I do know that if the tabs aren't exactly right it will complain...
Thanks.
I've added the file to SVN.
Hi,
I experienced strange behaviour of the importer script. Well, at least I think so. Maybe it's just some stupid mistake I made because I know nearly nothing about Blender. At first, I had some trouble finding a version that worked, in the end I took the latest from the SVN. I don't get any error messages, but it seem as if the script applies materials to geometry rather randomly and not in the way it should. Some objects seemed to have multiple materials (even if not, they still had wrong materials, in one case everything was green, even though there was only one green object in the original scene).
Something completely different: Structure Synth is the most interesting and amazing program I discovered in quite some time. Continue the good work!
Henrik
Hi,
Glad you liked Structure Synth! I'm afraid I'm not very familiar with Python either, but if anyone out there has managed to get the Blender/Structure Synth import working, please share your experience!
Regards, Mikael.
Hi, Let me explain a little about the way the python script processes the colors.
It creates a new material for each unique color and uses a material name similar to the RGB value like 255.133.433 for example. When it finds a new color in the model it searches the existing materials to see if there is already a material with that color (based on name). If it finds an existing material it reuses that.
The problem is the object is imported as one mesh (each struct synth object merged into one mesh). I think this is better because you can apply modifiers such as subsurf on the entire thing, if you have 100 little objects you would have to select each one.
Anyway, blender currently has a limitation of 16 materials per mesh. So if your model has a nice rainbow spectrum of 32 colors, when the script gets through the 16th color and tries to create a new material and assign it to the mesh it will have a problem and you will get unexpected results. The script doesn't handle the error very well, but that's probally what's happening.
The way I got around this is maybe make the color change every 5 steps instead of 1 step in struct synth so you only end up with no more than 16 colors...
Maybe blender 2.5 will fix this problem, or maybe I'm missing something... but that's my understanding of the problem... :)
BTW - I looked at trying to create one mesh for each struct object, and I was having problems with applying transformations to get the rotation and location right... My blend / python script experience is limited and I just modified the existing script to handle colors... If the script created one mesh for each struct synth object it would be able to handle many many colors... but there are disadvantages to that approach also...
I know about the sixteen colour limitation and my scene had less than sixteen colours. I tried it again and documented what happened:
This is my simple test scene with only four colours. The green sphere is supposed to be a light source.
http://dl.getdropbox.com/u/885401/blenderimporter1.png
I imported the scene to Blender, assigned matte materials to red, blue and white and made green a light source (everything inside the luxrender exporter). Inside Blender, the colours look right (even though one time I tried it everything was green). That's what it looks like in luxrender:
http://dl.getdropbox.com/u/885401/blenderimporter2.png
I tried it again and made green a matte material and got a message that there was no light source. If red is the light source, it looks like this:
http://dl.getdropbox.com/u/885401/blenderimporter3.png
Maybe that's not even an error in the importer script, but in luxrender (or the way I use any of these). The Blender renderer renders it right, with Yafaray, however, everything is white.
I hope that helps.
Henrik
I'm sorry, it turns out that the problem I experienced is a bug in Luxrender that appears if you have light emitting surfaces on one object/mesh, and the importer script imports everything as one single object/mesh. You can read more about it here:
http://www.luxrender.net/forum/viewtopic.php?f=16&t=2709
There also is a workaround but it is impractical if you have large and complex structures.
Henrik
Is there nobody who is able to or wants to make this script acutally work? I'm not blaming those who wrote this, I couldn't do that at all, so thanks to you, but I would be really happy if it worked better. I experienced a (to me) new problem: I tried to import a structure to Blender with only two colors, but the "more than sixteen colors" error appeared. Inside Blender, I had an object with no geometry or a really small object, it appeared as a small dot, with sixteen materials, which all had the same color. In one case, I got the import to work by changing the Eisenscript (where does that name come from?) slightly, without changing the resulting structure.
hey, sorry to hear your frustrations. I modified the original script to support colors and didn't do it from scratch. It actually took me about a day to figure out how it worked and modify it. Many thanks to the people who contributed to the original script. During my modifications, I think I remember that if you run the import a script twice without creating a new blender scene, I got some color or material related errors. My suggestion is to start with a clean slate and have a new blender scene whenever running the script. I know it's a bad excuse and I could have spent more time to streamline it so it's bullet proof but I ran out of time and have been busy with other things. I'm living in china which is a foreign country for me and am in the process of starting a new job… life is a bit hectic now. sorry I can't spend more time on this now.