Notifications
Clear all

[Closed] link between visual maxscript editor and script

I’m writing a script with elements from the visual maxscript editor – however, I’ve copied that script and edited at home and the link between the editor and my script is broken.

How can I return to that golden era when al I did was press f2 to edit the ui?

4 Replies
1 Reply
(@bobo)
Joined: 1 year ago

Posts: 0

I don’t think there is a “link” that could be broken. I just tried it here in the latest Max version and F2 works as expected unless the function keys toggle on my Microsoft keyboard is off (which is the default).

Have you tried using the Edit>Edit Rollout and Edit>New Rollout options in the editor’s menu instread of F2?

Hey Bobo.

Pressing “new rollout” gives me a blank rollout screen, as does “edit rollout”

What I’m wanting to happen is that when I go to edit the rollout, I get to edit the rollout associated with the script – as it was when I started.

The script is attached… ps, have an object selected when you run it, also, when the dialogue comes up, select any file in a dir – all you’re doign at this stage is selecting the dir to save files to.

Nb: it isolates selection, renders an example and saves selected to the chosen dir.

 
script rollout asset_tool "Asset Tool" width:220 height:220

(

button button_go ">" pos:[164,8] width:49 height:206

edittext edit_object_name "" pos:[7,37] width:141 height:28

label lbl1 "Object Name" pos:[11,12] width:138 height:23

----------------

--GO button code

----------------

on button_go pressed do

(

-- accessing asset file and paths

asset_file = getOpenFileName caption:"Open an HTML/XML file with your project library:"

-- dev note add in file types addition

 

-- accessing asset file and paths

thehtmlfile = filenameFromPath asset_file

thehtmlpath = getFilenamePath asset_file

-- isolate selection

macros.run "Tools" "Isolate_Selection" 

-- Tools: Zoom Extents All Selected

actionMan.executeAction 0 "311" 

-- render the thumbnail

render outputwidth:320 outputheight:240 outputFile:(thehtmlpath + edit_object_name.text +".jpg") vfb: off

-- what shall we call the max file?

maxfile = thehtmlpath + edit_object_name.text + ".max"

-- save the selected nodes

saveNodes $ maxfile 

 

-- writing the xml file package

-- what shall we call the XML file?

thexmlfile = thehtmlpath + edit_object_name.text + ".txt"

--create the new xmlfile

createFile thexmlfile

--open the xmlfile for editing

fxml=fopen thexmlfile "a+"

--writing data into the xml file

WriteString fxml "String"

fclose fxml

 

 

 

 

 

if

edit_object_name != ""

do

(

-- error checking

)-- if edit_text empty

)-- GO BUTTON

 

)

createdialog asset_tool 220 220

 

What is this “script” in the beginning of the rollout definition???!?
Once you remove it, the F2 starts working as expected, because it is looking for the first “rollout” clause and is finding none since the “script” is masking it off…

Where did you find this ‘script’ thing?!
When you evaluate, MAXScript prints

undefined
Rollout:asset_tool
true
OK

The ‘undefined’ is the result of the ‘script’ being evaluated and not having any value.
Then the rollout is evaluated, the dialog is created and done.
MAXScript does not see “script” as a problem, just as an undeclared variable, but the Visual MAXScript does not “see” the ‘rollout’ anymore because it is right behind it.

Once again, you are the master Bobo.

I have no bloody idea how it got in there… must have been the alcohol withdrawal symptoms making me shake and accidentally press ctrl-v at some point