- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I have a case where I want objects imported from ArchiCAD to have pivots aligned to a certain way.
Every object should have the pivot facing this direction on itself: (these are detached objects from building walls)
I got a script to work, at least to an extent, which was modified from somewhere I now don't remember (sorry):
fn alignPivotToFace node face:1 type:#z_up = if iskindof node Editable_Poly do ( c = polyop.getfacecenter node face n = polyop.getfacenormal node face ftm = translate (matrixfromnormal n) c case type of ( #x_up: prerotateY ftm -90 #y_in: prerotateX ftm -90 ) itm = ftm*(inverse node.transform) node.transform = ftm node.objectOffsetPos *= inverse itm node.objectOffsetRot *= inverse itm.rotation node.transform ) p = $ alignPivotToFace p type:#x_up
This script "consistently" makes my pivot like this:
Which is a good starting point, I only need to get it aligned to leftmost down boundary box, and turned -90 degrees on the z axis. I didn't get this to work in the script, but I'm sure it works with an add of a few lines (Help appreciated here too). So far so good, as it doesn't seem like an unsolveable problem.
But when I'm executing the script, it seems like some polys from ArchiCAD aren't following the same terms.
Like this ****:
How can I get this to work...? Any way to force / embed a z up position in the "bad" polys, before executing the script?
I'm lost now, and banging my head against the wall. Big thanks!
Solved! Go to Solution.