Where to learn Lua code?

Status
Not open for further replies.

Bruce J

Photographer
Joined
Oct 18, 2007
Messages
484
Location
Cooperstown, NY, USA
Lightroom Experience
Advanced
Lightroom Version
Classic
TTG Selection Gallery has been updated to 2.'. This is a major update and marks the gallery's transition to a Lua architecture. . .

Matthew: Can you suggest any good reference materials for learning about Lua? I've been modifying some of the LR templates and have a bit of trouble with some of the Lua syntax. Thanks much,
 
Hi Bruce,

Unfortunately, I can't. I've been picking it up as I go along, mostly by disecting the LR HTML gallery, comparing it to what I learned developing galleries the old way in XML, from picking apart the views.xslt file that helps LR to translate the Lua into something it understands, and using the LR Web SDK documentation, which is still mostly incomplete. I've also bounced a lot of question off of Andy Rahn at Adobe.

There are, I suspect, a number of tutorials to be found on the Internet, but nothing specifically about the syntax and options Lua presents in regards to Lightroom.

If you have any questions, though, shoot them my way and I'll do what I can to help you out.

Cheers,
Matt
 
Hi Bruce,

If you have any questions, though, shoot them my way and I'll do what I can to help you out.

Matt

Thanks Matt,

I'll poke around on the web a bit to see what I can find. The specific question I had was about specifying location on a page. I was modifying a slideshow template to change the location and size of the caption, but couldn't quite make sense of the location syntax. Finally got the location I wanted by trial and error, but never did understand why. Any enlightenment would be appreciated. Cheers,
 
In which gallery? And which part were you having problems with, the Lua, the HTML or the CSS? In which file, the galleryInfo.lrweb, or another?

We probably ought to move this conversation to a new thread ...
 
You can find everything you want to know about Lua at this website.... The definitive reference manual is also online.



Matthew: Can you suggest any good reference materials for learning about Lua? I've been modifying some of the LR templates and have a bit of trouble with some of the Lua syntax. Thanks much,
 
I had a recommendation from "inside" for "Beginning Lua Programming (Programmer to Programmer)" by Kurt Jung and Aaron Brown. Much of what's available is a little introverted, or at least geared towards games coding, and there's not much for humans.

John
 
You can find everything you want to know about Lua at this website.... The definitive reference manual is also online.

Thanks James. That's exactly what I was looking for. Now, to waste a few hours trying to see if I can find the answer. Geeks have strange ways of entertaining themselves, don't they?
 
theturninggate;62'2 said:
In which gallery? And which part were you having problems with, the Lua, the HTML or the CSS? In which file, the galleryInfo.lrweb, or another?

Matt,

I wasn't working in a gallery; I was working with a slideshow template, so it's all Lua. I've forgotten which template it was, but one of the ones that comes with LR just adds your caption and identity plate to the page with the image. It was sufficient for my purposes, but I didn't like the fact that it added quotes to my captions. So, I opened it up to delete the quotes. No problem there, but then I decided to change the size of the text and the id plate. Still no problem. Then, I made the mistake of trying to move the caption text. That's when I discovered that I couldn't make any sense of the location syntax. Don't have the template here, so can't post the code. I'll look up the web site that James mentioned to see if I can find the answer. If not, I'll come back with the actual code. Thanks again,
 
Update

Update:

I took a look at the offending code last night, and the Lua documentation this morning. Here's a code fragment of what was puzzling me from a LR slideshow template:

Code:
placement = {
  auto_angle = 1,
  xDir = 2,
  xOffset = ',
  xPos = {
    '.5,
    ',
    ',
    '.5,
  },
  yDir = 1,
  yOffset = -'.'193'5'193'5'19,
  yPos = {
    ',
    ',
    ',
    1,
  },
},
scale = '.167336628'8332,
It turns out this isn't a Lua problem at all. As far as I can tell, the entire template code does nothing more than define a data structure for LR to use when generating slideshow pages. The data structure is defined by Adobe. I'd be mightily pleased if someone could point me to the definitions of these variables, particularly the x... and y... variables. Sure would be nice if Adobe would publish their SDK for the rest of the program. Cheers,
 
Nothing is published on this area. x and y variables will be just horizontal and verticals.

John
 
Web SDK ?

Unfortunately, I can't. I've been picking it up as I go along, mostly by disecting the LR HTML gallery, comparing it to what I learned developing galleries the old way in XML, from picking apart the views.xslt file that helps LR to translate the Lua into something it understands, and using the LR Web SDK documentation, which is still mostly incomplete. I've also bounced a lot of question off of Andy Rahn at Adobe.

Can Matt or anyone tell me : is there a specific Web Galleries LR SDK or do you have to use the standard export SDK to make those galleries ?

Thanks for any help, I'm new to LR plugins development (and BTW to this forum) and this remains obscure to me... My question of course concerns the "lua way" for writing web galleries plugins and not the "old xml way" which I basically understand well.

Jean-David
 
Status
Not open for further replies.
Back
Top