0

there are two cubes on the same spot

two cubes on the same spot

but

When I use this(similar might not work if you try)

def parent_set(object, armature, bone):
    object.parent = armature
    object.parent_bone = bone
    object.parent_type = 'BONE'

objj = bpy.data.objects parent_set(objj['object'], objj['Armature'], 'bone')

it does something like this

Weird offset

How can i fix this

hakk akkk
  • 1
  • 2
  • batFINGER the armature is in the picture it looks like it parents it to the head but it isn't consistent it sometimes puts it on the some "random" spot – hakk akkk Jul 16 '21 at 04:19
  • Try my answer on same question you gleaned your question code. – batFINGER Jul 16 '21 at 04:46
  • i got the this version of the code from your answer – hakk akkk Jul 16 '21 at 05:06
  • so i found something that when i apply the transforms it puts it on the head – hakk akkk Jul 16 '21 at 05:11
  • but it kinda brokes my code – hakk akkk Jul 16 '21 at 05:16
  • To me it looks like the accepted answer, which pointed out the error in my first answer version (which was parenting to head) After which added a long winded edit on getting different results. The "random" offset you are seeing is quite likely the basis matrix of the cube. – batFINGER Jul 16 '21 at 05:16
  • so how can i fix it btw my original code uses def parent_set(object, armature, bone): object.parent = armature object.parent_bone = bone object.parent_type = 'BONE' objj = bpy.data.objects parent_set(objj[str(1+i)+'_obj'], objj['Armature_pyhs'], str(1+i)+'_bone') – hakk akkk Jul 16 '21 at 05:33
  • hmmmm i changed the post to "original form with some grammar fixes" and i tried your script and it did the similar thing – hakk akkk Jul 16 '21 at 06:02
  • Apologies, was missing the wood from the trees, will edit prior answer. – batFINGER Jul 18 '21 at 11:22
  • so i botched it instead i just changed location of them (the objects that are parented to the bones) and added a different script that parent the objects to the with Automatic Weights – hakk akkk Jul 19 '21 at 16:12

0 Answers0