Start a new topic


Original Post by: Wed Dec 3 18:12:49 2014

Where can i read information about mgExecute()?

Original Post by: Wed Dec 3 17:42:11 2014

In fltGcLightMode can we set Sampling and Angular Tolerances??

Original Post by: ChrisRogers Wed Dec 3 17:55:58 2014

setting fltGcLightMode simply tells the polygon what technique to use for lighting. In Creator (and most OpenGL applications) lighting is accomplished with normals on the vertices. If your lighting is not appearing the way you want it, you need to

1) Make sure your polygons are in the correct mode

2) Make sure your vertices have the correct normals

Settin gfltGcLightMode will get you in the right mode. However you still need the correct data on your normals.

Sampling and Angular tolerances are used in a tool inside of Creator to set up your normals in some common ways.

With that said, you need to run this tool to fix your normals if they are not correct. Usually this is done by the artist, because setting up normals for the best lighting is not as simple as running some automatic tool. However it is handy to use this tool in some common cases.

You may want to automatically run this tool from your code. This is possible, but only if your script or plugin is running inside Creator. To do this you can use the mgExecute() command to run Calculate Shading. Feel free to read up about this command in the help. It will allow you to set the sampling and angular tolerances to get what you expect.

(Oh just a reminder, when you ask a new question, please start a new thread. This makes finding answers in the forum much easier for other users. If other people have the same question, then they might only read the first few posts in this thread before they start to look through other threads.)

Original Post by: SteveThompson Wed Dec 3 18:16:06 2014

If you have API prior to 4.2 (and I believe you are using 4.1, right?), no wonder you can't find it. It was added to API 4.2. If you have API 4.2 or greater, it is in the OpenFlight API Developer Guide and API Refrence pages. Otherwise, you can search and search but won' t find it until you upgrade to 4.2 or later ;-)

Original Post by: Wed Dec 3 18:18:18 2014

Yeah Mine is 4.1 so its not there. :)

Original Post by: ChrisRogers Wed Dec 3 18:20:51 2014

mgExecute is a function that when called in the context of a script or plugin running inside of Creator, allows you to invoke a tool. However, Steve just informed me that you are running Creator 4.1 and this functionality was not yet introduced at that point. If you can't get your hands on a newer copy of Creator, or can't target your plugin to a newer copy of Creator, then you will not be able to continue on the course I suggested. I'm sorry if I got your hopes up just to let you down.

Edit: Ahh, I see Steve Beat me to the punch on this answer :)

Original Post by: SteveThompson Wed Dec 3 18:32:34 2014

Yeah Mine is 4.1 so its not there. smile

I suspect you are asking about mgExecute because you are considering running Calculate Shading from your plug-in (as Chris suggested you can do in the other thread). While running Calculate Shading from your plug-in might seem interesting, you might want to slow down and consider your user's workflow. In other words, just because you can do this in your plug-in does not mean you really should do this in your plug-in. At some point you have to get your users involved and have them build the models. Part of "building" a model might be to make sure it is "lit" properly. Is this a job for the user or a job for the plug-in? You need to ask that.

Again, before going down a certain path (like making your plug-in automatically calculate shading) first decide whether this is something you want your users to do or whether it really is something you want your plug-in to clobber.

Just my 2 cents.

Original Post by: Wed Dec 3 18:33:21 2014

Thats fine we do have Creator 4.2 but Majority are using 4.1 thats why I am also sticking to API 4.1.

Login to post a comment