Getting world rotations...

Kryslin

Active member
In LScript, you were able to grab an item's world rotations using a simple function, which was part of the object agent...

For a bone, that would have been <bone>.getWorldRotation(time)

Now, I'm trying to do the same thing with the Python SDK, which doesn't have that nicety.
I'm currently reading the Right, Up and Forward vectors using lwsdk.LWItemInfo().param(item_id, param, time). However, I'm probably missing something obvious here.
I'm not using any strange rotation orders, everything is bog standard HPB rotations.

Anyone care to give me a nudge in the right direction?
 

Kryslin

Active member
Instead of adding another thread, I'll just re-use this one for my questions...

In layout, is there a way to read tags attached to polygons?

For instance, when you convert skelegons to bones, it is reading information contained in tags attached to the polygons, because that is how skelegons and their name, orientation and weight map are stored. So, there has to be a way for reading them in Layout.

My investigations and searches in the SDK (both C and Python) reveal very little, so I thought I'd ask.
 

dpont

Member
thank you.

So, Mesh EditOps can be called in Layout, then?
Seeing the header of this page I even have a doubt about Mesh EditOps polyTag() in Layout,

so in Python, process should rather be Objectinfos…
meshInfo(LWItemID item, int frozen) → LWMeshInfo (frozen 0 for cage notsubpatched object)
then using the LWMeshes.h function,
LWMeshInfo polTag()

In the Python script samples, there's a "curve_to_spline.py"
which can help for iterating over polygons.



Denis.
 
Last edited:

Kryslin

Active member
Again, thank you for your assistance.

*edit* It appears that the Object Info -> MeshInfo path is the way to go. Ironically, the lwsdk.LWMeshInfo class is not documented in the Python SDK... grumble grumble grumble... Time to cut & paste the help into my reference document for various useful python classes in the lwsdk.
 
Last edited:

dpont

Member
...Ironically, the lwsdk.LWMeshInfo class is not documented in the Python SDK...
I guess that in this case you need to switch to the LWSDK doc,
in the "html" folder there's a meshinfo.html file, describing functions of the lwmeshes.h.,


Denis.
 

Kryslin

Active member
I did, so I knew what to look for. I don't understand, though, why the Python documentation is so incomplete.
Things I've had to pull help() on because it's not in the Python docs is point and polygon info classes in modeler, vectors, panels, controls, matrix math... and now MeshInfo.

I've gotten the help() information out of the lwsdk.LWMeshInfo class, and am using the SDK docs to annotate it.

Again, thank you for your help.
 
Top Bottom