Results 1 to 3 of 3

Thread: Python help() question...what is lnum?

  1. #1
    Red Mage Celshader's Avatar
    Join Date
    Feb 2003
    Burbank, California

    Question Python help() question...what is lnum?

    I'm trying to see if a given object has had its pivot point moved. I can parse the text of the scene file in order to do this, but I'd rather learn the "right" way in LightWave Python.

    The LWObjectFuncs has a function called "pivotPoint." I'm hoping that this might return the pivot offset if one exists, but I could be looking in the wrong spot. However, I'm confused about part of the documentation:

    pivotPoint(self, *args)
    pivotPoint(self, int obj, int lnum)
    What is "lnum"? I'm having trouble figuring this out.

    I figured out that "int obj" refers to the index of the object, and not the object ID. That is, if you had five entries in the Current Item list, an "int obj" of 0 would ignore any nulls and instead return the very first LoadObjectLayer item present in the scene.

    However, I'm not yet sure what "lnum" represents. Does it refer to the "DATA" variables listed in help(lwsdk)?
    Jen's 3D -- LightWave stuff.
    Jen's 2D -- my comic book.

    Python is my smashing board. LightWave is my S.M.A.K.

  2. #2
    Quote Originally Posted by Celshader View Post
    What is "lnum"? I'm having trouble figuring this out.
    lnum would be the layer number of the object. The help seems to omit what pivotPoint should return though, so that will be an exciting surprise.
    Johan Steen
    3D Portfolio | Twitter

  3. #3
    LightWave Engineer Jarno's Avatar
    Join Date
    Aug 2003
    New Zealand
    As discussed via email, that isn't quite the right function to use for what you want to do. You're after the item pivots, not the mesh pivots. But for completeness sake, lnum is the layer number or index.

    In Layout the same LWO can be referenced by multiple object items. LWObjectFuncs gives access to the database of loaded LWOs. The connection between an object item and the LWO is via the filename. You get the LWO filename for an item from LWObjectInfo, then match that up with the filenames of the objects in the database using LWObjectFuncs.

    An item in Layout can reference only one layer in an object. The index of the layer which it is referencing can be obtained by parsing the item name to extract the layer name, and then matching it with the layer names obtained through the LWObjectFuncs.

    There is no relation between the object index and the LWItemIDs or the order in which items are in the scene.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts