Announcing XMLShape v1.0 (Procedural Modeling of Buildings)

   6591   13   4
User Avatar
Member
98 posts
Joined: Sept. 2008
Offline
Dear all,

Thanks to all the support we received, we were able to finish a first version of our project XMLShape, about proceduralmodeling of buildings. This projects aims at the development of a lightweight, Houdini-based, implementation of the paper

P. Müller, P. Wonka, S. Haegler, A. Ulmer and L. Van Gool. 2006. Procedural Modeling of Buildings. In Proceedings of ACM SIGGRAPH 2006 / ACM Transactions on Graphics (TOG), ACM Press, Vol. 25, No. 3, pages 614-623.

As you can imagine, this first version is still very rough, with thousands of things to clean/improve/add, but we hope to be able to enhance it over time. Sources are available at

http//ima.udg.edu/~dagush/Projects/XMLShape/

We hope you enjoy it as much as we do. If you have any comments, please, feel free to send us an e-mail.

cheers

dagush & froure.-
————————-
* skylineEngine project coordinator
* buildingEngine module developer
http//ggg.udg.edu/skylineEngine
User Avatar
Member
345 posts
Joined:
Offline
:shock: Thanks!
very interesting.
User Avatar
Member
460 posts
Joined: July 2005
Offline
Hi

this is a very cool project

I try to run it but I had this error with every single demo

Traceback (most recent call last):
File “<console>”, line 1, in <module>
File “/home/varomix/houdini9.5/DOWNx/XMLShape_1.0/xmlshape.py”, line 30, in create
processar(doc)
File “/home/varomix/houdini9.5/DOWNx/XMLShape_1.0/xmlshape.py”, line 55, in processar
pre = rule.getElementsByTagName('predecessor')
AttributeError: Text instance has no attribute ‘getElementsByTagName’

thank you
varomix - Founder | Educator @ Mix Training
Technical Artist @ Meta Reality Labs
User Avatar
Member
98 posts
Joined: Sept. 2008
Offline
Hi,

I must confess I really don't know what might be going on in your case. From your error message, I guess you're working in Linux. We have developed in Windows. Then, the only thing I can think of is to change the routines that touch the “\n” “\t” problem (windows line ending) so, open a text editor, and comment lines 10 and 11 that read

s = natejar(fitxer)
doc = minidom.parseString(s)

and add

#s = natejar(fitxer)
#doc = minidom.parseString(s)
doc = fitxer.read()

I really hope this fixes the problem. If not, I guess I'll should keep on checking… -(

cheers

dagush.-
————————-
* skylineEngine project coordinator
* buildingEngine module developer
http//ggg.udg.edu/skylineEngine
User Avatar
Member
460 posts
Joined: July 2005
Offline
Hi

you are right I am a Linux user 8)

I did what you told me and now the error throws this

Traceback (most recent call last):
File “<console>”, line 1, in <module>
File “/home/varomix/houdini9.5/DOWNx/XMLShape_1.0/xmlshape.py”, line 31, in create
processar(doc)
File “/home/varomix/houdini9.5/DOWNx/XMLShape_1.0/xmlshape.py”, line 54, in processar
for rule in obj.firstChild.childNodes:
AttributeError: ‘str’ object has no attribute ‘firstChild’

I think it has to do with the XML parsing, maybe a python library I need or something I do have python XML, importing the this alone gives and error

>>> import xml.dom.Node
Traceback (most recent call last):
File “<console>”, line 1, in <module>
ImportError: No module named Node

that might have something to do
weird, this is python!!

thank you again
varomix - Founder | Educator @ Mix Training
Technical Artist @ Meta Reality Labs
User Avatar
Member
7028 posts
Joined: July 2005
Offline
Yeah, I'm on Linux too, and while I get no errors, when I try do xmlshape.create("/tmp/demos/casa.xml') Houdini just disappears with no errors, warnings or anything else

Cheers,

Peter B
User Avatar
Member
105 posts
Joined: July 2005
Offline
Somehow the XML iterator in OS X (and likely Linux) seems to generate empty ‘rule’ which causes the ‘AttributeError’ in line 55 first encountered by varomix:


File “/home/varomix/houdini9.5/DOWNx/XMLShape_1.0/xmlshape.py”, line 55, in processar
pre = rule.getElementsByTagName('predecessor')
AttributeError: Text instance has no attribute ‘getElementsByTagName’


To resolve this, unpack your xmlshape.py source file if you have made any changes to it, and add in this two lines starting from line 54:


line 53: for rule in obj.firstChild.childNodes:
insert-> line 54: # Check for empty rules generated
insert-> line 55: if len(rule.toxml()) > 5:
line 56: #PREDECESSOR
line 57: pre = rule.getElementsByTagName('predecessor')


