We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

find Verge files via MAXScript

Home Forums Programming find Verge files via MAXScript

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44020
    dakant
    Participant

    I am trying to write a MAXScript to check thousands of files for the presence of Verge3D. I lost the files and I need to use a computer without Verge installed to find them so I can open them on a computer with Verge3D installed and continue working.

    The script opens each MAX file and does the following:

    for obj in objects do
    (
    	local theCAcount = custAttributes.count obj
    	format "node % has % attributes.\n" obj.name theCAcount
    		
    	if theCAcount != 0 then
    	(
    		format "found attributes on node %\n" obj
    		for i = theCAcount to 1 by -1 do
    		(
    			if custAttributes.get obj i as string == "V3DMeshData:V3DMeshData" then detected = true
    			if custAttributes.get obj i as string == "V3DCameraData:V3DCameraData" then detected = true
    			if custAttributes.get obj i as string == "V3DLightData:V3DLightData" then detected = true
    			if custAttributes.get obj i as string == "V3DAnimData:V3DAnimData" then detected = true
    		)
    	)
    )

    If any node in the scene has at least 1 of the 4 attributes, the variable “detected” is set true and the filename is logged to a text file. However, I am finding that some files are not being logged because none of the nodes meet the requirement, but the files are still showing signs of Verge3D. The MAXScript Listener will report:

    — MAXScript Scripted Custom Attribute definition loading Exception:
    — Compile error: Undeclared variable: IBL_ENV_MODE_TYPES
    — In line: iblEnvironmentMode type:#string ui:iblEnvironmentModeUI default:IBL_ENV_MODE_TYPES[

    On a computer without Verge3D installed, getting the count of custom attributes on the rootnode returns 0.
    custattributes.count rootnode –> returns 0
    But the same file on a computer with Verge3D installed returns 1, and the attribute is ExportData, the same attribute I am warned about when I open the file in 3ds Max.

    So my questions are, why am I getting this definition loading exception, why is the file looking for the variable “IBL_ENV_MODE_TYPES”, and how does a computer without Verge3D installed know what line of a script file it doesn’t have is looking for an undeclared variable?

    If none of the nodes or materials have custom attributes, but the file still warns about the ExportSettings attribute when loaded, how can I:
    A. detect Verge in a series of thousand of files
    B. “clean” the file of Verge without using the Verge3D CleanUp Utility (because Verge3D is not installed) and without merging the nodes into a new file?

    Thanks for any help.

    #44352
    dakant
    Participant

    Is there a version of the Verge Cleaner script I can run without installing Verge?

    When I open a scene that was previously made using Verge:
    custattributes.count rootnode = 1
    But when I open the same scene on a workstation without Verge installed:
    custattributes.count rootnode = 0
    Why?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.