I have 100-200 tiles that I need to rotate 180. I was thinking if I could animate a texture where black is 0 degress on an axcess and white is 180 I could make hundreds of objects flip according to the texture map I created.
Is there a way to do this, or is there a better way than using texture maps? Maybe proximity to another object would determine if it flips?
You can also use constraints, for example add a copy rotation constraint to all tiles except one and have that “master tile” control everything.
An example script to add constraints to selected objects:
import bpy
for objects in bpy.context.selected_objects:
nc = objects.constraints.new(type='COPY_ROTATION')
nc.influence = 1
nc.target = bpy.data.objects['Suzanne'] #insert mesh name here
and another one to turn the constraints off:
import bpy
for objects in bpy.context.selected_objects:
constraints = [ c for c in objects.constraints if c.type == 'COPY_ROTATION' ]
for c in constraints:
#objects.constraints["Copy Rotation"].influence = 1
objects.constraints["Copy Rotation"].influence = 0 #turn on or off by removing # and adding #
Would this though rotate them all at the same time? I was thinking of having them flip from left to right. So if I was using a gradient texture, I would move the texture from left to right, and the tiles would start flipping as soon as colors started changing. It would almost look like when a big crowd does the wave with their hands. It would start on one side and work its way across the whole thing.
If I had an black to white controlling the change, I could do anything I wanted. I could make a hand shape in black and the rest of the image white. All images in white would flip 180 and all images in black would stay at 0 degrees. Very similar to displacement mapping. Whatever your texture luminescent values are on a location affects the depth of the vertices below.
Would this though rotate them all at the same time? I was thinking of having them flip from left to right. So if I was using a gradient texture, I would move the texture from left to right, and the tiles would start flipping as soon as colors started changing. It would almost look like when a big crowd does the wave with their hands. It would start on one side and work its way across the whole thing.
yes, this woudl rotate them all at the same time… wasn’t specified in OP
you cant alter a objects rotation via a texture map… yet, animation nodes should probably support something along the lines of this.
your best bet is to look into drivers, get it working on one, then duplicate the plane out after the drivers are setup how you like them…
I have recently done a animation where there are 140 images in a grid but they were moving up and down based off a texture. I used a displacement map on a bunch of vertices in line with the grid of images, then parented each image to the dot below it. Each image then moved up and down according to the texture map I chose for displacement of the vertices. Could u take it a step further and make a driver that rotates an object according to the z location of another object which is parented to the displacement vertices? I know that is very complicated but it may allow for complete image control.
I really hope there is a better way though cause it makes my brain hurt thinking about how over complicated that is.
I have been messing around with the idea of a “track to” constraint. All the tiles would essentially be like a cat watching a laser on a wall. If the null they were tracking was level with them on the left, then passed by they would all spin over as the null object they are tracking passed over them. The higher the arc, the more they all spin together, the lower the arc, the more dramatic and the rotation. I still would like to try some ideas but this is working as a “good enough” solution.
Displacement modifier is differnet to rotation of the object… the displacement modifier works on a vertex level rather then object level…
to get it to ‘flip’ you need to work on an object level… as in all the vertices are moving relative to each other. which you can only do via constraints or drivers. Highly suggest you look into the driver solution.
Right. What I was saying was, I had successfully used displacement on a vertex. Then I parented an object to that vertex which allows me to control the objects Z location via a texture. You can control a rotation via another objects location.
So if object A is parented to a vertex. Object A’s location is controlled by the vertex. The vertex is controlled by displacement map.
I now driver Object B’s rotation using Object A’s Z location.
To sum up my theory, the vertex is moving Object A which has a driver to control rotation of Object B. Now I put a displacement map on the vertex and now they are all controlled via that displacement map.
Thank you very much! I am experimenting with the animation node idea, and it looks like it might have potential to animate the rotation based color. I haven’t found any tutorials yet on this but it is looking close.
I did find a tutorial which does animate values according to proximity which I may also end up getting this to work. https://www.youtube.com/watch?v=xfXUGdyICHg
If those tiles can be distributed as hairs you can try using hairs+force fields.
But to be honest after an hour trying and experimenting that i gave up, did not obtain the result i wished becouse the tiles/hairs rotation was alwais “strange”…
Probably someone more expert know how to use correctly those force fields.
in fact there are many solutions, drivers and constraints both should work, and there are a few scripts around -like unfold transition that has a flip faces option and use bones- but animation nodes is a good candidate
to use a texture with AN I would just feed a displace modifier with it, here’s a basic setup, you can move the displaced plane up and down to see effect or animate the texture… if you need uv mapped materials on the tiles then setup could be different… this example uses x/y coords of plane to place tiles and z to rotate, to add a custom interpolation just enable it on map range node and place and connect a construct interpolation node, it can all be done in many other ways though
AN is great, at least when you need to animate up to a few hundred objects… more than that can be too slow
other mentioned solutions would work too, but may need a little script to help in setting them up
ask if you have any doubts
Now how do I set up AN to work with my own set of objects instead of instances a single object?
I have been messing around but can’t figure it out. I attached my blend file. There are going to be 2 separate texture maps, with text on the flip side. When all the triangle flip over, a title will be revealed.