Jump to content

CodeLab v6.0 (for advanced users) Released June 25, 2020


Recommended Posts

I have a question with regards to Codelab.

 

Right now this works

DoubleSliderControl Something = 1; // [0,1] {Variable} Red Weight

 

However, this does not.

DoubleSliderControl Something = 1; // [0,1] {Variable!=5} Red Weight

 

What would be the solution?

G'MIC Filter Developer

Link to post
Share on other sites
5 hours ago, Reptillian said:

However, this does not.


What you have typed is not part of the proper syntax for user controls. 
 

I would recommend using the UI Designer to make what you want. Let it generate the code for you. 

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites
2 hours ago, BoltBait said:


What you have typed is not part of the proper syntax for user controls. 
 

I would recommend using the UI Designer to make what you want. Let it generate the code for you. 

 

I see only binary options there. Checked or is not checked. No way to use conditions like Variable==4.

G'MIC Filter Developer

Link to post
Share on other sites
17 minutes ago, Reptillian said:

I see only binary options there. Checked or is not checked. No way to use conditions like Variable==4.

 

There's no way to do that from CodeLab. You'll have to export the plugin to Visual Studio.

 

Here's some example code for the property rule:

new ReadOnlyBoundToValueRule<int, Int32Property>(PropertyNames.Target, PropertyNames.Source, 5, false)
Link to post
Share on other sites

I think I replicated the bug.

 

Copy and paste this to options under dropdown

Normal|Normal Inverted|Arctangent|Tangent|Tanh Stroke|Asymphological Vibrato|Asymphological Basic|Asymphological Basic 2|Asymphochaos|Petallian|Semi-Thorny Petallian|Thorny Petal 1,Thorny Petal 2|Inflation|Inflation 2|Chaotic Creation|Earthing|Acrylic Earthing|Unearthing Origami|Cubic Unearthing|Webbing Cubic Unearthing|Chaotic Hooks|Echo Wide|Echo Squircle|Echo Hall|Echo Hall 2|Liquid Parabolic|Chaos-Vibrato|Chaos Deep-Vibrato|Chaos Spacetime|Parabolic|Parabolic Chaos|Cubic-Diamond Chaos|C-Line|Contour Chaos|Spiderweb-Diamond|Acrylica|Refractive Space|Smooth-Artistry|Ferrofluid|Triangular Interweaving|Fabric Chaos|Reverse Tangent Division|Chaotic Tangent|Alternating Chaos 1 (Legacy)|Alternating Chaos 2 (Legacy)|Alternating Chaos 3 (Legacy)|Alternating Chaos 4 (Legacy)|Alternating Chaos 1|Alternating Chaos 2|Alternating Chaos 3|Alternating Chaos 4

 

Error: Preview can't be displayed.

 

Note: Works fine outside of UI designer. Also works when you exit UI designer and enter again. Just not when you copy and paste that directly into UI designer after you set to dropdown.

Edited by Reptillian

G'MIC Filter Developer

Link to post
Share on other sites
  • 3 weeks later...
On 10/24/2020 at 9:54 AM, NSD said:

... this means that CodeLab detects the erroneous parameters of the Render method.

 

Actually, no, it does not detect erroneous parameters.

All CodeLab knows is that your file did not have the correct signature for the Render method. It has no idea why.

 

Since the file did not have the correct signature, it was opened as a plain text file.

  • Thanks 1
Link to post
Share on other sites
  • 2 weeks later...
On 12/4/2020 at 7:15 PM, Reptillian said:

There are 3 different drop-down choices that I would like to activate one ui element.

 

This was discussed a while back, and I believe @MJW provided the solution you need:

https://forums.getpaint.net/topic/111979-indirect-ui-–-property-rules/?do=findComment&comment=538475

Link to post
Share on other sites
  • 2 weeks later...

Can string input box have display names? I just tested it, and without it, it's not convenient. For context, I wanted to convert G'MIC-QT Thorn Fractal to GMIC-C#, and having display names would make it you know useful as the G'MIC-QT version has a lot of string input boxes for custom formula.

 

Here, a code to use to demonstrate:

 

