Resultados 1 al 2 de 2

Error de sintaxis en MaxScript: se esperaba un paréntesis de cierre

  1. #1
    Fecha de ingreso
    Feb 2013
    Mensajes
    35

    Syntax error

    Hola a todos.Necesito ayuda urgente con este tema, la verdad es que no tengo ni idea de manejarme con scripts, no trabajo utilizando eso manualmente, pero esta mañana me he encontrado este error al abrir el programa:
    -- Error occurred in anonymous codeblock; filename: C:\Users\Usuario\AppData\Local\Autodesk\3dsMax\201 6 - 64bit\ENU\usermacros\__temp5864.mcr; position: 6134; line: 188
    >> MaxScript MacroScript Compile - C:\Users\Usuario\AppData\Local\Autodesk\3dsMax\201 6 - 64bit\ENU\usermacros\__temp5864.mcr, offset 6134; Exception:
    -- Syntax error: at end, expected)
    -- In line: <<.

    Me sale esto, si os fijáis la última línea está incompleta, alguien puede decirme que tiene configurado en su 3dsmax para completarla yo? :
    MacroScript VrayLightLister
    enabledIn:#(max) --pfb: 2003.12.12 added product switch
    category:VRay
    ButtonText:V-Ray Light Lister
    Icon:#(Lights,7)
    (.

    Struct VrayLightListerStruct (GlobalLightParameters, LightInspectorSetup, LightInspectorFloater, LightInspectorListRollout, ShadowPlugins, \
    ShadowPluginsName, maxLightsList, LSLightsList, SkyLightsList, SunLightsList, enableUIElements, \
    LuminairesList, maxLightsRC, CreateLightRollout, UIControlList, DeleteCallback, disableUIElements, \
    LLUndoStr, count, lbcount, lightIndex, decayStrings, totalLightCount, \
    miLightsList, getLightProp, setLightProp, setShdProp, getShdProp, FnShadowClass, enableRefreshBtn, \
    mrSkyLightsList, mrSunLightsList, mrSkyPortalLightsList, MRSkyPortal_ShadowSamples, MRSkyPortal_Modes, \
    VrayLightsList, VrayIESLightsList, VrayAmbientLightsList, VraySunSkyLightsList, yOffset, LineOffset).

    Global VrayLLister, VrayLListerYOffset
    if VrayLLister == undefined or debug == true do VrayLLister = VrayLightListerStruct().
    -- Strings for Localization.

    VrayLLister, decayStrings = #(None,Inverse,Inv. Square)
    vrayLLister. LLUndoStr = LightLister.

    Local dialogUp = false.
    -- End Strings.
    -- Positioning to help localization.

    VrayLListerYOffset = 0
    vrayLLister, yOffset = VrayLListerYOffset
    vrayLLister. LineOffset = 0.
    -- Useful Functions.

    Fn subtractFromArray myArray mySub =
    (
    tmpArray = #()
    for i in myArray do append tmpArray i
    for i in mySub do.
    (
    itemNo = finditem tmpArray i
    local newArray = #()
    if itemNo.= 0 do
    (
    for in 1 to (itemNo-1) do append newArray tmpArray[j]
    for in (itemNo+1) to tmpArray, count do append newArray tmpArray[j]
    tmpArray = newArray
    &nbsp
    &nbsp
    tmpArray
    ).

    Fn compareFn v1 v2 =
    (
    if (v1.name as name) < (v2.name as name) then -1
    else if (v1.name as name) > (v2.name as name) then 1
    else 0
    ).

    Fn SortNodeArrayByNameAscendingOrder myArray =
    (
    qsort myArray compareFn
    myArray
    ).

    Fn SortNodeArrayByName myArray =
    (
    qsort myArray (Fn myname v1 v2 = (if v1.name < v2.name then 0 else 1))
    myArray
    ).

    Fn copyArray array1 = for i in array1 collect i.

    Fn wrapString inString =
    (
    local string1In =
    local string1Out = \
    local string2In =
    local string2Out =
    local temp_text_string = substituteString inString string1In string1Out
    temp_text_string = substituteString temp_text_string string2In string2Out
    temp_text_string = string2In + temp_text_string + string2In
    temp_text_string -- return value
    ).

    Fn disableUIElements array1 = for i in array1 do execute (maxLightsRollout. + i as string + .enabled = false)
    vrayLLister, disableUIElements = disableUIElements.

    Fn enableRefreshBtn lightobj =
    (
    if (vrayLLister. GetLightProp lightObj #useGlobalShadowSettings) == true do
    (
    VrayLLister. LightInspectorSetup. BtnReload. Checked = true
    &nbsp
    )
    vrayLLister, enableRefreshBtn = enableRefreshBtn.

    Fn getLightProp obj prop =
    (
    if (isProperty obj prop) and not (isProperty obj #delegate) then
    getProperty obj prop
    else
    if isProperty obj #delegate then
    if isProperty obj, delegate prop then
    getProperty obj, delegate prop
    else undefined
    else undefined
    )
    vrayLLister, getLightProp = getLightProp.

    Fn setLightProp obj prop val =
    (
    if (isProperty obj prop) and not (isProperty obj #delegate) then
    setProperty obj prop val
    else
    if isProperty obj #delegate then
    if isProperty obj, delegate prop then
    setProperty obj, delegate prop val
    else undefined
    else undefined
    )
    vrayLLister, setLightProp = setLightProp.

    Fn getShdProp obj prop =
    (
    if (isProperty obj #shadowGenerator) and not (isProperty obj #delegate) then
    if (isProperty obj. ShadowGenerator prop) do getProperty obj. ShadowGenerator prop
    else
    if isProperty obj #delegate then
    if isProperty obj, delegate #ShadowGenerator then
    if (isProperty obj, delegate. ShadowGenerator prop) do getProperty obj, delegate. ShadowGenerator prop
    else undefined
    else undefined
    )
    vrayLLister, getShdProp = getShdProp.

    Fn setShdProp obj prop val =
    (
    if (isProperty obj #shadowGenerator) and not (isProperty obj #delegate) then
    if (isProperty obj. ShadowGenerator prop) do
    (
    setProperty obj. ShadowGenerator prop val
    VrayLLister, enableRefreshBtn obj
    &nbsp
    else
    if isProperty obj #delegate then
    if isProperty obj, delegate #ShadowGenerator then
    if (isProperty obj, delegate. ShadowGenerator prop) do
    (
    setProperty obj, delegate. ShadowGenerator prop val
    VrayLLister, enableRefreshBtn obj
    &nbsp
    else undefined
    else undefined
    )
    vrayLLister, setShdProp = setShdProp.

    Fn FnShadowClass obj = classof (vrayLLister, getLightProp obj #shadowGenerator)
    vrayLLister, FnShadowClass = FnShadowClass.
    -- Hardcoded shadow plugins to the ones available.

    VrayLLister. ShadowPlugins = #(Adv__Ray_Traced, mental_ray_Shadow_Map, Area_Shadows, shadowMap, raytraceShadow, VrayShadow, VrayShadowMap)
    VrayLLister. ShadowPluginsName = #(Adv. Ray Traced, mental_ray_Shadow_Map, Area Shadows, Shadow Map, RayTrace Shadow, VRayShadow, VRayShadowMap).
    /* -- uncomment if you want the Blur Shadows
    vrayLLister. ShadowPlugins = #(Adv__Ray_Traced, mental_ray_Shadow_Map, Area_Shadows, Blur_Adv__Ray_Traced, shadowMap, raytraceShadow, VrayShadow, VrayShadowMap)
    vrayLLister. ShadowPluginsName = #(Adv. Ray Traced, mental_ray_Shadow_Map, Area Shadows, Blur Adv. Ray Traced,Shadow Map, RayTrace Shadow, VRayShadow, VRayShadowMap)
    */
    VrayLLister. MRSkyPortal_ShadowSamples = for i = 1 to 10 collect (2^i) as string
    VrayLLister. MRSkyPortal_Modes = #(Existing, Envir., Cuestom) -- correspond to mode values of 2, 0, 1.
    -- Main Function.

    Local CreateLightRollout.

    Fn createLightRollout myCollection selectionOnly:false =
    (
    VrayLLister. LightInspectorSetup, pbar, visible = true.
    -- Class Definitions maxLights = #(TargetDirectionallight, targetSpot, Directionallight, Omnilight, freSpot)
    SkyLights = #(IES_Sky, texture_Sky, Skylight)
    SunLights = #(IES_.
    Última edición por wistaich; 16-12-2016 a las 10:06

  2. #2
    Fecha de ingreso
    Dec 2025
    Mensajes
    0
    El error está en la línea donde comienza la definición del MacroScript. Debes completar la línea que termina con (. con un paréntesis de cierre. La línea correcta debe ser:

    MacroScript VrayLightLister
    enabledIn:#(max) --pfb: 2003.12.12 added product switch
    category:VRay
    ButtonText:V-Ray Light Lister
    Icon:#(Lights,7)
    ()


    El problema es que la definición del MacroScript comienza con un paréntesis abierto ( que nunca se cierra. En el código que compartes, esa línea termina en (. lo cual es un error de sintaxis. Debes cambiarlo por () para que sea una llamada a la estructura o función que sigue, o bien, dependiendo del código original, podría necesitar cerrarse más adelante. Sin embargo, por el contexto del error y la estructura típica, la línea debe terminar con paréntesis de apertura y cierre simples () seguido de un punto.

    Revisando el código, parece que la intención es instanciar la estructura justo después de la definición del MacroScript. La corrección completa para esa sección sería:

    MacroScript VrayLightLister
    enabledIn:#(max)
    category:VRay
    ButtonText:V-Ray Light Lister
    Icon:#(Lights,7)
    (
    -- Todo el código del macroscript debe ir aquí dentro, entre estos paréntesis.
    Struct VrayLightListerStruct ( ... ) -- La definición de la estructura.
    Global VrayLLister, VrayLListerYOffset
    if VrayLLister == undefined or debug == true do VrayLLister = VrayLightListerStruct()
    -- ... resto del código ...
    )

    El error original ocurre porque el paréntesis de apertura del cuerpo del MacroScript no tiene su correspondiente cierre en el lugar correcto, y además la línea está truncada. Debes asegurarte de que todo el código del MacroScript esté contenido dentro de un bloque (...).

    Para solucionarlo, abre el archivo __temp5864.mcr localizado en la ruta que indica el error, busca la línea 188 o alrededor de la posición 6134, y corrige la definición del MacroScript para que tenga un cuerpo correctamente delimitado por paréntesis. Si el archivo es temporal (__temp), considera que puede haber sido generado por un error en una instalación de un script o macro. La solución permanente sería reinstalar o corregir el script original que genera este macro, o eliminar el archivo temporal para que 3ds Max lo regenere correctamente.

    Dado que usas 3ds Max 2016, un software antiguo, te recomendaría actualizar a una versión más reciente de 3ds Max (como 2025) donde el sistema de scripts y manejo de errores es más robusto. Sin embargo, para resolver el problema inmediato, la corrección del paréntesis es la clave.

Temas similares

  1. 3ds Max Reactor: mensaje de error has Mass but no volume, unexpected error may occur
    Por kinoxcrack en el foro Programas de Diseño 3D y CAD
    Respuestas: 1
    : 07-04-2023, 10:02
  2. 3ds Max Error de maxscript Type error: Call needs function or class, got: undefined
    Por dimemayz en el foro Programas de Diseño 3D y CAD
    Respuestas: 2
    : 18-11-2019, 18:40
  3. Maxscript macro script compile syntax error
    Por jolura en el foro Programas de Diseño 3D y CAD
    Respuestas: 1
    : 24-12-2016, 01:36
  4. Autodesk Maya Error al abrir Maya fatal error attempting to save in
    Por clones76 en el foro Programas de Diseño 3D y CAD
    Respuestas: 2
    : 20-03-2014, 15:22
  5. Fume FX error error: atmospheric fusionworks renderer is not supported
    Por heunithen en el foro Partículas y Dinámicas
    Respuestas: 1
    : 06-08-2010, 03:03