Skip to content

Commit 3deab50

Browse files
committed
add readme, docs and maxscript samplecode
setup multi-3dsMax SDK version project
1 parent 04ae7a4 commit 3deab50

12 files changed

+2891
-1
lines changed

PS_Schematic.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@
129129
</StripPrivateSymbols>
130130
</Link>
131131
</ItemDefinitionGroup>
132+
<ItemDefinitionGroup>
133+
<!-- clear RunMUIRCT postbuild event -->
134+
<PostBuildEvent><Command></Command></PostBuildEvent>
135+
</ItemDefinitionGroup>
132136
<ItemGroup>
133137
<ClInclude Include="src/PS_Events.h" />
134138
<ClInclude Include="src/PS_Nodes.h" />

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
# HeliumSchematicControl
1+
Helium for 3ds Max
2+
3+
Helium is a Schematic Framework that allows to create Flow-chart
4+
User Interfaces within 3dsmax, via maxscript. Please see the help file
5+
and example scripts installed by the installer for further instructions
6+
on how to use helium.
7+
8+
Repo and project setup by Josef 'spacefrog' Wienerroither
9+
10+
Building:
11+
The project setup supports building for 3ds Max 2017 up to most recent 3ds Max SDK installed, all from a single solution.
12+
The solution relies on correctly set-up 3ds Max SDK environment variables.
13+
The environment variables should be named accordingly and point to the correct SDK path
14+
eg. for the 3ds Max 2025 SDK it should be named ADSK_3DSMAX_SDK_2025 and point to the SDK rood path
15+
16+
To build all versions, use the Visualstudio internal batch build functionality, or msbuild to build from commandline
17+
18+
Original code copyright, © Kees Rijnen
19+
20+
Special Thanks go to Larry Minton, Rejean Poirier, www.maxplugins.de, Bobo, plus all beta testers.

docs/HeliumHelp.html

Lines changed: 1011 additions & 0 deletions
Large diffs are not rendered by default.

docs/heliumHelpBMP.jpg

