Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 23rd June 2003, 08:22 PM   #1
Rick Kimball
Junior Member
Member
 
Join Date: Jun 2003
Location: NC, US
Posts: 11
Default What are people developing with the SDK?

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
Rick Kimball is offline   Reply With Quote
Old 24th June 2003, 02:43 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,382
Default Re: What are people developing with the SDK?

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
Andy is offline   Reply With Quote
Old 24th June 2003, 08:36 AM   #3
Rick Kimball
Junior Member
Member
 
Join Date: Jun 2003
Location: NC, US
Posts: 11
Default Re: What are people developing with the SDK?

> 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
Rick Kimball is offline   Reply With Quote
Old 24th June 2003, 08:58 AM   #4
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,382
Default Re: What are people developing with the SDK?

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));
}
Andy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 02:05 PM.


AC3D Forum
(C) Inivis Limited 2020