Script to place a selected object multiple times
Hi
Im not involved in 3D graphics but would like to produce images based upon some on some mathematics.
Basically I would like to have a file which can be rendered to produce images of translucent spheres at particular co-ordianates. (Think of marbles on a table making a pretty pattern)
I have a an Excel file (or CSV) which gives the x,y coordinates, the size of the sphere and its colour.
I wish to be able to run the script numerous times to produce different patterns and would like to be able to do something similar to shapes that are not spheres.
Id be happy to pay for such a script but am unsure how much it might cost.
Any advice or persons willing to take on this work would be appreciated.
Best wishes,
Nick
Comments
Rotate Clones
It worked!
fn createClones = (
for c=1 to clones.count do (
delete clones[c]
)
clones = #()
for i=1 to matrix.count do (
newClone = instance origObj
tmpBlocks = filterString matrix[i] ";"
tmpPos = filterString tmpBlocks[1] ","
tmpRot = filterString tmpBlocks[2] ","
newClone.pos = [tmpPos[1] as float,tmpPos[2] as float,origObj.pos[3]]
tmpRotateValue = tmpBlocks[2] as float
rotate newClone (angleaxis tmpRotateValue [0,0,1])
append clones newClone
)
undoBtn.enabled = true
)
Rotate Clones
It's been a while...
Hi, le1setreter!
And how I can rotate each clone with 3rd column, e.g.
60.125,23.536,270
59.9,30.075,270
137,26.15,270
54.275,20.611,270?
Thanks!
Marbles on an invisible convex disc
Thanks le1se for taking the time to do this.
I suspect the script you have written will probably do most of what I would ideally like. I will be asking others to run the script. Im Linux based and have never used any 3d software before starting this project. 20 hours into trying to learn Blender and Im fairly sure that without a miraculous revelation I will remain clueless.
I have been making 2d abstract images (mainly out of large dots) arranged in a pattern derived from a spreadsheet and have amended that spreadsheet and attached it to this post. The dots are arranged around a center and for objects that are not circular the column "rotationX" would make them point out from the center.
The spread sheet has a title line and then each row shows (size;x,y,z;r,g,b;rotationx,rotationy)
the size of the object compared to the original (assuming the original object to have a size of 1 unit).
the x,y,z coordinates of the center of the copy of the starting object.
the R,G.B of the object to be placed.
It then shows two columns "RotaionX" and "RotationY" the rotation of the object, this was not mentioned before because I am unsure how to express it for the 3d world, but for objects that are not symmetrical it would be good to be able to rotate them about 2 axis.(This Rotation aspect is a nice to have thing and wouldn't greatly effect me at this stage, In fact in the CSV the Rotation Y is set to zero for all the rows.)
If my understanding is correct if we started off with a clear glass sphere as our original object; your script together with this csv should place objects pretty much in one plane - like marbles on a disc (except the tops of the marbles are alligned rather than the bottoms) with each marble coloured. The marbles nearer the centre would be smaller than those further away.
Also attached is a photograph of one that I made from real marbles.
What I was after was a realistic image similar to the real marbles, showing colours both reflected and passing thru the marbles but with variation in marble sizes but the allure of being able to work in 3d has led me to want to be able to put the marbles onto a curved plane like a section of a sphere.
I hope this makes sense and appreciate the time and help you have given.
Best wishes
Nick
nicksoph, i have roughly
nicksoph, i have roughly done the script. its not cleaned up and optimized yet..
script, demo-csv and mini-tut-animgif is attached. have fun.
hi nicksoph, sounds like this
hi nicksoph,
sounds like this script should not be that big deal... at least the needs you described.
but what do you mean with "I wish to be able to run the script numerous times to produce different patterns[...]". do you want to load other excel/csv files?
mostly when it comes to adding more features and error validating these kind of scripts can take some more time than supposed at the beginning.
anyway, i think this script is easy. i would do it for free as a little practice and i believe other people in here think the same.
just post an example of your excel file and a demo max scene with the desired look (a part or some other image reference would also be fine) and especially some info on the material you would like to have. also try to clarify your needs as detailed as possible.
this would be a good way to start.
with best regards
-le1se
Rotate Clones.
t's been a while...
Hi, le1setreter!
And how I can rotate each clone with 3rd column, e.g.
60.125,23.536,270
59.9,30.075,0
137,26.15,180
54.275,20.611,90?
Thanks!