@@ -471,6 +471,9 @@ extern "C"
471
471
info->customOPInfo .authorName ->setString (" David Braun" );
472
472
info->customOPInfo .authorEmail ->setString (" github.com/DBraun" );
473
473
474
+ info->customOPInfo .majorVersion = 0 ;
475
+ info->customOPInfo .minorVersion = 3 ;
476
+
474
477
info->customOPInfo .minInputs = 0 ;
475
478
info->customOPInfo .maxInputs = 1 ;
476
479
@@ -556,6 +559,7 @@ ChucKDesignerCHOP::getChannelName(int32_t index, OP_String *name, const OP_Input
556
559
557
560
void
558
561
ChucKDesignerCHOP::reset () {
562
+ myError.str (" " );
559
563
ChucK_For_TouchDesigner::clearGlobals (m_chuckID);
560
564
ChucK_For_TouchDesigner::clearChuckInstance (m_chuckID);
561
565
ChucK_For_TouchDesigner::cleanupChuckInstance (m_chuckID, myNodeInfo->opId );
@@ -578,11 +582,7 @@ ChucKDesignerCHOP::execute(CHOP_Output* output,
578
582
if (needCompile) {
579
583
needCompile = false ;
580
584
581
- // Until ChucK on windows parses the working directory better,
582
- // we have to pass it as a relative path rather than an absolute path.
583
- // https://github.com/ccrma/chuck/blob/de0530b4d0d85c9fe4abca17019730fe8e8e0454/src/core/chuck.cpp#L524
584
- string globalDir = inputs->getParString (" Workingdirectory" );
585
- // string globalDir = inputs->getParFilePath("Workingdirectory");
585
+ string globalDir = inputs->getParFilePath (" Workingdirectory" );
586
586
587
587
double sample_rate = inputs->getParDouble (" Samplerate" );
588
588
@@ -602,16 +602,18 @@ ChucKDesignerCHOP::execute(CHOP_Output* output,
602
602
603
603
ChucK_For_TouchDesigner::initChuckInstance (m_chuckID, sample_rate, m_inChannels, m_outChannels, globalDir);
604
604
605
- const OP_DATInput* input = inputs->getParDAT (" Code" );
606
- const char * code = *(input->cellData );
605
+ const OP_DATInput* codeInput = inputs->getParDAT (" Code" );
607
606
608
- bool result = ChucK_For_TouchDesigner::runChuckCode (m_chuckID, code);
609
- if (result) {
610
- // clear any existing error
611
- myError.str (" " );
612
- }
613
- else {
614
- myError.str (" ChucK code did not compile correctly." );
607
+ myError.str (" " );
608
+
609
+ if (codeInput) {
610
+ const char * code = *(codeInput->cellData );
611
+ bool result = ChucK_For_TouchDesigner::runChuckCode (m_chuckID, code);
612
+ if (!result) {
613
+ myError.str (" ChucK code did not compile correctly." );
614
+ }
615
+ } else {
616
+ myError.str (" You must specify ChucK Code." );
615
617
}
616
618
}
617
619
0 commit comments