#region UICode
ListBoxControl preform = 0; // {cusform} Predefined Formula|Normal|Normal Inverted|Arctangent|Tangent|Tanh Stroke|Asymphological Vibrato|Asymphological Basic|Asymphological Basic 2|Asymphochaos|Petallian|Semi-Thorny Petallian|Thorny Petal 1|Thorny Petal 2|Inflation|Inflation 2|Chaotic Creation|Earthing|Acrylic Earthing|Unearthing Origami|Cubic Unearthing|Webbing Cubic Unearthing|Chaotic Hooks|Echo Wide|Echo Squircle|Echo Hall|Echo Hall 2|Liquid Parabolic|Chaos-Vibrato|Chaos Deep-Vibrato|Chaos Spacetime|Parabolic|Parabolic Chaos|Cubic-Diamond Chaos|C-Line|Contour Chaos|Spiderweb-Diamond|Acrylica|Refractive Space|Smooth-Artistry|Ferrofluid|Triangular Interweaving|Fabric Chaos|Reverse Tangent Division|Chaotic Tangent|Alternating Chaos 1 (Legacy)|Alternating Chaos 2 (Legacy)|Alternating Chaos 3 (Legacy)|Alternating Chaos 4 (Legacy)|Alternating Chaos 1|Alternating Chaos 2|Alternating Chaos 3|Alternating Chaos 4
ListBoxControl cusform = 0; // Custom Formula|None|Custom Formula|Alternating Custom Formula Level 1|Alternating Custom Formula Level 2|Alternative Custom Formula Level 3|Alternating Custom Formula Level 4
IntSliderControl escape = 10000; // [5,3000000] Escape Value
IntSliderControl loop = 255; // [1,1024] Loop Limitation
DoubleSliderControl sub = 3; // [1,10] Subsampling Level
DoubleSliderControl dx = 0; // [-50,50] Distortion X
DoubleSliderControl dy = 0; // [-50,50] Distortion Y
DoubleSliderControl sxy = 1; // [0.1,15] Scaling XY-Axis
DoubleSliderControl sx = 1; // [0.1,15] Scaling X-Axis
DoubleSliderControl sy = 1; // [0.1,15] Scaling Y-Axis
CheckboxControl spi = true; // PI-Based Scaling
DoubleSliderControl offx = 0; // [-5,5] Offset X -Transformation
DoubleSliderControl offy = 0; // [-5,5] Offset Y -Transformation
AngleControl ang = 0; // [-180,180] Function Angle
TextboxControl vx_a = ""; // [10] 
TextboxControl vy_a = ""; // [10] 
TextboxControl vx_b = ""; // [10] 
TextboxControl vy_b = ""; // [10] 
TextboxControl vx_c = ""; // [10] 
TextboxControl vy_c = ""; // [10] 
TextboxControl vx_d = ""; // [10] 
TextboxControl vy_d = ""; // [10] 
TextboxControl vx_e = ""; // [10] 
TextboxControl vy_e = ""; // [10] 
#endregion

 

Adding display name does nothing, and they disappear.

Edited by Reptillian

G'MIC Filter Developer

Link to post
Share on other sites
59 minutes ago, Reptillian said:

Can string input box have display names?

 

Yes, this works fine.

 

I added some display names to your text controls and they worked fine.

 

With that many controls, you do need to scroll to see them all.

 

image.png

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites
  • 2 weeks later...
Just now, toe_head2001 said:

Why would you want to use Tabs in C# ?

 

Well. I always use tabs on every language. It's just better. Spaces are slower to work with, can mess indents accidentally and, in general, make no sense at all. I know there's a bunch of code style conventions in C#, but is spaces vs. tabs really one of them? I've been using C# for years and have never heard of this.

Link to post
Share on other sites

Most people don't use tabs with any C style language.

 

10 minutes ago, HCGS said:

Spaces are slower to work with, can mess indents accidentally and, in general, make no sense at all.

 

That's completely subjective. The same exact things can be said about tabs. I'm not even joking.

 

The standout issue with tabs is variable tab width among different environments.  For you a tab width might appears as 40px, but for other people it might be 80px.

This is very evident in web browsers. For some reason, a tab is about double the normal (if there is such a thing) width in a web browser.

A space is always the same width.

 

The good news is that modern editors will automatically correct indents, whether you're using tabs or spaces, so one's preference doesn't really matter.  Unless, you're sharing code (working on a team), then you'll mostly likely be forced to use spaces, since that's what most people prefer.

 

Anyway, it would be very easy to add an option to CodeLab for tabs.  However, all the templates within CodeLab are hard-coded with spaces. So basically, you would easily end up with a document mixed with tabs and spaces.

Link to post
Share on other sites
36 minutes ago, HCGS said:

Well. I always use tabs on every language. It's just better. Spaces are slower to work with, can mess indents accidentally and, in general, make no sense at all. I know there's a bunch of code style conventions in C#, but is spaces vs. tabs really one of them? I've been using C# for years and have never heard of this.

 

If you're not working on team and doing things for yourself, then chances are you might have your own formatting style, and the most important thing is that you are able to modify it later and to get the code right. I work with mixed tabs/spaces with the goal of being able to be read easily from my POV, and it actually deviates from automatic reformatting.

G'MIC Filter Developer

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.

×
×
  • Create New...