How does one learn to be a Carrara programmer?

May seem an odd question, but I've just been so blown away by what some of the plugin creators have been able to create for Carrara, and I wondered what the process is, or how one would start down the road of learning programming so that eventually somewhere down the line if there's something I wanted to add or fix in Carrara I could maybe do it myself (that's the pipe dream, anyway). I know nothing about programming at all, but I figure it's got to be a learned skill like anything else, right? Probably there's years of schooling and studying that goes into it, but where does one start, and what skills specifically would someone need to learn to become proficient/skilled at coding specifically for Carrara?

Comments

First, I have written 0 lines of code for Carrara, so take this with a grain of salt. The Carrara SDK is a set of libraries that allow your program to interface to Carrara. The programs are written in C++ (I believe it may be c+ or c#). So first, you need to learn to program in C++. The SDK will then allow interfacing between your code and Carrara.

Go ahead and download the SDK. There are some pdf files along with libraries and sample code that should get you started.

Jon, I tried to PM you but it seems to be broken(?). Since there is no SDK forum anymore I wanted to invite you to host an SDK/author Group at Cafe.http://carraracafe.com/groups/

Cafe Groups have an Activity wall (like a BBS crossed with Facebook) and their own dedicated forum.... I was thinking, if you just sort of shared your progress, and if some of the existing developers were invited to participate..., Fenric has always been very free with information. I'm pretty sure he would be willing to participate.... For me it is much easier to learn if I have people to discuss it with and someplace to post progress.

Hey Holly, thanks I actually did just receive the PM (I also had thought the PM system was broken, but a forum mod advised that you actually have to select the checkbox to view sent messages before you'll see your messages appear in your sent messages folder.... weird).

I will definitely make use of any resource for sure, and thank you for the link, didn't realize that was on the Cafe. However I don't have any programming skills or experience or background, so I'm starting from zero, so I certainly don't have much to offer yet :) I don't really even know how to conceive of how herculean a task this might be. Sounds like from ncamp mentioned (thanks ncamp!) my first step is to learn C++ which I think I can probably go to a local bookstore to pick up a book on C++ to get started, and then I'm guessing once I start to learn/master the language C++ I'll know better what I'm looking at in the Carrara SDK (Software Developer Kit, I just googled to try to figure out what that stood for as I've never known before :) )

I used to do some programming many moons ago, and you are right that it is a learned skill like any other. A logical and analytic mind will help! The only advice that I can really offer is to take it methodically and start simple, rather than aiming too high, too soon. I wish you luck with this endeavour, I am sure you will get a lot out of it.

You'll have to start by learning C++. Start off small, and learn the basics first: there are lots of good tutorials around on the web, and Visual Studio Express is a free download from Microsoft. Get a basic familiarity with the syntax and structure of the code, and the basic workflow for using it.

As others have mentioned, you download the SDK from DAZ. There are examples and documentation for the basic operations which are reasonably good - most things are covered somewhere (though not always obviously). All that is enough to get you started with basic modifiers, commands, tweeners, and shaders - modify the SDK samples, and learn how Carrara does things.

Now, a lot of what I do for my plugins these days involves running the resource de-compiler on the base Carrara components and extracting string values from the DAZ .mcx files in order to find the things they DON'T have in the documentation. I'll save out Carrara files un-compressed and look through them for keys and values, and I do a lot of experimentation. But I've got a bit of a head start on you: I got my first computer in third grade (TRS-80 ColorComputer 2) ((33 years ago... ack!)), and I've been writing programs ever since. And it's been my full time job for 18 years now. :D

Here is a simple example of a C# code which is in the C family they are both Object Orientated Programming. They just have a few structural and functional differences.

meaning they use Methods, Functions and Objects. Which you actually get an example of in Carrara when it shows instance and object. It works like code in OOP.

This example is to simply compare a few numbers and list them from smallest to largest. So you really need to like to stare at a computer screen with code on it for hours and hours. and be ready to pull your hair out.

If you are (I actually love to program) then as stated their are a lot of good video tutorials and code samples.

public class MathFunction
{
//main method begins execution of C# application
public static void Main(string[] args)
{
int number1; //Declares the first integer
int number2; // Declares the second integer
int number3; // Declares the third integer
int sum; // sum of the three numbers
int average; // average ot the three numbers
int product; // this will be the product of the 3 numbers
int largest; // this is the largest number
int middle; // this is the middle integer
int smallest; // this will be the smallest

//prompt the user and reads the first integer
Console.Write("Lets compare some Integers \nEnter First Integer: ");
number1 = Convert.ToInt32(Console.ReadLine());

//prompt the user and reads the second integer
Console.Write("Enter Second Integer: ");
number2 = Convert.ToInt32(Console.ReadLine());

//prompt the user and reads the third integer
Console.Write("Enter Third Integer: ");
number3 = Convert.ToInt32(Console.ReadLine());

// gets the total sum of the three numbers
sum = number1 + number2 + number3;

Console.WriteLine("These are our three numbers: {0}, {1}, {2}.",number1 ,number2 ,number3 );
Console.WriteLine("This is the sum of those numbers: {0}.", sum);
Console.WriteLine("This is the product of those numbers: {0}.", product );
Console.WriteLine("This is the average of those numbers: {0}.", average );
Console.WriteLine("This is the largest: {0}\nthis is the middle {1} \nthis is the smallest {2} ", largest,middle, smallest);

Console.Write("Press enter to end.");

Console.ReadLine();// added to hold program open to see display
}// ends main
}// end class compairson

paulg625, thanks for the example of very simple coding, I can see this might take some getting used to, but I'm actually encouraged as when I started to fixate what I was seeing there it did seem to make some logical sense.

You'll have to start by learning C++. Start off small, and learn the basics first: there are lots of good tutorials around on the web, and Visual Studio Express is a free download from Microsoft. Get a basic familiarity with the syntax and structure of the code, and the basic workflow for using it.

As others have mentioned, you download the SDK from DAZ. There are examples and documentation for the basic operations which are reasonably good - most things are covered somewhere (though not always obviously). All that is enough to get you started with basic modifiers, commands, tweeners, and shaders - modify the SDK samples, and learn how Carrara does things.

Now, a lot of what I do for my plugins these days involves running the resource de-compiler on the base Carrara components and extracting string values from the DAZ .mcx files in order to find the things they DON'T have in the documentation. I'll save out Carrara files un-compressed and look through them for keys and values, and I do a lot of experimentation. But I've got a bit of a head start on you: I got my first computer in third grade (TRS-80 ColorComputer 2) ((33 years ago... ack!)), and I've been writing programs ever since. And it's been my full time job for 18 years now. :D

Lol, I wasn't expecting that next week I would be all caught up to your skill level... it would definitely take me at least 2 weeks to catch up :)

Thanks for the tips, sounds like my first step is learning C++, so I'm going to focus on that first and see how it goes. Just to clarify my understanding, I thought there were portions of Carrara that are 'locked off' and that even developers can't see/access, or am I wrong about that? And if there are 'forbidden areas' in the Carrara coding, I wonder what kinds of things are forbidden.

Also aside from C++, are there any other coding languages that come into play in Carrara that would be helpful to learn? I'm guessing if someone wanted to create a plugin that allowed Carrara to render with a different render engine, and the other render engine was in a different language, then mastery of both languages would be necessary? Yeah, you can probably tell from my questions that I don't have a clue what I'm even talking about :)

Seems like a place to start though, so for right now I'll put in some time to learning C++ (I'm assuming that a complete coding novice can learn C++, and there's no other coding thing/language/etc that I need to learn first?)

C++ is a fine place to start although there are a few newer languages C# for example they are both OOP's so they will work similarly. Stick with learning one to start then when you get a good feel for it you will find many modern languages are readable and understandable. So if you wanted to say write code for a web page yo could look at Java or PHP for example.

Just work on fundamentals first what a class is what an instance is what a method is. This will carry you far in the OOP world of programming.

and this is great form of programming because it can link code together that you write even if you wrote it at different times. it's a great type of code. Everything is modular.

Not to discourage you, but to encourage you.
I started off with 2 years of Java programing in College, then moved to web design, html, to javascript, to php, to actionscript, to flex, now working with Away3D for actionscript. Fun stuff the last two. Much more visual.

Learning one language helps you learn others faster.

However, I think if I had the time I would like to learn Python. Suppose to be easy to learn, and would love to use it with the Pycloid plug in. to make some great animations.
I took a free Artificial Intelligence course through MIT that they offer, and they recommend learning Python to test out their examples, because of its short learning curve.

Or I'd like to learn to program the Arduino micro processor, and hook my smart phone to everything in my house! Heck, even 10 year olds are learning to program these chips.

But personally, if I were to recommend a quick way to learn programing I would suggest ActionScript3. Fun visuals while you learn.

Not to discourage you, but to encourage you.
I started off with 2 years of Java programing in College, then moved to web design, html, to javascript, to php, to actionscript, to flex, now working with Away3D for actionscript. Fun stuff the last two. Much more visual.

Learning one language helps you learn others faster.

However, I think if I had the time I would like to learn Python. Suppose to be easy to learn, and would love to use it with the Pycloid plug in. to make some great animations.
I took a free Artificial Intelligence course through MIT that they offer, and they recommend learning Python to test out their examples, because of its short learning curve.

Or I'd like to learn to program the Arduino micro processor, and hook my smart phone to everything in my house! Heck, even 10 year olds are learning to program these chips.

But personally, if I were to recommend a quick way to learn programing I would suggest ActionScript3. Fun visuals while you learn.

I think any of the languages you suggested are fine languages to learn . But... He wants to learn to create plug ins for Carrara. So he will need to write in C++ I expect. Based on its age and function, based on what I have read this is the language it should be in. If he learns other languages first yes it would make it easier to learn but he would still have to learn the differences by learning C++ as his first he kills the proverbial two birds with one stone. That is one of the great advantages of C# through the software that Microsoft uses if Carrara was written in C# you could write the code in many different languages of your cchoosing and the middleware would take care of making it work together.
This is what makes it one of the more modern languages.

As to the Arduino processors. You are correct they are as easy as anything they are still OOP based programming and there are many different manufactures of PIC type programmable processors. The code is simple written in a loop class that is part of the overall code. I work with PLC systems and write code in Ladder Logic, scripting languages and Pascal type code in my job. I am starting to look toward using PIC (Embedded systems) I am looking at Microchip simple because they have several options I can use. I am looking more toward the embedded systems now because I can create not just the software but design the boards as well than have a PCB service create professional boards.
They also offer free software that allow you to setup an HMI type of interface on an Android device to control the device. As you stated being able to control everything in your house from your smart phone.

Hey guys, maybe you can give me some guidance here. In my career I've written and debugged some code in IBM mainframe assembler, cobol, PL1, and other mainframe languages, but that was decades ago and I'm not a "serious coder" by any means.

More recently I did some C++ coding back in the early 00's when studying for my MS degree, but that was all "CMD Window" type coding with no visual elements. Those mainframe programming languages above are "procedural" in nature, not object oriented. So for me, my masters degree C++ projects were very difficult not because of the language syntax, but because of the different way one's brain has to think.

I would like to do some more C++ development for windows with all the normal Windows visual elements such as resizable windows, menu dropdowns, etcetera. Eventually, it might be nice to write plugin code for Carrara but that's not really my first priority.

Can any of you suggest any resources for training myself to think in terms of OOP? I think for me, that's probably where I need to begin...in "brain school." :lol:

Hey guys, maybe you can give me some guidance here. In my career I've written and debugged some code in IBM mainframe assembler, cobol, PL1, and other mainframe languages, but that was decades ago and I'm not a "serious coder" by any means.

More recently I did some C++ coding back in the early 00's when studying for my MS degree, but that was all "CMD Window" type coding with no visual elements. Those mainframe programming languages above are "procedural" in nature, not object oriented. So for me, my masters degree C++ projects were very difficult not because of the language syntax, but because of the different way one's brain has to think.

I would like to do some more C++ development for windows with all the normal Windows visual elements such as resizable windows, menu dropdowns, etcetera. Eventually, it might be nice to write plugin code for Carrara but that's not really my first priority.

Can any of you suggest any resources for training myself to think in terms of OOP? I think for me, that's probably where I need to begin...in "brain school." :lol:

.

First OOP is not meaning it is visually driven. It has more to do with the fact that it doesn't have ( like old code programs) Line number references or specific calls to subroutines. it is written as modules that it all it is referencing to. although you can use visual aspect type with an IDE program that will allow you to place items easier using a pre-created window or button.

The Object is referring to the fact that a person writes a code class for an air plane this is his object it is a blue print for all the instances of the object. When you write a program you can call on that code and use as part of your code or you could write an add on for that code and add something to it without damaging the code he wrote. Which is where the SDk’s come in. this is the decompiled code that you can actually look at the code and make modules that will work with the existing code.

one last thing is the command window programming is what you still do even if you are working visually. Example you put a button on the screen in the IDE. Yes the button is visual but you switch to a command type screen to make your function work. The code that is needed to create the button is already created for you but you must add the command lines to make the button do what you want it to. So you never get away from writing code in a command window environment

And yes programming isn't for everyone, this isn't even an intelligence thing. I know intelligent people who could write great code if they wanted to program but they never will because they hate the thought of sitting that long working on that type of problem.

A good place to start is U-tube there are a few good courses on there that have step by step how to write basic C++ or C# code. Download the Visual studio free version ( it just doesn’t have as many added modules for code as the pro version) just get the one you want to learn C++ or C#.

I have quite a bit of experience working in OOD/OOP (mostly Borland Delphi and Ada, but some in C++), and once even thought of developing a plug-in idea that I have had since starting with Carrara. I downloaded the SDK, then noted the guide (at the time) was sparse and old, and decided I was not up to the challenge yet. I wish I had 3-4 months to spend digging into the system to figure out how it works, but I don't have the time. The point is (as Fenric alluded to) that even after getting over learning C++, you still have the Carrara SDK learning curve. I suspect it is more formidable then the language curve.

Also, Jon, I don't think it was mentioned, but you'll need a compiler to convert your C++ code into machine language that will work with Carrara. I am not sure which compilers are compatible with Carrara. I assume MS Visual C++ is what Carrara is written in. But which other compilers will generate code to work as a plug-in? Maybe someone with experience writing Carrara plug-ins (like Fenric) can answer that.

I don't mean to dampen your motivation or spirit, just clarify the hurdles ahead. To be totally honest, I wish you a lot of luck!

Hey, I never thought of HTML and Java being coding languages, I learned a lot of HTML and a little java already (self taught in building webpages, pop up tables forms, etc for an online business I used to be involved in a few years back). That was pretty easy and logical once I got the hang of it, so if that counts at all, it gives me a smidgen more confidence going in.

Not looking to make a career or anything, just a little more ambitious about maybe 'peeking under the hood' of Carrara and seeing if I can contribute (possibly not), so I'm approaching this again from the perspective that all of this is just a hobby, and have started finding books (some paid for on amazon, other free ones, thanks for the tip on 'Thinking in C++', getting started there as it's a cost free way to start :) ) and will start making my way forward (if I can).

I was always afraid of ever going in the modeling room in Carrara up til just a couple of weeks ago, when the polygon thread got started, and thought I would finally venture in, and while I'm no master modeler yet, it is easier and less complicated to pick up than I envisioned it would be, and I'm actually really enjoying it. It might be (probably is in fact) that this has given me way too much overconfidence to tackle other unrelated things I have always wondered about, so I hope no one is envisioning or expecting that in a month or too Jonstark will have a new unbiased render engine for Carrara ready to go that will render the most complicated scenes in just a few seconds with perfect clarity, or anything like that, because honestly nothing may come of this at all and if it does it's more likely that I'll come up with an extra checkbox in the render settings to turn off SSS, or something small (but hopefully useful) like that. For now I'm just going to start diving into C++ in my free time and see if it starts to make sense to me. Once (if) I gain a functional knowledge of the language, then I can take a peek at the SDK for Carrara and see what I can make of it (at least I should have an understanding/idea of how high a mountain would have to be climbed, lol). I guess I'm becoming a bit obsessed with Carrara, and what I've read so far of C++ I find kind of fascinating, so... we'll see, but so far I'm not dismayed.

If he learns other languages first yes it would make it easier to learn but he would still have to learn the differences by learning C++ as his first he kills the proverbial two birds with one stone.

True true, some people are more adept, and faster learners than I. If I can not see more immediate results I lose sight.

in C# you could write the code in many different languages of your choosing and the middleware would take care of making it work together.
This is what makes it one of the more modern languages.

Hey, things have come a long ways since college. I'm going to have to take a look into this. Thanks Paul.

No problem, glad I can contribute a few skills and information to help. Because when it comes to programming I have spent a life time programming various languages and styles.

Because when it comes to Daz 3d and Carrara I'm the Noob asking questions. That why when the original question came up I didn't worry to much about the fact of saying you know you have to spend hours looking at a computer screen. Because you have to do that with Carrara to.

After spending 15 minutes typing a flipping post to this thread, I completely lost the entire text. Thanks, DAZ, for the buggy forum site!

Bottom line of what I lost:

Jon, I suggest you start by downloading and installing Python and PyCarrara (both free) and learning that plug-in first. I think you'll find that it is amazingly versatile and Python gives you a lot of capability. It might be worth the 2-3 weeks of time it takes to get the essence of this powerful plug-in.

Getting the community a groups option was the whole reason I got involved at Cafe. info here tends to get lost pretty quickly. With a dedicated group hopefully useful discussions (and links like here) can find a homebase.

Holly --indeed the forum threads way of keeping up with things is really easy to lose track of stuff. Groups are better for sure. I signed up for one just to get some support over at Carraracafe . I guess we should start a few.

Maybe I should just go ahead and try to create a group for programming in Carrara? I know nothing, as of yet, so not certain I should be the one to start it as I will have literally nothing to contribute initially, but maybe that shouldn't matter as long as it's started?

Yeah... sorry to be a nag :P I assume a lot of people would just be starting out, so even the most basic info like links and such are a good place as any to start.... I know it's out of the way (if you don't go there)..., and the newer Cafe features are still evolving (as I put in feature and bug requests).... But at least people might not have to start over at zero every time?