Make sure you type two spaces (and not tab) before you enter the lines, Python uses spaces to designate code blocks so any misalignment will cause error(s). Also do not align these two newly inserted lines with those from lines 56 onwards, they should be two spaces before (or more).

The code above “len(rule.toxml()) > 5:” simply does a quick-n-dirty check to see if the iterated rule is a spurious one, if so, skip it and move to the next proper rule from the xml file.

On my Houdini build (202) on OS X, I need to do a File->New before running the xmlshape script again to load the next xml file. Otherwise the pop-up window to ‘save changes, discard etc’ will show and Houdini will hang with the spinning beachball.

Hope the above is understandable. Great stuff you've got there, dagush!

Cheers,
tk
User Avatar
Member
460 posts
Joined: July 2005
Offline
Thank you TK

tried that and now I get this

>>> xmlshape.create('/home/varomix/houdini9.5/DOWNx/XMLShape_1.0/demos/building1.xml')
Traceback (most recent call last):
File “<console>”, line 1, in <module>
File “/home/varomix/houdini9.5/DOWNx/XMLShape_1.0/xmlshape.py”, line 31, in create
processar(doc)
File “/home/varomix/houdini9.5/DOWNx/XMLShape_1.0/xmlshape.py”, line 54, in processar
for rule in obj.firstChild.childNodes:
AttributeError: ‘str’ object has no attribute ‘firstChild’


seems like python is not behaving
varomix - Founder | Educator @ Mix Training
Technical Artist @ Meta Reality Labs
User Avatar
Member
105 posts
Joined: July 2005
Offline
Hi varomix,

It looks like the XMLParser is not called to ‘parse’ the strings read from the file. I believe you still have the earlier patch to lines 10 and 11 which dagush provided that bypassed the line ‘doc = minidom.parseString(s)’.

Will need you to undo that by either re-unzipping and extracting the original xmlshape.py file and adding in the lines in my earlier post or undo the code change at lines 10 and 11 back to:


s = natejar(fitxer)
doc = minidom.parseString(s)
# doc = fitxer.read() <— remove/comment this line!


Hope this will help. Let me know if you still encounter problems

Cheers,
tk
User Avatar
Member
460 posts
Joined: July 2005
Offline
PERFECT!! thanks TK

Now it works perfect !!

thanks to all of you guys and thanks to TK I think this is now multiplatform
varomix - Founder | Educator @ Mix Training
Technical Artist @ Meta Reality Labs
User Avatar
Member
98 posts
Joined: Sept. 2008
Offline
Hi All,

I'll add the patch to my code, so any further release will be compatible with any O.S. Thanks, tkngs!!!!

cheers

dagush.-
————————-
* skylineEngine project coordinator
* buildingEngine module developer
http//ggg.udg.edu/skylineEngine
User Avatar
Member
7028 posts
Joined: July 2005
Offline
Hey Tk,

Thanks for that! My Houdini still disappears instantly, but if I use Hython and then mwrite the .hip file it loads up in Houdini OK so I at least can see what's going on

Cheers,

Peter B
User Avatar
Member
105 posts
Joined: July 2005
Offline
Thanks guys. Just chipping in what I know to help us all see dagush's procedural builder in action. Good stuff there!

Btw dagush, you may want to use this revised code as it's more ‘robust’ compared to the earlier ‘if len(rule.toxml()) > 5:’ comparison code:

if rule.hasChildNodes():

Hi Peter,
pbowmar
Thanks for that! My Houdini still disappears instantly, but if I use Hython and then mwrite the .hip file it loads up in Houdini OK so I at least can see what's going on
That's interesting, sounds like a crash occurred as the code is parsing the XML or generating the procedural objects (likely here). Which distro of Linux are you using? Perhaps I can try that and see what happens.

Thanks,
tk
User Avatar
Member
98 posts
Joined: Sept. 2008
Offline
Hi all,

I've just finished and uploaded version 1.5. Changes include the addition of cylinders for tower-like structures, tkngs's Linux patch and other bug corrections.
Now, after I introduced so many changes to add cylinders, cleaning up the code is now a priority. Once done, adding new geometric primitives like domes (half spheres) should be more or less easy. Also, I would like to add textures, but that means I should learn how to create/add them in Houdini -)
Again, the URL is

http//ima.udg.edu/~dagush/Projects/XMLShape/

cheers

dagush.-
————————-
* skylineEngine project coordinator
* buildingEngine module developer
http//ggg.udg.edu/skylineEngine
  • Quick Links