37.9 KB
Loading
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
struct heliumExampleStruct
2+
(
3+
4+
function refresh rol control =
5+
(
6+
if heliumOps.targetControl != control then
7+
(
8+
heliumOps.targetRollout = rol
9+
heliumOps.targetControl = control
10+
heliumOps.useMousePos = false
11+
)
12+
),
13+
14+
function rolloutPreOpen ca rol control =
15+
(
16+
-- if you attach helium to a material, you must make sure that here the material editor is open:
17+
-- max mtledit
18+
print "preOpen"
19+
),
20+
21+
function rolloutPostOpen ca rol control = (print "postOpen"),
22+
function rolloutClose ca rol control = (print "Rollout close"),
23+
function resized ca rol control size = (print "reSized"),
24+
function rolledUp ca rol control state = (print "rolledUp"),
25+
26+
27+
function lbuttondown ca rol control =
28+
(
29+
print "lbuttondown"
30+
refresh rol control
31+
),
32+
33+
function lbuttonup ca rol control = (print "lbuttonup"),
34+
function lbuttonDblclk ca rol control = (print "lbuttonDblclk"),
35+
function mbuttonup ca rol control = (print "mbuttonup"),
36+
function mbuttondown ca rol control = (print "mbuttondown"),
37+
function rbuttondown ca rol control = (print "rbuttondown"),
38+
function rbuttonup ca rol control =
39+
(
40+
print "rbuttonup"
41+
refresh rol control
42+
popupmenu HeliumMenu pop:mouse.screenpos
43+
),
44+
45+
function mouseMoved ca rol control = (/*print "mouseMoved"*/),
46+
function mouseScroll ca rol control = (print "mouseScroll"),
47+
48+
function nodeClicked ca rol control index = (print "nodeClicked"),
49+
function nodesDeleted ca rol control = (print "nodesDeleted"),
50+
function connectionChanged ca rol control sourceNode targetNode inSocket outSocket status connectionCount = (print "connectionChanged"),
51+
52+
endOfStruct
53+
)
54+
55+
56+
57+
58+
59+
-- example for adding helium UI to a custom attribute:
60+
61+
heliumPar_string = ( "parameters helium_pBlock rollout:heliumRollout \n")
62+
append heliumPar_string ( " (\n" )
63+
append heliumPar_string ( " heliumStruct type:#string \n" )
64+
append heliumPar_string ( " )\n" )
65+
66+
67+
append heliumPar_string ( "rollout heliumRollout \"Helium\" autolayoutonresize:true \n")
68+
append heliumPar_string ( " (\n" )
69+
append heliumPar_string ( " schematicControl s \"\" height:300 \n" )
70+
71+
append heliumPar_string ( " on heliumRollout open do \n")
72+
append heliumPar_string ( " ( \n")
73+
append heliumPar_string ( " if hStruct == undefined then hStruct = execute(heliumStruct) \n")
74+
append heliumPar_string ( " if (isProperty hStruct \"rolloutPreOpen\") then hStruct.rolloutPreOpen this heliumRollout s \n")
75+
append heliumPar_string ( " if (isProperty hStruct \"rolloutPostOpen\") then hStruct.rolloutPostOpen this heliumRollout s \n")
76+
append heliumPar_string ( " ) \n")
77+
78+
append heliumPar_string ( " on heliumRollout close do ( if (isProperty hStruct \"rolloutClose\") then hStruct.rolloutClose this heliumRollout s ) \n")
79+
append heliumPar_string ( " on heliumRollout resized size do ( if (isProperty hStruct \"resized\") then hStruct.resized this heliumRollout s size ) \n")
80+
append heliumPar_string ( " on heliumRollout rolledUp state do ( if (isProperty hStruct \"rolledUp\") then hStruct.rolledUp this heliumRollout s state ) \n")
81+
82+
83+
append heliumPar_string ( " on s lbuttondown do ( if (isProperty hStruct \"lbuttondown\") then hStruct.lbuttondown this heliumRollout s ) \n")
84+
append heliumPar_string ( " on s lbuttonup do ( if (isProperty hStruct \"lbuttonup\") then hStruct.lbuttonup this heliumRollout s ) \n")
85+
append heliumPar_string ( " on s lbuttonDblclk do ( if (isProperty hStruct \"lbuttonDblclk\") then hStruct.lbuttonDblclk this heliumRollout s ) \n")
86+
append heliumPar_string ( " on s mbuttondown do ( if (isProperty hStruct \"mbuttondown\") then hStruct.mbuttondown this heliumRollout s ) \n")
87+
append heliumPar_string ( " on s mbuttonup do ( if (isProperty hStruct \"mbuttonup\") then hStruct.mbuttonup this heliumRollout s ) \n")
88+
append heliumPar_string ( " on s rbuttondown do ( if (isProperty hStruct \"rbuttondown\") then hStruct.rbuttondown this heliumRollout s ) \n")
89+
append heliumPar_string ( " on s rbuttonup do ( if (isProperty hStruct \"rbuttonup\") then hStruct.rbuttonup this heliumRollout s ) \n")
90+
91+
append heliumPar_string ( " on s mouseMoved do ( if (isProperty hStruct \"mouseMoved\") then hStruct.mouseMoved this heliumRollout s ) \n")
92+
append heliumPar_string ( " on s mouseScroll do ( if (isProperty hStruct \"mouseScroll\") then hStruct.mouseScroll this heliumRollout s ) \n")
93+
94+
append heliumPar_string ( " on s nodeClicked index do ( if (isProperty hStruct \"nodeClicked\") then hStruct.nodeClicked this heliumRollout s index ) \n")
95+
append heliumPar_string ( " on s nodesDeleted do ( if (isProperty hStruct \"nodesDeleted\") then hStruct.nodesDeleted this heliumRollout s ) \n")
96+
append heliumPar_string ( " on s connectionChanged sourceNode targetNode inSocket outSocket status connectionCount do ( if (isProperty hStruct \"connectionChanged\") then hStruct.connectionChanged this heliumRollout s sourceNode targetNode inSocket outSocket status connectionCount ) \n")
97+
98+
append heliumPar_string ( " )\n" )
99+
100+
101+
102+
--create CA string:
103+
heliumCA_string = ""
104+
append heliumCA_string "MCA = attributes heliumCA\n"
105+
append heliumCA_string "(\n"
106+
append heliumCA_string "local unusedDummyVar\n" -- prevent a bug in old max versions
107+
append heliumCA_string "local hStruct \n"
108+
append heliumCA_string heliumPar_string
109+
append heliumCA_string ")\n"
110+
myheliumCA = execute(heliumCA_string)
111+
112+
113+
114+
115+
116+
117+
if selection.count > 0 then
118+
(
119+
120+
custAttributes.add $ myHeliumCA #unique
121+
$.heliumStruct = "heliumExampleStruct()"
122+
123+
)
124+
-- end selection.count
125+
126+
127+