Anyhoo, you could be like our Luke Skywalker..., innocent at the start, but getting more skilled as he goes along. :cheese: HERO'S JOURNEY!

Jonstark
-sure go ahead and start one(group) at least then maybe a few folks will start to see it and maybe get something going. I do not wish to put a damper on your adventure but C++ programming within a 3d application is not going to an easy learn. That said ---if you have the yearning and the time --go about it.
There are a host of spots to start learning C++ and a number of good books so resource wise ---its available so best of luck man.
Just remember this is a years time frame to get proficicent its not a months thing...its that much stuff to ingest.

Jonstark
-sure go ahead and start one(group) at least then maybe a few folks will start to see it and maybe get something going. I do not wish to put a damper on your adventure but C++ programming within a 3d application is not going to an easy learn. That said ---if you have the yearning and the time --go about it.
There are a host of spots to start learning C++ and a number of good books so resource wise ---its available so best of luck man.
Just remember this is a years time frame to get proficicent its not a months thing...its that much stuff to ingest.

Smiles.

Rich

No, it's hardly easy. But a lot if the things that can make programming hard are taken care of for you when you are in a plugin environment. The "business" end of things is far more important - the idea, the need you are filling, and your proximity to that need.

The most painful plugins I have are the two I do not personally use. Interestingly, they are at the two ends of the spectrum as far as coding complexity.

MDD format has nothing interesting at all from a coding standpoint: it is a matter of dumping data out to a file. But I don't own or use the applications that most people want to use it with, and so support is always a painful process of trial and error

ERC is by far the most algorithmically complex plugin I've written. I am relatively certain that each operation does what I expect it to, but I couldn't tell you why you would want most of them. I see the same sort of operations available in Maya and Faba asked specifically for some of them, but the fact remains that as a non-animator, I have yet to ever use the thing myself.

So: find a need and fill it... But give preference to things that YOU need