I'd like to extend the OctaneLight to make it an "OctaneLight video projector" (I'll call it OCProjector).
First of all, I'm a real beginner at Maxscript coding... but I am a quick learner

So, here is what I want to achieve:
- Extend the OctaneLight class with a new class called OCProjector
- Add some parameters to this new class like the projector size (WxHxD), so I can draw a box behind the OctaneLight plane.
- Create & Assign a Distribution map (RGB image) to the OctaneLight
- Create & Assign an Octane “Perspective Map” to the Projection slot of the “RGB image” distribution map.
- Create & Assign à “3D transformation” to the “Plane Transformation” of the previous “Perspective map”.
- Add rollout controls to the OCProjector to control Rotation, Scale, and Translation of the previous “3d transform”, directly from the OCProjector rollouts.
I already found the way to achieve some of those functions, by defining a new class object plugin from Maxscript :
Code: Select all
plugin Light OCProjector
name:"OCProjector"
classID:#(0x47db14ff, 0x4e9b5f91)
category:"Octane"
extends:OctaneLight
replaceUI:false
Code: Select all
parameters pblock rollout:params
(
projboxwidth type:#float animatable:false ui:projector_Width default:40.0
projboxheight type:#float animatable:false ui:projector_Height default:20.0
projboxdepth type:#float animatable:false ui:projector_Depth default:20.0
)
rollout params "Projector Parameters"
(
Spinner projector_Width "Width :" range:[0, 1e9, 40]
Spinner projector_Height "Height :" range:[0, 1e9, 20]
Spinner projector_Depth "Depth :" range:[0, 1e9, 20]
)
Code: Select all
on getDisplayMesh do
(
if (meshObj == undefined) do
(
meshObj = createInstance box [...]
)
meshObj.mesh
)
Current limitations prevent certain plug-ins from being extended, in particular those with custom creation managers. These include target light plug-ins. You can tell if a plug-in is not extendable if your new rollouts do not appear.
In my case, the rollouts appear ! (good news)

By the way, on the same document, there’s a sentence about the Create tool :
“If a create tool is specified, it will override the delegate's create tool.”
Actually, if a set no “Tool Create” delegate’s function, my plugin simply crashes 3ds Max when I try to draw (create) the OCProjector light on the viewports.
I've also being trying to set a "Tool Create" delegate's function with the same crash issue...
So here I am stucked at this “tool create” point.
Does anyone of you have an idea?
Regards.
C MATIAS