Okay, when I used body.setHpr, the visual model does not change its rotation, but the physics object rotates and seems to move to the position (0,0,0) which is a big problem.
Here is the code I tried:
class Block():
def __init__(self,Type,x,y,z,h,p,r):
#Load a model:
self.model = main.loader.loadModel("models/block.egg")
self.tex = loader.loadTexture('gfx/'+str(Type)+'.jpg')
self.model.setTexture(self.tex)
#Reparent the model to render:
self.model.reparentTo(render)
#Physics:
self.node = BulletMotionNode('box')
self.node.setTransform(TransformState.makePos((x,y,z)))
self.shape = BulletBoxShape(.4)
self.body = BulletRigidBody(0,self.node,self.shape)
physics.world.addRigidBody(self.body)
self.np = render.attachNewNode(self.node)
self.body.setHpr(0,0,0)
self.model.reparentTo(self.np)