Home Coding, Scripting, Shaders

Sequoia Meshing Hacksaw 3ds Maxscript Error

Hello everyone, apologies upfront as I lack the programming knowledge to understand the problem I am having. I have been trying to utilize Thinkbox Sequoia Meshing, the program comes with 3ds integration maxscript for loading Seq. .xmesh into 3ds.

Code on GITHUB:

They have provided a .ms file which I have loaded and run. This creates a toolbar button that loads the sequential xmesh files. Whenever I run the script and point the macro to the correct file, once I click load I get this error.

I do not understand what this means. If anyone could point me in the right direction it I would really appreciate it.

Listener Window:

  1. -- MAXScript Rollout Handler Exception:
  2. -- Type error: Call needs function or class, got: undefined
  3. -- MAXScript callstack:
  4. --    thread data: threadID:16252
  5. --    ------------------------------------------------------
  6. --    [stack level: 0]
  7. --    In f loop; filename: C:\Users\jkcam\AppData\Local\Autodesk\3dsMax\2022 - 64bit\ENU\usermacros\Sequoia-LoadSQHacksaw.mcr; position: 9551; line: 261
  8. --    member of: codeblock macroScript: Sequoia_LoadSQHacksaw
  9. --        Parameters:
  10. --            f: 1
  11. --        Locals:
  12. --            XMeshLoader: undefined
  13. --            theCurrentFile: "D:\FULL SECTION-221201_1of9.xmesh"
  14. --            f: 1
  15. --            isExistingNode: undefined
  16. --            theLoader: undefined
  17. --            theTextures: undefined
  18. --            theMat: undefined
  19. --        Externals:
  20. --            theFiles: Free:theFiles : #(#("D:\FULL SECTION-221201_1of9.xmesh", true, false), #("D:\FULL SECTION-221201_2of9.xmesh", true, false),
  21. #("D:\FULL SECTION-221201_3of9.xmesh", true, false), #("D:\FULL SECTION-221201_4of9.xmesh", true, false),
  22. #("D:\FULL SECTION-221201_5of9.xmesh", true, false), #("D:\FULL SECTION-221201_6of9.xmesh", true, false),
  23. #("D:\FULL SECTION-221201_7of9.xmesh", true, false), #("D:\FULL SECTION-221201_8of9.xmesh", true, false),
  24. #("D:\FULL SECTION-221201_9of9.xmesh", true, false))
  25. --            Sequoia_LoadSQHacksaw: <CodeBlock:Sequoia_LoadSQHacksaw>
  26. --            chk_showTextures: RolloutControl:chk_showTextures in rollout:LoadHacksawPartitions_Rollout : CheckBoxControl:chk_showTextures
  27. --            endframe: Free:endframe : 9
  28. --            chk_assignMaterials: RolloutControl:chk_assignMaterials in rollout:LoadHacksawPartitions_Rollout : CheckBoxControl:chk_assignMaterials
  29. --            owner: <CodeBlock:Sequoia_LoadSQHacksaw>
  30. --            getPossibleTextures: getPossibleTextures()
  31. --            newObjects: Free:newObjects : #()
  32. --            cnt: Free:cnt : 1
  33. --            chk_selfIlluminated: RolloutControl:chk_selfIlluminated in rollout:LoadHacksawPartitions_Rollout : CheckBoxControl:chk_selfIlluminated
  34. --            prg_progress: RolloutControl:prg_progress in rollout:LoadHacksawPartitions_Rollout : ProgressBar:prg_progress
  35. --            startframe: Free:startframe : 1
  36. --    ------------------------------------------------------
  37. --    [stack level: 1]
  38. --    called from btn_loadPartitions.pressed(); filename: C:\Users\jkcam\AppData\Local\Autodesk\3dsMax\2022 - 64bit\ENU\usermacros\Sequoia-LoadSQHacksaw.mcr; position: 10539; line: 285
  39. --    member of: Rollout:LoadHacksawPartitions_Rollout
  40. --        Locals:
  41. --            theFiles: #(#("D:\FULL SECTION-221201_1of9.xmesh", true, false), #("D:FULL SECTION-221201_2of9.xmesh", true, false),
  42. #("D:\FULL SECTION-221201_3of9.xmesh", true, false), #("D:\FULL SECTION-221201_4of9.xmesh", true, false),
  43. #("D:\FULL SECTION-221201_5of9.xmesh", true, false), #("D:\FULL SECTION-221201_6of9.xmesh", true, false),
  44. #("D:\FULL SECTION-221201_7of9.xmesh", true, false), #("D:\FULL SECTION-221201_8of9.xmesh", true, false),
  45. 27662
  46. #("D:\FULL SECTION-221201_9of9.xmesh", true, false))
  47. --            endframe: 9
  48. --            newObjects: #()
  49. --            cnt: 1
  50. --            startframe: 1
  51. --        Externals:
  52. --            ddl_textureLimit: RolloutControl:ddl_textureLimit in rollout:LoadHacksawPartitions_Rollout : ComboBoxControl:ddl_textureLimit
  53. --            spn_start: RolloutControl:spn_start in rollout:LoadHacksawPartitions_Rollout : SpinnerControl:spn_start
  54. --            chk_loadSubset: RolloutControl:chk_loadSubset in rollout:LoadHacksawPartitions_Rollout : CheckBoxControl:chk_loadSubset
  55. --            chk_assignMaterials: RolloutControl:chk_assignMaterials in rollout:LoadHacksawPartitions_Rollout : CheckBoxControl:chk_assignMaterials
  56. --            owner: Rollout:LoadHacksawPartitions_Rollout
  57. --            edt_file: RolloutControl:edt_file in rollout:LoadHacksawPartitions_Rollout : EditTextControl:edt_file
  58. --            getAllPartitions: getAllPartitions()
  59. --            spn_end: RolloutControl:spn_end in rollout:LoadHacksawPartitions_Rollout : SpinnerControl:spn_end
  60. --            updateUI: updateUI()
  61. --            prg_progress: RolloutControl:prg_progress in rollout:LoadHacksawPartitions_Rollout : ProgressBar:prg_progress
  62. --            LoadHacksawPartitions_Rollout: Rollout:LoadHacksawPartitions_Rollout
  63. --    ------------------------------------------------------
  64. --    [stack level: 2]
  65. --    called from top-level
  66.  
  67.  

