View Full Version : Two questions about parenting and instancing

03-02-2014, 12:46 AM
I'm trying to setup a city with the Metropolitan pack from Video Copilot, which comes in several formats, and after taking a look at how well they import, I settled for FBX. There are 6 layouts that are each a full city block with buildings. This is the problem I have: when I import the FBX, it comes in fine. However, all the objects inside are imported as separate objects, so to make things more neat I create a null and parent all the items in each block layout to its respective null, so I have six nulls that I can use to move the whole block around and instance. So far so good. The problem is that once all the objects of each block are parented to a null, many objects remain the same, and some go crazy. They become rotated 90 pitch, but also sometimes displaced, and it's a mess to fix it all, so in that case I would opt for loading the OBJs, which come all as one object. The problem with the OBJs is that the textures are not all mapped, for example reflection textures are not mapped at all and I have to guess which objects other than buildings would have a reflection map. So if anyone has any clue on why this normally happens, objects going berserk when parenting to a null, I would really appreciate it.

The other question is how can I randomize rotation, but only in steps of 90. There is a thread here that is over a year old where Dpont posts a method, but then someone mentions it causes a problem when rendering. His method is:

Connect the Instance ID (Instance Info node)
in the A input of a Math Scalar node, set B to 4,
so for your Instance sequence you will get 0, 1, 2 or 3,
multiply by a Constant Angle node set to 90,
it converts this angle to radian which is the correct
unit for the node editor, you get 0, 90, 180 or 270 angles
for your sequence, connect this result in the X Input
of a Make Vector node (Heading), plug it in Rotation.

You could skip the Math Mod node, just multiplying
the Angle by the Instance ID but not sure with
a huge number of instances, when you reach great
angle values.

Is this the best possible way? Or is there a simpler way?



03-02-2014, 01:46 AM
One thing I realized after typing this is that some objects have their pivot points rotated in the wrong direction. The Y axis is pointing to the side, and the Z axis is pointing downwards. Perhaps that's the reason why when parenting they rotate around, but rotating the pivot doesn't seem to change anything, when I switch back to move to see the arrows, the Y keeps pointing to the side and the Z downwards.

03-02-2014, 04:54 AM
Make sure parent in place is on.

03-02-2014, 12:29 PM
Make sure parent in place is on.


Even though it took care of that, I would like to know, if you have some objects that on import have their pivot with the wrong rotation, shouldn't the Rotate Pivot function fix that, as long as you rotate it the right way? In this case a few objects are off like I described above, possibly because of something that got messed up when they exported it to FBX, but I'm surprised that when I rotated the pivot and switched back to move to see the arrows, they were still pointing in the wrong direction except for the X.