Results 1 to 11 of 11

Thread: Prometheus first bugfix..The Gear tool for layout script attached.

  1. #1
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    14,438

    Prometheus first bugfix..The Gear tool for layout script attached.

    Hi guys, thought I made this special thread for it, in my something feels wrong with lw 11.6 thread, I explained about a bug which has been in lighwave earlier than lw 11.6

    It happens when you create an emitter ..then add a gear with the layout gear tool, the gear isnīt created, so I messed with the gear script and found what I believe to be a faulty line.

    so hereīs the exerpt from my post in that thread...
    "Guys, I am not a coder, I have never compiled or created an L-script, wasnīt sure if I could text edit the script and save it properly...anyway, I have mad a bugfix.

    The bug(fix) of the gear tool not being created in layout if you add an emitter is done by me

    I simply opened up the lscript for the cube in layout and the gear tool in layout and compared the text lines, the gear tool had this line...
    newObject = Mesh();

    Where the cube tool has this line...
    newObject = Scene().firstSelect();

    So I simply replaced the geartool line with that of the cube tool line for the "newObject"
    Saved it in txt format and renamed the tool as create gear3.

    The gear tool now works in layout even if you create an emitter first.

    if you create an emitter in a scene...then try to create a gear with layout modeler tools, it wonīt work, this should fix it.

    heres my bugfix...no waiting for the next lightwave build

    And I seem to have advanced in brain capacity and reached another level from doing the advanced renaming of the box and ball tool to cube and sphere tool so they are consistent with the layout cube and sphere tool, to now have fixed this
    Attached Files Attached Files

  2. #2
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,806
    Mesh generators need object to work with.
    Therefore you need to make null item for them, prior running MeshDataEdit or CmdSeq plugin class.
    Scene().firstSelect()
    is simply returning the first selected item, which tool thinks is null item.
    It should have proper code to detect whether it's object, bone, light, camera etc. And show error message.
    but LScripters barely take care of security of their codes..
    LightWave Plugins
    Global Materials for LightWave 2019
    Custom plugin writing. Request a quote.

  3. #3
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    14,438
    Quote Originally Posted by Sensei View Post
    Mesh generators need object to work with.
    Therefore you need to make null item for them, prior running MeshDataEdit or CmdSeq plugin class.
    Scene().firstSelect()
    is simply returning the first selected item, which tool thinks is null item.
    It should have proper code to detect whether it's object, bone, light, camera etc. And show error message.
    but LScripters barely take care of security of their codes..

    Aha..and that means what?
    do you mean I did some faulty correction? or did you just confirmed that LScripters did a bad check on this tool?

    It works nicely now anyway, I just did some equal code copying here and comparison between the tools, I guess most people havenīt ran in to this, probably they have created a gear before the emitter, or never used it in conjunction with an emitter, or used the model version and sending over the object.

    I figured It was an null item issue, since the older lw versions needed a seperate null creation before you even could run the layout modeler tools, so thatīs why
    I went in the Lscript and figured the lines must be wrong....the other tools worked, so it was a gamble...but likely easy to fix...and I thought they simply missed tom change the gear tool.

    As I said, Iīm no coder so that might be why I donīt follow you exactly, you donīt have to go in to details for me to describe it all though it might be worth hearing for others.
    Michael

  4. #4
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,806
    No.
    I am just explaining you difference between the two scripts that you have seen prior any change you made to them.
    I didn't see similar behavior of Gear here - it's making new item each time. But I am working with fresh scene. Not sure about all that emitter stuff you're talking about.
    But I am using LW v11.6.1 Build 2727.
    But I see other more important issue with Gear - all polygons are flipped, and have to turn on Double Sidedness.
    LightWave Plugins
    Global Materials for LightWave 2019
    Custom plugin writing. Request a quote.

  5. #5
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    14,438
    Quote Originally Posted by Sensei View Post
    No.
    I am just explaining you difference between the two scripts that you have seen prior any change you made to them.
    I didn't see similar behavior of Gear here - it's making new item each time. But I am working with fresh scene. Not sure about all that emitter stuff you're talking about.
    But I am using LW v11.6.1 Build 2727.
    But I see other more important issue with Gear - all polygons are flipped, and have to turn on Double Sidedness.
    The question is...as I pointed out, did you create the emitter first? if you did, something is very wrong...over here that is.

    you are right about the no double sided, or more correctly.. flipped polygons in the z direction.

    the issue of creating an emitter first then add the gear and not getting it created has been an issue even in older versions.

  6. #6
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,806
    It appears there is at least 3 gear tools in Layout.
    One is Gear in Prims.p
    Second one is Gears.lws in LightWave v11.6.1 Build 2727\support\plugins\scripts\LScript\model
    and third one is Create Gear, not sure where it is..


    you are right about the no double sided, or more correctly.. flipped polygons in the z direction.
    What is even weirder, is that when we load this object in Modeler, polygons are fine - correct side pointing outside of object.
    Triple, and issue is gone.
    So it's something wrong with automatic tripling I guess so.
    Last edited by Sensei; 05-02-2014 at 11:16 PM.
    LightWave Plugins
    Global Materials for LightWave 2019
    Custom plugin writing. Request a quote.

  7. #7
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    14,438
    Dont mind about the gears in model..

    Next..we have two else to worry about, I think itīs the python script?

    but never mind that, I didnīt get any confirmation...did you create an emitter first, then used the gear tool in layout modeling tools?
    to confirm if you can create the gear or no?

    as far as I can see, there is only one gear tool under that modeler tools/create/geometry/Gear

    Or do you have even one more in there? could you have added another plugin or something?

    looking at the folders I found gears in ...
    C:\Program Files (x86)\NewTek\LightWave11.6.2\support\plugins\scrip ts\Python\Modeler\CommandSequence

    So that is probably two gear tools in modeler, one python and one lscript, and one script for layout.


    Michael

  8. #8
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    14,438
    Ah...I didnīt recognize the prim tools, when I look for gear and add it, I donīt go to primitive tools, so I was lost there...itīs not that gear tool I have used.

  9. #9
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    14,438
    And try it out and see what happens


    If you add an emitter first and use the primitive tool and adds a gear from there, the gear is created, but you cant move it, or the emitter.

    michael

  10. #10
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,806
    to confirm if you can create the gear or no?
    Yes. I see it's wrong.

    I do not have the gear prim.p strangely
    Search in Utils > Edit Plugins. Modeling section.
    LightWave Plugins
    Global Materials for LightWave 2019
    Custom plugin writing. Request a quote.

  11. #11
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    14,438
    Anyway, I got to have me a night sandwich, then sleep a little, the sun is coming up now unfortunatly.

    And my fixed script in the first post should work, if any of you guys manage to create a gear with the old script after you have created an emitter, then I would be very surprised.

    - - - Updated - - -

    Quote Originally Posted by Sensei View Post
    Yes. I see it's wrong.



    Search in Utils > Edit Plugins. Modeling section.
    Time lag...see my previous post, before your last one... I found it...and it wonīt work.

Bookmarks

Posting Permissions

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