Rick Brewster

CodeLab v4.3 (for advanced users) Released July 13, 2019

Recommended Posts

Just for sake of history of reporting bugs I am quoting it here. 

14 hours ago, Pratyush said:

Hi @BoltBait @toe_head2001 , I am trying to write a plugin in codelab. When I run the code in Codelab, it works perfectly. but problem is When I try see see preview some error happens.

eOhfKtC.png

 

And I am also not able to build dll. 

23Vm3Qu.png

 

 boltbait's reply.

 

34 minutes ago, BoltBait said:
6 hours ago, toe_head2001 said:

in both cases it's failing to compile, because CodeLab is generating UI code for Amount2 and Amount3, but the fields backing that code are commented out.  We'll correct this for future versions of CodeLab.

 

I coded a fix for this.  It will be in the next release of CodeLab.

 

Basically, it will ignore any commented out lines.  If you use the UIBuilder, when you click OK, those lines will be deleted.

 

Edited by Pratyush

Share this post


Link to post
Share on other sites

1.

Using an interger slider for a color chanel (0 to 255, default = 20), I want to change the style to White-Red. The values are replaced by 0-100, default=0.

 

2.

Retyping the values, I start by the default = 20 and when I type the maximum value 2 (for 255) the default value is replaced by 2.

 

edit:

3.

Impossible to type -255 (minus 255) when the value is 0.

Share this post


Link to post
Share on other sites
47 minutes ago, MadJik said:

1.

Using an interger slider for a color chanel (0 to 255, default = 20), I want to change the style to White-Red. The values are replaced by 0-100, default=0.

 

Yes, changing the style updates the defaults to help new users pick the right values when choosing certain color combinations (like Hue).

 

I recommend always starting entering data by starting at the top and working your way down the screen.  That way you start with the style.

 

47 minutes ago, MadJik said:

2.

Retyping the values, I start by the default = 20 and when I type the maximum value 2 (for 255) the default value is replaced by 2.

 

Yup, that's annoying and I need to fix it.  Basically, there is code in there that keeps the 3 values (min, default, max) in sync so that the combination is always valid.  I need to make it a little less aggressive.

 

47 minutes ago, MadJik said:

3.

Impossible to type -255 (minus 255) when the value is 0.

 

Yeah, I know.  Like I said, I do need to fix that.

 

In order to type a negative number, change the 0 to 2 first. Then put the minus sign in.

 

EDIT: I have fixed #2 and #3 for the next release.  Instead of triggering the normalization on "text change", I'm now doing it on "before leave". So, it normalizes the fields when you exit one of them, not while you're typing.

  • Like 1
  • Upvote 2

Share this post


Link to post
Share on other sites

Question -  is it possible for CodeLab to access and store variable in array?  One thing I would love to improve is the HSV Gradient you have and include blending mode.  What I have in mind is the ability to add and remove color, but I suspect that would go beyond the ability of CodeLab.

Share this post


Link to post
Share on other sites
3 minutes ago, TrevorOutlaw said:

is it possible for CodeLab to access and store variable in array?

 

If I understand you correctly, yes.

int[] myIntArray = new int[5];

//set
myIntArray[3] = 9999;

// get
int myInt = myIntArray[3];

 

Share this post


Link to post
Share on other sites
4 minutes ago, TrevorOutlaw said:

Would that give me the ability to add RGB color one by one?

Sure, if that's how you want to do it.

Color[] myColorArray = new Color[5];

myColorArray[0] = Color.Black;
myColorArray[1] = Color.Red;
myColorArray[2] = Color.Blue;
myColorArray[3] = Color.Green;
myColorArray[4] = Color.White;

I don't really understand what you're wanting to do.

Arrays are fixed in size. Maybe you want to use List instead? I don't know. This really isn't the place to learn C#.

Share this post


Link to post
Share on other sites

Hello.

 

Plugin have terrible code assistance (auto indent etc.). Please, create option for disable this function (or tell me where this function).

When i write 'if( ' he write 'if(if('.

All variables with 'b' names, he renamed on 'bright'.

and many others 'crazy' behaviors

 