docs/mxs-samples/Helium_Dialog.ms

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
2+
try(detroyDialog helium)catch()
3+
4+
rollout helium "Helium" width:506 height:506
5+
(
6+
SchematicControl s "View" width:500 height:500 offset:[-10,-2]
7+
8+
9+
function refresh =
10+
(
11+
if heliumOps.targetControl != s then
12+
(
13+
heliumOps.targetRollout = helium
14+
heliumOps.targetControl = helium.s
15+
heliumOps.useMousePos = true
16+
)
17+
)
18+
19+
on helium open do
20+
(
21+
22+
)
23+
24+
on helium close do
25+
(
26+
helium = undefined
27+
freeSceneBitmaps()
28+
gc()
29+
)
30+
31+
on s regionSelected do
32+
(
33+
print "Region Selected"
34+
)
35+
36+
on s nodesDeleted do
37+
(
38+
print "Node(s) deleted via UI"
39+
for i=1 to s.getDeletedNodeCount do
40+
(
41+
format "Node Index deleted:% \n" (s.getDeletedNodeIndex = i)
42+
)
43+
)
44+
45+
on s connectionChanged sourceNode targetNode inSocket outSocket status connectionCount do
46+
(
47+
-- status == 1 then we made a connection
48+
-- status == 0 then we broke a connection
49+
if status == 1 then format "Connected: src:% (socket:%) to trg:% (socket:%). Input socket now has: % connecting sockets\n" sourceNode outSocket targetNode inSocket connectionCount
50+
else if status == 0 then format "Disconnected: src:% (socket:%) from trg:% (socket:%). Input socket now has: % connecting sockets\n" sourceNode outSocket targetNode inSocket connectionCount
51+
)
52+
53+
on s connectionSelectionChanged sourceNode targetNode inSocket outSocket do
54+
(
55+
format "Connection Selected: src:% (socket:%) to trg:% (socket:%).\n" sourceNode outSocket targetNode inSocket
56+
heliumOps.lastSelectedConnectionNodeIndex = sourceNode
57+
heliumOps.lastSelectedConnectionOutSocketIndex = outSocket
58+
)
59+
60+
on s nodeClicked index do
61+
(
62+
format "Node hit index:% - selInd:%\n" index s.selectedNodeIndex
63+
)
64+
65+
on s socketValueChanged nodeIndex socketID do
66+
(
67+
--format "Socket value changed: Socket ID: %, node Index: %\n" socketID nodeIndex
68+
forceCompleteRedraw()
69+
)
70+
71+
on s LButtonDblclk do
72+
(
73+
--print "double click"
74+
)
75+
76+
on s lbuttondown do
77+
(
78+
refresh()
79+
--print "left down"
80+
)
81+
82+
on s lbuttonup do
83+
(
84+
heliumOps.connectionActive = false
85+
-- check if any connections are selected:
86+
if heliumOps.lastSelectedConnectionOutSocketIndex != 0 and heliumOps.lastSelectedConnectionOutSocketIndex != 0 then
87+
(
88+
s.activeNode = heliumOps.lastSelectedConnectionNodeIndex
89+
s.activeSocket = heliumOps.lastSelectedConnectionOutSocketIndex
90+
local selectedIndex = s.getSelectedConnectionIndex
91+
if selectedIndex == 0 then format "No Connection selected \n"
92+
)
93+
--print "left up"
94+
)
95+
96+
on s mbuttondown do
97+
(
98+
--print "middle down"
99+
)
100+
101+
on s mbuttonup do
102+
(
103+
--print "middle up"
104+
)
105+
106+
on s mouseMoved do
107+
(
108+
if heliumOps.connectionActive == true then print "Moving during connection"
109+
--print "mouse moved"
110+
)
111+
112+
on s mouseScroll do
113+
(
114+
--print "mouse Scroll"
115+
)
116+
117+
on s rbuttondown do
118+
(
119+
--print "right down"
120+
)
121+
122+
on s rbuttonup do
123+
(
124+
heliumOps.connectionActive = false -- since we are poping-up a right click menu, this will cancel our connection.
125+
reFresh()
126+
-- below is only accurate if you get the right position, which the code below might not always get
127+
-- so use it as an example only for using 'findNodeByPos':
128+
--local heliumPos = (getDialogPos helium)
129+
--format "Node index found at right click mouse position: %\n" ( helium.s.findNodeByPos = (mouse.screenPos - heliumPos - [5,20]) ) -- the last point2 is to compensate for nodeWidth/Height and dialog borders etc. Can be different in your scripts
130+
popupmenu HeliumMenu pos:mouse.screenpos
131+
)
132+
133+
on s keyboardDown keycode do
134+
(
135+
print ("down: " + (keycode as string))
136+
)
137+
138+
on s keyboardUp keycode do
139+
(
140+
print ("up: " + (keycode as string))
141+
)
142+
143+
on helium resized size do
144+
(
145+
s.width = (size.x - 6)
146+
s.height = (size.y - 6)
147+
)
148+
149+
on s connectionStarted sourceNode Socket socketType do
150+
(
151+
heliumOps.connectionActive = true
152+
print (sourceNode as string + " - " + socket as string + " - " + socketType as string)
153+
)
154+
)
155+
156+
157+
158+
createDialog helium style:#(#style_toolwindow, #style_sysmenu, #style_resizing)
159+
registerViewWindow helium

0 commit comments

Comments
 (0)