When MAXScript detects a runtime error in your script, it displays an error message and prints diagnostic information to the Listener output pane.
If the error occurs in a controller script or rollout panel script, the error message is displayed in an Alert Box window and is also printed in the Listener output pane.
3ds Max also features a MAXScript Debugger which provides a more advanced toolset for dealing with errors and monitoring variables.
Listener Call Stack Trace-Back And Editor Error Highlight
The diagnostic information is in the form of a call stack trace-back which can help determine the cause and location of the error in your code.
The call stack trace-back shows
- The nesting of called MAXScript functions at the point of error, deepest ones first to outermost ones last;
- The filename, position and line number the error occurred at;
- The values in all the local variables and function parameters at the levels they are declared or first used.
Note that for
loops produce separate entries in the call stack trace-back and include a variable dump for the loop variable and any locals in the loop body. This is because a for loop body represents a variable scope.
As a further aid in locating the error, MAXScript highlights the line in which the error occurred in an MAXScript Editor window if the running code was compiled from a source file (any code not entered directly in the Listener). If the source file is not currently open in the MAXScript Editor, MAXScript opens the file in a new tab. The line containing the code in which the error occurred is highlighted and scrolled into view.
The error message is either displayed in an Alert Box window or the Listener window. In both cases, the Alert Box or Listener window is brought to the front and the MAXScript Editor window containing the code causing the error is immediately behind.
Compile and runtime error messages reported in the Listener output pane are preceded by the comment symbol «—«, so you can reselect and evaluate code in Listener that might have embedded error messages and not have them cause syntax errors.
In the following figure, an Editor and a Listener window are shown where an error was detected while running the script.
The error occurred in the highlighted line in the Editor window.
Looking at the call stack trace-back, we see the error occurred when the for
loop variable i
is equal to 100.
In the line in error, the position of the object from array b
with index i is being set.
After further investigation, it was found the array b
only had 99 elements defined.
Thus element b\[i\]
contained the value undefined
, which resulted in the error as there is no position property associated with undefined
.
ADVANCED INFORMATION ON THIS SPECIFIC ERROR:
The correct way to avoid this particular error would be to use ‘for i = 1 to b.count do’ to ensure the loop never exceeds the number of objects in b, and also divide by b.count in the line z=360.0*i/b.count
.
Obviously, the above «mistake» was introduced to cause an error for demonstration purposes.
The script itself tries to place all selected objects in a circle with radius the Radius around the point pos0.
Script Controller Errors
In the following figure, an error dialog and script controller dialog are shown.
An error was detected while running the script assigned to a script controller.
This error was caused by the deletion of object Box001, whose position was used directly in the script.
The MAXScript Listener shows the following call stack trace-back for this error:
ADVANCED INFORMATION ON THIS SPECIFIC ERROR:
Since 3ds Max 8, the above way of accessing object properties is considered obsolete and a Bad Practice exactly because it can cause a large number of errors when a referenced object is deleted or cannot be found for other reasons (for example when an object with a Script Controller is brought into a scene via XRef).
The correct approach to avoid this specific kind of error would be to use a Variable assigned the Position track of Box001. Deleting the Box001 would not cause an error in the controller. As an added bonus, the controlled object would update its position when Box001 is moved along Z automatically.
Please see Script Controllers for details.
Автор |
Сообщение |
|
---|---|---|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Что делать если Вы установили скрипт не подходящий под версию вашего софта и при загрузке макс каждый раз выдает ошибку MAXscript MacroScript Complite? Устранить данную проблему довольно просто. Необходимо пройти по указанному пути: C:\Users\Username\AppData\Local\Autodesk\3dsMax\2016 — 64bit\ENU\usermacros и удалить в списке конфликтующий скрипт. В моем случае конфликт происходил с Corona_Tweak
Думаю этот маленький совет поможет кому то избавиться от назойливой ошибки, с которой жить можно, но неприятно.
Wall Worm Development and Docs
Posted Sep 23, 2016
Last Updated Sep 23, 2016
Some articles on troubleshooting unexpected MAXScript errors.
Unknown System Exception
Posted on Jul 10, 2015 | Last Updated Oct 29, 2016
Steps on fixing problems with an Unknown System Exception when importing files.
Read More
unknown system exception, vmf importer, fgd parser
Purging Corrupt Utility Files
Posted by Shawn on Sep 23, 2016 | Last Updated Sep 23, 2016
Instructions on deleting corrupt utility files that can stop Wall Worm from working correctly.
Read More
purge, corrupt, error
- Related Topics
Содержание
- Ошибка Unexpected end of script
- Откуда появляется данная ошибка
- Решение проблемы
- Maxscript macroscript compile error
- Maxscript macroscript compile error
Ошибка Unexpected end of script
Откуда появляется данная ошибка
Иногда, при запуске 3Ds Max, по непонятным причинам может возникать ошибка «MacroScript Compile» с текстом «— Compile Error: Unexpected end-of-script — In Line: — This check . «
Эта ошибка возникает вследствие, того, что некоторые плагины, такие как V-Ray Renderer или Corona Renderer, могут записывать свои скрипты в определенные системные папки 3Ds Max и при попытке такой записи возникает сбой. Поэтому скрипты могут не создаваться или быть частично записаны.
Пример такого скрипта с ошибкой, вы можете видеть на скриншоте ниже:
Решение проблемы
Нажмите кнопку F11 для открытия Maxscript Listener (лог ошибок компиляции), вы увидите ошибку связанную с временным скриптом __temp***.mcr.
Необходимо скопировать данный путь и вставить в файловом менеджере, затем просто найти и удалить забагованный файл.
Внимание!
Ни в коем случае не пытайтесь удалить целую папку ENU, как пишут на многих форумах! Это может привести к потери многих настроек и прервет ваш рабочий процесс! Необходимо удалить только один файл, который вызывает проблему!
Источник
vot kokda max run
«Welcome to MAXScript.
— Error occurred during fileIn in
>> MAXScript Auto-load Script Error — C:Program FilesAutodesk3ds Max 9stdplugsstdscriptsCharacterPluginObject.ms Exception: — Syntax error: at dotNetControl, expected
— In line: function g
>> MAXScript Auto-load Script Error — C:Program FilesAutodesk3ds Max 9stdplugsstdscriptsMergeAnimation.ms Exception: — Syntax error: at dotNetControl, expected
— In line: dotNetControl l
>> MAXScript Auto-load Script Error — C:Program FilesAutodesk3ds Max 9stdplugsstdscriptsNET_ListViewWrapper.ms Exception: — Compile error: Undeclared variable: dotNetClass
— In line: m_dnColor = dotNetClass »
>> MAXScript Auto-load Script Error — C:Program FilesAutodesk3ds Max 9stdplugsstdscriptsNET_TreeViewWrapper.ms Exception: — Compile error: Undeclared variable: dotNetClass
— In line: m_dnColor = dotNetClass » > MAXScript MacroScript Compile — C:Program FilesAutodesk3ds Max 9UIMacroScriptsMacro_Help.mcr Exception: — Syntax error: at dotNetControl, expected
— In line: button b > MAXScript MacroScript Compile — C:Program FilesAutodesk3ds Max 9UIMacroScriptsMacro_NamedSelSets.mcr Exception: — Syntax error: at dotNetControl, expected
— In line: dotNetControl v
>> MAXScript Auto-load Script Error — C:Program FilesAutodesk3ds Max 9stdplugsstdscriptsCharacterPluginObject.ms Exception: — Syntax error: at dotNetControl, expected
— In line: function g
>> MAXScript Auto-load Script Error — C:Program FilesAutodesk3ds Max 9stdplugsstdscriptsMergeAnimation.ms Exception: — Syntax error: at dotNetControl, expected
— In line: dotNetControl l
>> MAXScript Auto-load Script Error — C:Program FilesAutodesk3ds Max 9stdplugsstdscriptsNET_ListViewWrapper.ms Exception: — Compile error: Undeclared variable: dotNetClass
— In line: m_dnColor = dotNetClass »
>> MAXScript Auto-load Script Error — C:Program FilesAutodesk3ds Max 9stdplugsstdscriptsNET_TreeViewWrapper.ms Exception: — Compile error: Undeclared variable: dotNetClass
— In line: m_dnColor = dotNetClass » > MAXScript MacroScript Compile — C:Program FilesAutodesk3ds Max 9UIMacroScriptsMacro_Help.mcr Exception: — Syntax error: at dotNetControl, expected
— In line: button b > MAXScript MacroScript Compile — C:Program FilesAutodesk3ds Max 9UIMacroScriptsMacro_NamedSelSets.mcr Exception: — Syntax error: at dotNetControl, expected
— In line: dotNetControl v <<«
install .NET Framework 2.0
Не правда, я вот на каракалпаках тестил. Получилось 4 миллиона каракалпаков в поликах и 9 штук в объектах
Не правда, я вот на каракалпаках тестил. Получилось 4 миллиона каракалпаков в поликах и 9 штук в объектах
а мы будем писать в каком режиме такие фпс?
имхо директ3д не катит. на квадрах тока хорошо с ним даже без макстрима.
после geforce4200ti сижу на опенгл. директ3д только в очень редких случаях. в основной работе опенгл лучше. может в 9 починили отвратительную работу директ3д со сплайнами.
впервые слышу об таком..
Странно, видимо ты не внимательно читал описание новых фич. Все усовершенствования вьюпортов нового Макса касаются только Direct3D режима Само собой, сложно почувствовать их, сидя на openGL, который особо и не трогали. И таки да. скорость сплайнов была тоже очень сильно оптимизирована, во многом из-за интеграции хейр стайлинга в Макс (до этого гайды сильно тормозили).
Вообще странные выводы встречаются в этой ветке, то ли по не знанию… то ли еще от чего Реально, взять тот же 300.000 полигональный объект в 8ке и просто перейти на уровень вершин и в 9ке. Неужели не видна разница? В 8ке просто, чтобы перейти на этот уровень нужно прождать несколько секунд, не говоря уже о редактировании..
Юзаю директ еще с 7ки, в свое время перешел на него, когда только появился pFlow и он отображал те же патиклы намного быстрее OpenGL’а, ну а о кешировании мешей я и не упоминаю. Имхо, директ катит ))
лично я не могу в директе работать из-за лагов при включённом кэшировании мешей — раздражает неподетски. не сказал бы что директ3д с отключенным кэширование сильно быстрее опенгл (плюс глюки, плюс заторможенные сплайны). а если посмотреть на остальные пакеты? у всех опенгл и скорость на порядок выше максовского опенгл. так что дискрит сосёт. никогда не забуду, когда засунул в макс модельку из збраша которая еле ворочалачь. ради интереса запихнул её в маю кси и синему. и опупел. в мае был самый быстрый вьюпорт, тормозов макса и близко не было. так что вот не знаю. такие мои наблюдения.
и да, я тоже иногда юзаю директ когда нужно с анимацией работать.
P.S. лично у меня проблем с cut описанных выше не было.
изредка с подобной проблемой сталкиваюсь, но грешу на свои кривые руки
Simple — работать в сантиметрах.
Либо попробовать зайти в System Units и настроить точность. Например, для 20 метров на 20 метров имеет смысл впихнуть в дистан фром оригин 50 метров. Не забудь нажать Enter!
Цитата:
Because of the nature of digital floating-point calculations, distances that are extremely large or extremely small can cause round-off error. Symptoms of round-off error include trouble navigating (zooming and panning become too fast or too slow), unwanted viewport clipping, and unexpected flipping of normals.
Другие симптомы — невозможность точно задать координату, поставить точку в то место, которое надо — скачит влево-вправо и т.д.
только что попробовал — очень помогает, даже при 100 метрах.
Раз уж тут такой спор про луший рендер, то вот такую вещь ктонить пробывал?
Vray Advanced 1.50 R3
Появилась такая вот штука для 9-го макса в 2-х вариантах, 32 и 64 битные.
Если кому интересно попробывать эту штуку, то
Если кому интересно попробывать эту штуку, то
tolko chto skachal i ustanovil na max9
vse otlichno rabotaet
merci boku =)
After its enourmous success on the market V-Ray has become
the renderer of choice in big production studios accross the world.
Feature film productions, multi-million dollar game productions,
huge and small architectual visualizations have trusted their
visuals to V-Ray.
V-Ray has become a benchmark for speed used by many hardware
vendors and other renderer developers to test against.
Richest set of features, cost-effective and production-ready.
# Build 1.50.RC3 (18 Oct 2006)
(*) Support for 3dsmax R9 32- and 64-bit versions.
(*) The V-Ray shading SDK is now a part of the V-Ray installation.
(*) Added «Guess vertical shift» button to the VRayPhysicalCamera.
(*) Added «Distortion type» for the VRayPhysicalCamera.
The «Cubic» distortion type is used in programs like SynthEyes or Boujou
and allows exact camera matching with these programs.
(*) Added an option «Invisible» for the VRaySun to avoid speckles on mirror surfaces.
(*) The DOF planes of the VRayPhysicalCamera match more closely the actual DOF effect.
(*) The V-Ray presets file name can now be changed from the default.
(*) Better memory management for large HDR maps in VRayHDRI.
(*) VRayLightMtl has an option to use an opacity map.
(*) The V-Ray converter script now supports the standard 3dsmax Blend, Shellac,
DoubleSided and Architectural materials and converts them to the
respective V-Ray counterparts.
(*) VRayMtl now can show the diffuse texture map in the viewport.
(*) The V-Ray license server is registered in «Automatic» service
mode instead of «Manual».
(*) «Affect shadows» and «Affect alpha» options do not work for VRayMtl’s inside
a Multi/subobject material. This will be fixed as soon as possible.
Источник
Maxscript macroscript compile error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In a MacroScript all functions are declared within the MacroScript(). But when I need for instance a selection changed callback, a function from inside such a MacroScript cannot be used for the callback. But when I declare the callback function outside as global function, it will not be executed, when the MacroScript is assigned to a button. What is the workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Without knowing what you want to use the callback for and what sort o a callback it is, it’s hard to give an advice. You can always have a global struct inside the macroscript and either create a singleton instance when the macroscript gets evaluated first (in the top-level scope, provided that the ‘on execute’ handler is there) or a new instance on each run (in the ‘on execute’ scope). Depending on what you want to achieve, you can either assign the handler in the struct create event or from elsewhere in your code.
Источник