component data type wrong + uninitialized
-
Hey guys!
I'm working on a project and ran into a roadblock. For some reason, new components are are being added incorrectly to my project.
The ScriptWatchTable is listing the data type for sliders and combo boxes as "string" and their values are "uninitialized"
I can create a new project and add a component properly, but this current project is gummed up somewhere. I could easliy remake the whole thing (script is only 60 lines so far) but I'd rather solve the issue.
Anyone seen this before? I can't find anything by searching. -
I tracked it down to a script I'm using for my meter. I'm essentially using this code below.
Commenting out the line "return widget;" makes everything go back to normal.return widget;
/** Creates a VU-Meter from a filmstrip for the master volume. */ inline function createFilmStripVuMeter(name, x, y, isLeft) { local widget = Content.addPanel(name, x, y); Content.setPropertiesFromJSON(name, { "width": 130, // this uses the exact dimensions of one filmstrip "height": 65, "opaque": true // opaque is important in order to increase the drawing performance }); // Put the image in your image folder widget.loadImage("{PROJECT_FOLDER}vu_meter_128_frames.png", "filmstrip"); widget.data.value = 0.0; widget.data.isLeft = isLeft; // Set the initial image widget.setImage("filmstrip", 0, 0); widget.setTimerCallback(function() { // Get the peak value from the master output var newValue = Engine.getMasterPeakLevel(this.data.isLeft ? 0 : 1); if(newValue > this.data.value) this.data.value = newValue; else // Just decay the current value (0.92 controls the decay time) this.data.value = this.data.value * 0.92; // Calculate the filmstrip index // this must be an integer value // 84 is used instead of 128 because 84 is ~0dB which is // more accurate for this example filmstrip var index = parseInt(this.data.value * 84.0); // If you just want to paint one image, // you don't need the paint routine, but // just use this method // the yOffset is index * heightOfFilmstrip this.setImage("filmstrip", 0, index * 65); }); widget.startTimer(30); return widget; }; const var VuMeterLeft = createFilmStripVuMeter("VuMeterLeft", 11, 10, false); const var VuMeterRight = createFilmStripVuMeter("VuMeterRight", 160, 10, true);
-
@dustbro Since I don't have the filmstrip, I commented out the 3 associated lines, and magically the component appears to be correct.
If I uncomment the lines, the issue comes back...