Just so you can see what you are getting into, here’s how it normally done:
Assets:
3D model of rubics cube.
3d model or scan of the persons hand (low poly hand may be enough – whether you need this element or not depends on the shot)
High quality hand held footage of actor with empty hand (usually with tracking markers). (re high quality: the larger and closer to uncompressed the footage is the better the track)
Method
3D track the hand and the world.
Rotoscope the fingers that cover parts of the cube and make a matte.
Remove the tracking dots from the live action hand.
Bring the camera solve from the 3D tracker into the 3D package and set up your “world” to include the 3D hand and rubics cube and correct lighting. Generate a reflection map that corresponds to the world and the hand.
Match move the 3d hand model to the actors movement. This may involve more than just matching the motion, often you will have to animate the hand (finger flexing etc) to match.
Attach the movement of the hand to the rubics cube and then animate the rubics cube if it does more than just sit in the hand. Run a dynamics simulation (or animate by hand) to have the rubics cube fall apart, with the sub cubes of the larger cube interacting with each other – this requires a physics engine and rigid body simulations and some gravity.
Turn off the 3D hand and render 3D rubics cube element with alpha channel, depth of field channel, motion blur channel and a shadow pass channel.
Composite the 3D elements onto the 2d shot, using the rotoscoped element to mask out obscured parts of the cube in the hand and the shadow pass element. Add a little frame by frame hand paint to fix anything that needs it (its gonna happen)
Color correct elements so they match.
Adding a 3D element into a 2D shot is hard but gets exponentially harder when it has to be: in contact with a human, a moving human, a moving human and a moving camera.
A few years ago, we(and a few other companies) were asked to replace a baby doll in a movie with either a CG baby or a real one, where the main actor holds and cradles the doll. There was no amount of money they could have offered where we would have said yes. The baby doll remains in the movie. If elements had been shot to accommodate such an effect it would have still been hard, but as it was…..
What you need to do is very doable, but its not for the faint of heart, assuming it has to look real.