![]() |
#1 |
Junior Member
Member
Join Date: Jun 2003
Location: NC, US
Posts: 11
|
![]()
One of the greatest features of AC3D is the SDK. Are people
actually doing anything with it? If so what have you implemented? Is there a repository of AC3D plugins? Has anyone done any surface filter plugins? Just wondering -rick |
![]() |
![]() |
![]() |
#2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,523
|
![]()
I know there are lots of developers using the SDK to develop their own plugins. Many of these are in companies where they are developing code that uses their own private format files or code.
People tend to host their own plugins and then send me a link which I add on the resources page. I've made a forum on here so that people can post announcements of plugins (or anything else). Due the the way the latest Undo mechanism works, please don't use the surface filter stuff that was in 3.6. This will be removed in the next release. As far as I know, no one has ever used surface-filters. Let me know if you have. If you'd like your plugin to be in the next release, send me the code and I'll incorporate it. Remember to credit yourself in the code and in the PluginAbout/Info functions. If you write anything - let others know using the Tutorials/Resources forum. Andy |
![]() |
![]() |
![]() |
#3 |
Junior Member
Member
Join Date: Jun 2003
Location: NC, US
Posts: 11
|
![]()
> Due the the way the latest Undo mechanism works, please don't use the surface
> filter stuff that was in 3.6. This will be removed in the next release. As far as I > know, no one has ever used surface-filters. Let me know if you have. I had just started looking at surface filters before I read this post. I'm interested in adding a new menu item that will force all normals to point outside of an object. Is there another way to accomplish this? -rick |
![]() |
![]() |
![]() |
#4 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,523
|
![]()
This sort of thing is easy enough in 3.6 but to make it undoable is a bit of a nightmare (or is quite inefficient).
For the next release (3.7), things are a lot better. Here's the actual code that changes the surface shading (when 'Flat' or 'Smooth' is pressed). Code:
class UndoableSurfacesSetShading : public Undoable { private: List *surfaces; List *oldshading; int newshading; public: UndoableSurfacesSetShading(int col) { newshading = col; surfaces = ac_selection_get_whole_surfaces_all(); oldshading = NULL; } void execute() { List *last = NULL; int numdone = 0; display_message("setting shading on surfaces..."); // save the old colours in a list for (List *p = surfaces; p != NULL; p = p->next) { Surface *s = (Surface *)p->data; last = list_add_item_fast(&oldshading, last, (void *)surface_get_shading(s)); surface_set_shading(s, newshading); numdone++; } redraw_all(); display_message("new shading set on surfaces: %d", numdone); } void undo() { // restore the original types display_message("restoring surface shading"); List *cl = oldshading; int numdone = 0; for (List *p = surfaces; p != NULL; p = p->next, cl = cl->next) { Surface *s = (Surface *)p->data; int oldshadingt = (int)cl->data; surface_set_shading(s, oldshadingt); numdone++; } redraw_all(); display_message("shading set on surfaces: %d", numdone); } void redo() { for (List *p = surfaces; p != NULL; p = p->next) { Surface *s = (Surface *)p->data; surface_set_shading(s, newshading); } redraw_all(); } ~UndoableSurfacesSetShading() { list_free(&surfaces); list_free(&oldshading); } }; Prototype void selected_set_surface_shading(int indexc) { add_undoable("set surface shading", new UndoableSurfacesSetShading(indexc)); } |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|