View Full Version : DESPERATE!!! do you know of a script that does this already?
06-26-2007, 10:53 PM
Ok this is the situation....
Here at work we have engineering software that exports .obj files.
On these big models there of there are hundreds of these little widgets. Well having these little widgets all over everything is ballooning the file size up like crazy taking tons of ram and basicly killing everything.
So the engineer came up with a solution of exporting one single rectangle with one small side "kinda like an arrow" for every widget. this come over in a single .obj file.
Well when they used to do this in LW they had a plugin that would take one widget and place an instance of the widget centered on each of the retangles using the normal of the retangle and the smallest edge for alignment.
So, I have been searching hi and low for a script that does something like this does anyone know of one?
I have done some small mel scripts but I'm completly lost here.
I desperatly need this any help or pointers would be awsome!
Thanks in advance,
James Brad Barnette
06-27-2007, 01:37 AM
Sounds like a pretty unique problem you have there. I seriously doubt you'll find a script that does that already. But if you want to take a stab at scripting it yourself, I can give you a few pointers.
First of all, instancing the widgets is no problem. Just use the instance command.
For finding the position that the widgets should be in, I'd query the position of your arrow/stand-in objects using the xform command.
The toughest part will be orienting the widgets. For this take a look at this thread,
http://forums.cgsociety.org/showthread.php?t=502016. I have some procedures in there that are very useful for orienting objects to polygonal faces.
06-27-2007, 09:35 AM
What exactly do those widget do? are they important (meaning are they connect to something or just there floating around), do you want them to be convert to nurbs curves, or do you want to transform them into a one single poly face.
I'm pretty sure all that is more than doable.
If your widget are already in the necessary direction, you can just create a single face object in poly and connect the outputMesh of it to the inputMesh of all you widget they will all convert to the new mesh while preserving there orientation.
If you want to instance them then loop through each widget create an instance of your desire object (a single face poly) and use the delete`parentConstraint`command to snap the instance to the widget, then delete the widget.
At the end export all your scene in OBJ and reimport to be sure it's clean.
If you hav trouble writing such a script PM me.
06-27-2007, 05:00 PM
the widgets are actually some called and annode it is a device that is attatched to the hull of and oil rig to kepp it from rusting in the ocean.
Our engineering software exports a single poly at the location of each annode. each poly is in the shape of a rectangle so in theory using the poly's normal as the up direction "+Y" and then use the either of the short sides of the rectagle as my x axis alignment. I need to then take one annode model and instance it everywhere there is one of these polys. It is very inportant that this be done as instances.
now if I can only orient to the poly normal then I can make one annode horzontal and one vertical. and instance the horizontal ones seperate from the vertical ones.
06-27-2007, 09:51 PM
alright I'm confuse now...sorry.
Hopefully you can sort it out.
07-03-2007, 10:21 PM
Can you provide a sketch of the problem? That might help understand the problem better.
07-04-2007, 12:57 AM
sur thing I will post what I'm talking abotu on thursday when I get back in the office
07-04-2007, 12:57 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.