Parent object to specific array count in blender

Hi,

I have created the cube like cartoon character with array modifier. I want to add the eyes & mouth shapes as a child object to the specific array count. So when I increase the array count that eyes & mouth always top of the cube. Is this possible?

Please find the attached screenshot image.

Regards,

Vasanth

Hello,

Maybe try Caps in array, create one more section just for face, and use it as Cap for end of the array.

Depending on your end goal there are a few solutions available

Option 1 Using a driver

Assuming that your eyes mouth hair etc are all individual objects.

  1. add an empty at the 1st box body shape location.
  2. parent the eyes, mouth hair, etc to the empty (positioned such that they appear as desired at with the body array set to 1 or disabled)
  3. parent the empty to the body object.
  4. select the empty and right click the Z location field.

add the driver

within the driver settings make the following settings
expression “var - (your body shapes initial height)”
in the variable section set the drop down of var to be a single property.
set the property as your body object.
set the path as dimensions[2] (this is the z-axis height)

(while you can techincally set it to the array modifier count then multiply by the dimensions of the original box subtracting the original box height its overcomplicating the goal to achieve the same result)

with the empty selected you should see the transform selection for z-axis as purple

select your body box shape and adjust your array count as desired. the facial features will follow the height.

array with driver

The major disadvantage of using a driver like this is that if you were to add a rotation or bend the empty would not track the final position.

Option 2 Using array end cap

create a duplicate of your body object at the origin
join the eyes mouth hair etc to the duplicate object

ensure both your original object and your new duplicate object contain all the materials used combined and in the same order.

endcap materials

on your body array modifier set the end cap to your face object

disadvantages

  1. there must be 1 body object and 1 head object
  2. if you already created shape keys for animating eyes mouth etc they are lost (merged) when joining all the objects together (if you have not created shape keys yet you still can w/o issue)

advantage

  1. you can now have your array and body shape fit and deform to a curve with the head always appropriately placed.

follow curve

Thanks a lot @nezumi.blend. You are explained very detailed way.

Hi nezumi.blend,

I have tried the option 01. I am using simple modifier for twist, bend, stretch for the body. How to parent the face objects to them. Please see the output result below for the better understanding…
Animation

Regards,
Vasanth

As mentioned above:

with regards to the original z position you could start with the expression (where 2 was the original body size):
(array_cnt -1)*2

and the variable data path being:
modifiers["Array"].count

but once you add a bend that value is no longer accurate and you would need to add a variable for the bend modifer and calculate the arc angle distance offset and change the expression.
you would also need to add a driver to the y and x positions as well as drivers to the x,y,z rotations.

This is why option 2 (using an array cap) simplifies things greatly.
The end cap is always placed at the end of the array

Thanks for your reply.

I want to animate the eyes & mouth, so before you mentioned that “option 2” is not suitable for animation.

I have no idea how to add angles to scripted expressions for “bend, twist, stretch (simple modifier)”. I have attached the .blend file. If it possible please go through this blend file and let me know your thoughts.

Regards,
Vasanth
numbers_01_and_02_v4.blend (2.5 MB)

end_cap_with shape keys

I did not say you couldn’t animate using an end cap I said if you already had shape keys they would be merged. As such you would need to re-create them.

Oh that’s great! Thanks for your inputs.

I have one more query. I have created the 10 different heads for each blocks, I want to switch that when I change the array count. How can I achieve this? Is this possible?

Thanks & Regards,
Vasanth

Not an easy automated task.

Best bet is to just manually change the endcap when you change the array count.