[x3d-public] X3D center versus blender location
John Carlson
yottzumm at gmail.com
Tue Jun 11 22:14:58 PDT 2024
Note that center is currently in the massive matrix generated for
HAnim/Transform on import. I am not sure how to separate out
center/location yet. The code is here:
https://github.com/coderextreme/BlenderX3DSupport/blob/78b6b1201cfd78b9327971849e2554fd2e39e584/io_scene_x3d/import_x3d.py#L1515
So it kind of seems like we have a center/location for HAnim and one for
Transforms. Do I do the same massive matrix multiplication the same way
for both? Centers for both are either relative to the HAnimHumanoid or the
origin, right? Yet translation, rotation and scale are relative to the
parent. Perhaps enhanced animation would help?
I think Joe tried to explain this, but I don’t know how to translate that
to code yet. I’ve read the standard for Transform. AFAIK, that is
reflected on the link.
The center remains the same regardless of other operations on the Transform
or HAnim node or its parents is my understanding. I don’t think location
is the same. That might be the problem. Maybe I’m wrong. Maybe I should
be considering delta_location in blender objects.
I’ve nearly given up and will probably return to Joint centers being the
head and tail of Blender bones, and start attaching empties to bones and
armature and mesh to empties. Unless I get hit by a bolt of lightning.
I’ll save the code as is.
I realize this is not the best solution for HAnim purposes. I still have
hope for a dual path. This will allow me to *easily* load skin weights
into vertex groups for Blender bones. Plus I will still modify export code
to convert empties to sites, segments and transforms, per previous emails.
John
On Tue, Jun 11, 2024 at 11:27 PM John Carlson <yottzumm at gmail.com> wrote:
> Obviously, these empty_obj’s are segments, and we’ll have to attach site
> empties to the empty_obj segments and the sites’ meshes and transforms to
> the site empties.
>
> But yeah, I’m still unsure what to do about locations of empties. Blender
> bones are a easy solution, but they don’t offer a generic solution.
>
> I was hoping to get some very simple examples working, but we got
> sidetracked.
>
> John
>
> On Tue, Jun 11, 2024 at 11:12 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> Summary:
>>
>>
>> mesh_obj.parent = empty_obj
>>
>> empty_obj.parent = armature_obj
>> empty_obj.parent_bone = bone_name
>> empty_obj.parent_type = 'BONE'
>>
>>
>>
>> If this works, we’ll have to tackle animation.
>>
>> OK?
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240612/bf78fd36/attachment-0001.html>
More information about the x3d-public
mailing list