(I C++ developer, not C#. Most of the things we write ourselves. Without any helpers.)

Share this post


Link to post
Share on other sites
16 minutes ago, GustavMahler said:

Plugin have terrible code assistance

Now there's an exaggeration.

 

16 minutes ago, GustavMahler said:

When i write 'if( ' he write 'if(if('

You can can easily avoid that, but I'll make it more idiot proof so you won't have to.

 

16 minutes ago, GustavMahler said:

All variables with 'b' names, he renamed on 'bright'.

Please give me the steps to reproduce this behavior.

 

16 minutes ago, GustavMahler said:

and many others 'crazy' behaviors

Oh yeah? Feel free to list them. No one is going to fix them otherwise.

 

Thanks for the feedback.

Share this post


Link to post
Share on other sites
40 minutes ago, GustavMahler said:

All variables with 'b' names, he renamed on 'bright'.

Left-click at the end of your variable when you stop typing it - the hint will disappear.

 

40 minutes ago, GustavMahler said:

When i write 'if( ' he write 'if(if('.

I couldn't reproduce this 'crazy' behaviors.

Share this post


Link to post
Share on other sites

Type the code using space between symbols and texts

 

    int b1 = 0;
    int b2 = 1;
    if(b1 == 1) b2 = b1 + 1;

when I typed it, Ihave got on the last line b2 =b2 +1;

 

add a new line to type b1 = b2 + 3;

 

codelabautocompletion.png

 

the space changes b1 and b2 into

BadImageFormatException = BadImageFormatException + 3;

Share this post


Link to post
Share on other sites
1 hour ago, GustavMahler said:

When i write 'if( ' he write 'if(if('.

 

To me, this only happens when I type "if(" followed by the tab key twice.

 

If you type "if" followed by tab key twice, it works fine.

 

EDIT: typing Madjik's code above...

 

int b1 = 0;
int b1 = 1;
if (b1 == b2)

After pressing ")" on the last line, press the space bar.  The result is:

 

int b1 = 0;
int b2 = 1;
if (b1 == b2)b2 

 

@MadJik, I could not reproduce your issue.  Are you sure b1 and b2 are in scope where you're typing?

 

Reproduced: This happens when you type those lines outside of a function, like the Render() function.  That is, on the same level as the Render function itself.  It is not valid to write code at that level, only define variables.

Share this post


Link to post
Share on other sites
20 minutes ago, BoltBait said:

After pressing ")" on the last line, press the space bar.  The result is:

Yeah, well, we'll just have the ")" character close the AutoComplete box, and call it a day.

 

21 minutes ago, BoltBait said:

Reproduced: This happens when you type those lines outside of a function, like the Render() function.  That is, on the same level as the Render function itself.  It is not valid to write code at that level, only define variables.

Thus those are fields, not local variables. Newly typed Fields are not enumerated into the Intelligent Assistance features, until after a successful Build. So, wait a few seconds, or just click the Build button.

Share this post


Link to post
Share on other sites
1 hour ago, toe_head2001 said:
1 hour ago, BoltBait said:

After pressing ")" on the last line, press the space bar.  The result is:

Yeah, well, we'll just have the ")" character close the AutoComplete box, and call it a day.

 

 

Probably have to also include "(" for when starting a function.

Share this post


Link to post
Share on other sites

Is anyone interested in having an Output Console in CodeLab?

It would work like the one in Visual Studio: print messages, evaluate values, do traces, ect. The alternative is, of course, drawing the values/messages to the Canvas.

 

I got this proof-of-concept working this afternoon:

Output-wip.png

 

Is it worth my time to continue working on this?

  • Like 4

Share this post


Link to post
Share on other sites

That certainly seems like a useful idea to me. Much more practical then writing to the canvas. It would be very helpful for debugging.

Share this post


Link to post
Share on other sites
1 minute ago, xod said:

I think the 'View Source' button has a wrong anchor.
And the text is not visible in Dark Theme.

 

Consider it fixed for the next release.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, toe_head2001 said:
1 hour ago, xod said:

I think the 'View Source' button has a wrong anchor.
And the text is not visible in Dark Theme.

 

Consider it fixed for the next release.

 

My fault. I can't believe I did that. :roll:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.