Is it possible to apply the same rotations on more than one part at the same time? E.g. rotate each part around the y axis by 90 degrees for instance, but not around a common center but around each part locally. Can this be done in MLCAD?
Operating on multiple parts
Maybe you should go to LDDP Homepage. This app in dedicated for mathematical operation on LDraw models too.
Lego isn't just a brand of plastic bricks. It's a lifestyle; and artistic medium.
RE: Operating on multiple parts
2017-12-27, 18:53 (This post was last modified: 2017-12-29, 0:38 by Michael Horvath.)
2017-12-27, 18:53 (This post was last modified: 2017-12-29, 0:38 by Michael Horvath.)
(2017-12-27, 11:07)Jarema Wrote: Maybe you should go to LDDP Homepage. This app in dedicated for mathematical operation on LDraw models too.
Thanks. I was actually thinking that this might be easier by editing the source files by hand, and LDDP seems designed for that.
RE: Operating on multiple parts
2017-12-27, 18:58 (This post was last modified: 2017-12-27, 19:05 by Roland Melkert.)
2017-12-27, 18:58 (This post was last modified: 2017-12-27, 19:05 by Roland Melkert.)
(2017-12-27, 2:38)Michael Horvath Wrote: Is it possible to apply the same rotations on more than one part at the same time? E.g. rotate each part around the y axis by 90 degrees for instance, but not around a common center but around each part locally. Can this be done in MLCAD?
You can do this in my LDCad if you not afraid of an adventure in scripting.
edit: using this script:
Code:
function onRotInsRun()
local sf=ldc.subfile()
if sf:isLinked() then
local sel=ldc.session():getSelection()
local ori=ldc.matrix()
ori:setRotate(45,0,1,0)
for i=1,sel:getRefCount() do
local ref=sel:getRef(i)
ref:setOri(ori)
end
end
end
function register()
local ani=ldc.macro('Rotate instances')
ani:setEvent('run', 'onRotInsRun')
end
register()
(2017-12-27, 18:58)Roland Melkert Wrote:(2017-12-27, 2:38)Michael Horvath Wrote: Is it possible to apply the same rotations on more than one part at the same time? E.g. rotate each part around the y axis by 90 degrees for instance, but not around a common center but around each part locally. Can this be done in MLCAD?
You can do this in my LDCad if you not afraid of an adventure in scripting.
edit: using this script:
Code:function onRotInsRun()
local sf=ldc.subfile()
if sf:isLinked() then
local sel=ldc.session():getSelection()
local ori=ldc.matrix()
ori:setRotate(45,0,1,0)
for i=1,sel:getRefCount() do
local ref=sel:getRef(i)
ref:setOri(ori)
end
end
end
function register()
local ani=ldc.macro('Rotate instances')
ani:setEvent('run', 'onRotInsRun')
end
register()
Can I select the objects to operate upon using the mouse? That would save a lot of time.
RE: Operating on multiple parts
2017-12-27, 22:24 (This post was last modified: 2017-12-27, 22:31 by Roland Melkert.)
2017-12-27, 22:24 (This post was last modified: 2017-12-27, 22:31 by Roland Melkert.)
(2017-12-27, 21:47)Michael Horvath Wrote: Can I select the objects to operate upon using the mouse? That would save a lot of time.
Yes it uses the active selection and applies the 45 deg rotation matrix to them all.
I've reworked the macro to apply the rotation of the first item in a selection (the one clicked first) to all the other items in the selection.
As this is a handy thing to have I added it to the samples module for the next version, but you can easilly use it now by replacing %appdata%\LDCad\scripts\default\global\samples.lua by the one in the attached zip file
You can use it on any selection through "scripts/samples/copy orientation" menu when installed.
ps: I'm assuming you're using the latest 1.6 version and not the older one from the AIOI. If so you can upgrade by running the 1.6a setup.
« Next Oldest | Next Newest »
Users browsing this thread: 3 Guest(s)