Results 1 to 1 of 1

Thread: Python hurdles to new pythoneers

  1. #1
    Registered User
    Join Date
    May 2017
    Lampertheim, Germany

    Python hurdles to new pythoneers

    Hi together,

    I don't want to be the Rebell who always ranting about the things. I also want to spread some Information, so that maybe others can get a benefit from it (I hope so at least).

    So I dig out a hurdle, and if the things are known, it is much easyer to find Problems in an python.

    What I find out is the following (yes, if I think over it in retrospect, than it is clear)

    lets say you have an Array (ok in python.. lets say you have a list) which is build of other Arrays (lists). For example a list of verteces in space.
    call it pts and fill the list with lwsdk.Vector()

    ... and so on

    if you now do a
    and you where working on ptx than Keep in mind, that pts[1] Shows the same place in storage and if you Change ptx, than pts[1] will be changed too
    this is because only the pointer is used and ptx gets a copy of the pointer to the pts[1], so you in fact Change the storage at where the pointer Points. The same Position for ptx and pts[1].

    this did cost me some hours to find out because I do not really had found a way to debug python and even that I must restart the modeler to get back to a clear python isn't very helpful. Yes, I know this behaves on the way python did his Job.

    I'am shure that I am not the only one who has Problems like this, so it would be fine if some masters of python did tell how they deal with this. Especially in how to debug in LW-Python I would be interested.

    On the Problem with "restart modeler" I think about to build a dummy-script to lay it on a button and do an Import on the real script like:

    Import myscript; reload(myscript)

    or something like this.

    And for those who are interested in, I am on the way to Transfer the first nuArchitect member from LScript to python. it is not as far that i can give it others (the UV and TGA things aren't implemented now). But the UI did funtion as the one in nuArchitect and you can even generate geometry.

    And there is the Thing with the 2 bugs in the lwsdk.pris.modeler. To not must wait on an offical corrected Version I did Change 2 lines in the of this module. And this will be the reason why I do not give the away. So after there will be a changed Version of the lwsdk.pris.modeler, I will go on and post the first module of nuArchitect in python.

    Last edited by KANUSO; 04-02-2018 at 07:23 AM.


Posting Permissions

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