Hi all,
I’m currently working on a sort of personal addon to automate some of the tasks I do when taking models from revit to render with Cycles.
My first issue is that all the geometry imports horribly - many triangles no matter the format (dwg, fbx etc.)
This task I’ve used a for loop of quad faces command to quickly fix this. I know the decimate modifier is more thourough but takes much longer.
Secondly the origins are all over the place, which at best makes the model look extremely messy and at worst makes editing the componenets annoying. Another for loop for this which uses the parent clear and set origin commands.
Lastly are the materials. This is possibly the most important aspect of what I hope to achive. What i really want is to be able to auto assign materials from a library based on the object name (since these usually import into blender intact). This is simply checking the items name and applying a material I’ve already got in my startup file.
So far I can select a bunch of objects, click my GUI button and hey presto! it works.
The first issue is that it is slow. Painfully slow.So slow in fact that I’m loath to select more than about 50 objects at time. This brings me onto my second issue. There is litterally no way at the moment for the user to see how long the operation will take or how long theyll have to go or how fast the script is working. This is probably because of the large scale project I work on containing upwards of 11000 objects.
In fact this second issue might be the most important. Because even if the task was going to take two hours, at least the user would know!
I was wondering in the first instance… Has anyone done this before? is there already a tool for reducing geometry? Does it tell you how long it will take? Does it tell you how much the geometry has been reduced by? Can I auto assign materials based on name with the click of a button in some other addon?
If not are there any resources out there for learning first of all how to optimise these tasks in my code (beyond the obvious google searches). And secondly is there a way in blender to have the script give you a running count of how many objects youve processed (29 of 11000) for example. A time would be nice but from what I’ve read this is either very hard to do or impossible.
This project is sort of a learning experience for me so I’m going to try and not ask for direct code help and rather resources to learn about these things or code snippets with short explanations of how they work.
Again, appologies for the essay and thanks in advance for any help what so ever.
If it would help I can also post the script somewhere… not sure where to do this as I am quite new to the whole python thing…