[Bf-committers] Syntax Highlighting for OSL - Question

Alberto Torres kungfoobar at gmail.com
Wed Dec 19 02:57:28 CET 2012


Maybe this belong more to bf-funboard, but it irks me whenever a
single-click buttons become two point-and-click operations and ocuppying 5x
more space in the header (e.g. the new mask tool in the UV). Both UV and
text editor areas are usually small for me (in opposition to 3D view that I
tend to full screen), so a bigger header becames a nuisance.

Language auto detection should be pretty easy: for python there should have
lines ending with ":" and starting with "import " or "from ". OSL has
statements ending with ; and has ")" followed with "{" with optional space
in-between. Anyway detection by file name extension sounds good to me too.

I think syntax highlighting should be on by default. I don't think I have
been ever annoyed by having syntax highlighting enabled for non-code text.
Detection by extension would probably disable it anyway.

Cheers

DiThi



2012/12/19 patrick boelens <p_boelens at msn.com>

>
> I agree with that rhetoric to some extent, but not when it involves users
> being forced into something like a file naming scheme (they may not know
> about/ that isn't 100% clear without ever having done it). Having many
> options is something I especially like in Blender; I hardly ever feel the
> need to go out of my way or edit the source to get a desired behaviour. I
> know I'm thinking purely from my perspective here, but I can't be the only
> lazy namer out there. ;) If this option wouldn't be in the UI, I would've
> never known I could get OSL syntax highlighting by ending my file's name in
> .osl or .oso. This may need addressing in and by itself, but aside from
> that I still feed this would be nice to have for "unspecified" text files.
> I think we've both made out point now though, so I'll stop cluttering
> everybody's inbox and leave it at that. =P
>
> Cheers,
> Patrick
>
> > From: zanqdo at gmail.com
> > Date: Tue, 18 Dec 2012 18:35:57 -0600
> > To: bf-committers at blender.org
> > Subject: Re: [Bf-committers] Syntax Highlighting for OSL - Question
> >
> > I wish blender UI development stopped being about "can't hurt" and "why
> > not" and had a clear direction towards unification and simplification. If
> > it means making users add an extention from now on for both clarity and
> > functionallity I think that would be a good thing. Thanks for you patch
> > BTW, cool addition
> >
> > Daniel Salazar
> > patazstudio.com
> >
> >
> >
> > On Tue, Dec 18, 2012 at 6:30 PM, patrick boelens <p_boelens at msn.com>
> wrote:
> >
> > >
> > > Honestly I didn't even know about the Script Node Update button (again
> > > because I never use extensions internally), but I see what you mean.
> > > Still though, I imagine there are many different types of users each
> > > with different preferences and workflows, including those who like me
> > > tend to forfeit the extension in the file-name, as well as those who
> > > prefer to not use syntax highlighting. I definitely agree
> auto-detection
> > >  would be nice to have for those who do use it, but I also feel like
> > > having the option available won't hurt anyone. Here's the header as-is
> > > with Syntax Highlighting on and off:
> > > http://www.pasteall.org/pic/show.php?id=42062. Personally I don't find
> > > it intrusive at all, so my vote would be to keep it.
> > >
> > > Also, thanks for the +1 Thomas!
> > >
> > > -Patrick
> > >
> > >
> > > > From: zanqdo at gmail.com
> > > > Date: Tue, 18 Dec 2012 18:13:27 -0600
> > > > To: bf-committers at blender.org
> > > > Subject: Re: [Bf-committers] Syntax Highlighting for OSL - Question
> > > >
> > > > Inside a menu is better, yes. For disabling automatic syntax
> highlighting
> > > > (again I don't know why but what ever). The rest should just work
> > > >
> > > > Daniel Salazar
> > > > patazstudio.com
> > > >
> > > >
> > > >
> > > > On Tue, Dec 18, 2012 at 6:11 PM, Thomas Dinges <blender at dingto.org>
> > > wrote:
> > > >
> > > > > I disagree with that.
> > > > > A new button inside of a menu in the text editor won't harm.
> > > > >
> > > > > Thanks for the patch Patrick, a welcome addition. I have not
> looked at
> > > the
> > > > > code yet, but OSL syntax highlighting in trunk should be added. +1
> > > > >
> > > > > Best regards, Thomas
> > > > >
> > > > > "Daniel Salazar - 3Developer.com" <zanqdo at gmail.com> schrieb:
> > > > >
> > > > > >Don't think so, the practice of using the extension is already in
> > > place
> > > > > >
> > > > > >see py
> > > > > >http://www.pasteall.org/pic/42060
> > > > > >
> > > > > >vs osl
> > > > > >http://www.pasteall.org/pic/show.php?id=42059
> > > > > >
> > > > > >This is a place where you don't have to be smart. It's a
> > > > > >simple syntax highlighting, why would it even be an option? Who
> would
> > > want
> > > > > >to disable syntax highlighting and why? Blender's UI is already
> filled
> > > > > with
> > > > > >options.
> > > > > >
> > > > > >cheers
> > > > > >
> > > > > >Daniel Salazar
> > > > > >patazstudio.com
> > > > > >
> > > > > >
> > > > > >
> > > > > >On Tue, Dec 18, 2012 at 5:31 PM, patrick boelens <
> p_boelens at msn.com>
> > > > > wrote:
> > > > > >
> > > > > >>
> > > > > >> I thought about that, but it seemed weird and cumbersome having
> to
> > > > > always
> > > > > >> end your file names in .py or .osl before (correct)
> highlighting can
> > > > > occur.
> > > > > >> (Maybe it's just me being lazy but I never end in either
> extension
> > > when
> > > > > >> working in Blender.) Maybe we could have a combination of the
> two
> > > (keep
> > > > > the
> > > > > >> option, but be smart about it)?
> > > > > >>
> > > > > >> For example:
> > > > > >> - New file  -  syntax = Python
> > > > > >> - Switch to "my_shader.osl"  -  syntax = OSL
> > > > > >> - New file  -  syntax = OSL (persistent from previous file)
> > > > > >>
> > > > > >> -Patrick
> > > > > >>
> > > > > >> > From: zanqdo at gmail.com
> > > > > >> > Date: Tue, 18 Dec 2012 17:13:30 -0600
> > > > > >> > To: bf-committers at blender.org
> > > > > >> > Subject: Re: [Bf-committers] Syntax Highlighting for OSL -
> > > Question
> > > > > >> >
> > > > > >> > Sounds good, however I'd prefer the syntax selection be
> automatic
> > > > > based
> > > > > >> on
> > > > > >> > the extension, like it is already for other things related to
> py
> > > vs
> > > > > osl.
> > > > > >> > One less menu or button is always good!
> > > > > >> >
> > > > > >> > Daniel Salazar
> > > > > >> > patazstudio.com
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> > On Tue, Dec 18, 2012 at 5:11 PM, patrick boelens <
> > > p_boelens at msn.com>
> > > > > >> wrote:
> > > > > >> >
> > > > > >> > >
> > > > > >> > > Hey everyone,
> > > > > >> > >
> > > > > >> > > I just added a new patch for OSL syntax highlighting in the
> Text
> > > > > Editor
> > > > > >> > > which I thought people might find useful. Personally I would
> > > love a
> > > > > bit
> > > > > >> > > more color variation, which is why I did the request in the
> code
> > > > > >> comments
> > > > > >> > > of giving decorators their own color, and also why I'll
> probably
> > > > > give
> > > > > >> OSL's
> > > > > >> > > data types (int, void, closure) a unique one for myself as
> > > well. I
> > > > > >> figured
> > > > > >> > > I'd ask here to see how others would feel about having the
> same
> > > > > added
> > > > > >> in
> > > > > >> > > trunk rather than just tossing it in there along with the
> rest
> > > of my
> > > > > >> patch.
> > > > > >> > >
> > > > > >> > > Hope somebody finds this useful, cheers!
> > > > > >> > > -Patrick
> > > > > >> > >
> > > > > >> > > The patch:
> > > > > >> > >
> > > http://projects.blender.org/tracker/index.php?func=detail&aid=33609
> > > > > >> > >
> > > > > >> > > _______________________________________________
> > > > > >> > > Bf-committers mailing list
> > > > > >> > > Bf-committers at blender.org
> > > > > >> > > http://lists.blender.org/mailman/listinfo/bf-committers
> > > > > >> > >
> > > > > >> > _______________________________________________
> > > > > >> > Bf-committers mailing list
> > > > > >> > Bf-committers at blender.org
> > > > > >> > http://lists.blender.org/mailman/listinfo/bf-committers
> > > > > >>
> > > > > >> _______________________________________________
> > > > > >> Bf-committers mailing list
> > > > > >> Bf-committers at blender.org
> > > > > >> http://lists.blender.org/mailman/listinfo/bf-committers
> > > > > >>
> > > > > >_______________________________________________
> > > > > >Bf-committers mailing list
> > > > > >Bf-committers at blender.org
> > > > > >http://lists.blender.org/mailman/listinfo/bf-committers
> > > > > _______________________________________________
> > > > > Bf-committers mailing list
> > > > > Bf-committers at blender.org
> > > > > http://lists.blender.org/mailman/listinfo/bf-committers
> > > > >
> > > > _______________________________________________
> > > > Bf-committers mailing list
> > > > Bf-committers at blender.org
> > > > http://lists.blender.org/mailman/listinfo/bf-committers
> > >
> > > _______________________________________________
> > > Bf-committers mailing list
> > > Bf-committers at blender.org
> > > http://lists.blender.org/mailman/listinfo/bf-committers
> > >
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list