Code:

  1.         on btn_loadPartitions pressed do
  2.         (
  3.             local newObjects = #()
  4.             with undo "LoadSQHacksaw" on
  5.             (
  6.                 local theFiles = getAllPartitions edt_file.text
  7.                 local startFrame = 1
  8.                 local endFrame = theFiles.count
  9.                 if chk_loadSubset.checked do
  10.                 (
  11.                     startFrame = spn_start.value
  12.                     endFrame = spn_end.value
  13.                 )
  14.                 local cnt = 0
  15.                 for f = startFrame to endFrame do
  16.                 (
  17.                     windows.processPostedMessages()
  18.                     cnt += 1
  19.                     prg_progress.value = 100.0*cnt/(endFrame-startFrame+1)
  20.                     if theFiles[f][2] do
  21.                     (
  22.                         local theCurrentFile = theFiles[f][1]
  23.                         local isExistingNode = getNodeByName ("XMesh_"+ getfilenamefile theCurrentFile)
  24.                         if not isValidNode isExistingNode do
  25.                         (
  26.                             local theLoader = XMeshLoader()
  27.                             theLoader.renderSequence = theCurrentFile
  28.                             theLoader.name = "XMesh_"+getfilenamefile theCurrentFile
  29.                             theLoader.loadSingleFrame = true
  30.                             theLoader.useFileLengthUnit = true
  31.                             theLoader.viewportSequenceID = 0
  32.                             theLoader.showIcon = false
  33.                             append newObjects theLoader
  34.                             if chk_assignMaterials.checked do
  35.                             (
  36.                                 local theTextures = getPossibleTextures theCurrentFile
  37.                                 if theTextures.count > 0 do
  38.                                 (
  39.                                     local theMat = StandardMaterial name:("MAT_"+getFileNameFile theCurrentFile)
  40.                                     theMat.diffusemap = bitmapTexture name:("MAP_"+getFileNameFile theCurrentFile) filename:theTextures[1]
  41.                                     if chk_selfIlluminated.checked do theMat.selfIllumAmount = 100.0
  42.                                     theLoader.material = theMat
  43.                                     showTextureMap theMat chk_showTextures.checked
  44.                                 )
  45.                             )
  46.                             --max views redraw
  47.                             max zoomext sel all
  48.                         )--end if node does not exist
  49.                     )--end if exists
  50.                 )
  51.                 if chk_assignMaterials.checked  do    NitrousGraphicsManager.SetTextureSizeLimit (ddl_textureLimit.selected as integer) true
  52.                 select newObjects
  53.                 max zoomext sel all
  54.                 prg_progress.value = 0
  55.                 updateUI()
  56.             )--end undo
  57.         )
  58.         on LoadHacksawPartitions_Rollout moved pos do
  59.         (
  60.             setIniSetting (getDir #plugcfg+"//SQ_LoadHacksawPartitions.ini") "Dialog" "Position" (pos as string)
  61.         )
  62.     )
  63.     val = execute (getIniSetting (getDir #plugcfg+"//SQ_LoadHacksawPartitions.ini") "Dialog" "Position" )
  64.     if val != OK then
  65.         createDialog LoadHacksawPartitions_Rollout 400 320 val.x val.y
  66.     else
  67.         createDialog LoadHacksawPartitions_Rollout 400 320
  68. )

Thanks for any help. I know I pasted quite a bit, but I am still learning so I wanted to provide the context?

Replies

  • jkcam

    Sorry, I don't think I pasted that code correctly.... formatting doesn't look like other posts.

  • .morph3us
    Offline / Send Message
    .morph3us polycounter lvl 14

    its a bit late, but I didnt want to just go over this.

    do you know how to open the maxscript listener? it should give more explicit error messages than the pop up window.

    it means that somewhere in the sourcecode a method is called on an object that is neither a class nor a function. (most likely its undefined)

    for example it could be "theLoader.renderSequence", where "theLoader" hasnt been propperly assigned beforehand, so maxscript can not call the method. the listener should give you a line you can investigate more indepth.

Sign In or Register to comment.