Hello everyone,
I am currently working on a scripted plugin to create (and store) paths, on which the user can place objects.
[ul]
[li]The plugin can store multiple paths (like a 3dsMax Shape having multiple splines)[/li][li]A path consists of segments and points (like a 3dsMax Spline consists of Segments & Knots)[/li](for curved segments)
[li]Each placed object can be referenced by multiple paths[/li](for example a T cross, where an object is placed at the intersection point)
[/ul]
So I guess the proper structure would be:
Pseudo - Code
[B]struct [/B]Main
(
paths = #() -- all path structs
uniqueObjects = #() -- all referenced objects (max nodes)
)
[B]struct [/B]Path
(
uniquePoints = #() -- all path points (point3)
segments = #() -- all segment structs
)
[B]struct [/B]Segment
(
referencedPoints = #() -- reference to unique path points
referencedObjects = #() -- reference to unique objects
)
Question#1: Now my biggest problem is storing all the data. Plugins only save int, point3 etc. arrays, so I assume saving everything to an XML file would be the way to go?
Question#2: How do you save and load “reference types”?
Question#3: Would you advise against using C# for this? I have some experience with mxs <-> C# and I like C#. I would put all classes, loading/saving and some math stuff in C#
Sidenote#1: I am using a scripted object as “root node” (holds all path data + I want it to save a mesh later on)
Sidenote#2: I am using a scripted manipulator to render the paths (while the object is selected), plus some gizmo helpers during the object placement phase
Advice and suggestions are very welcome! I have most of the functionality I need ready (in separate pieces), but I’d like some professional insight before putting it together the wrong way and hating myself for not asking.
Sorry for any “Shape->Spline->Segment->Knot” to “Path->Segment->Point” confusion ^^