2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define PY_TOOLBOX 1
|
2003-10-15 19:23:54 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#include <math.h>
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
2002-11-25 12:02:15 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#ifndef WIN32
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#else
|
|
|
|
|
#include <io.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
|
|
#include "BMF_Api.h"
|
2003-07-14 13:48:44 +00:00
|
|
|
#include "BIF_language.h"
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
#include "BIF_resources.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
#include "DNA_group_types.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_image_types.h"
|
2003-10-07 18:24:02 +00:00
|
|
|
#include "DNA_lamp_types.h"
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
#include "DNA_mesh_types.h"
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
#include "DNA_node_types.h"
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
#include "DNA_object_types.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_screen_types.h"
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
#include "DNA_space_types.h"
|
Phew, a lot of work, and no new features...
Main target was to make the inner rendering loop using no globals anymore.
This is essential for proper usage while raytracing, it caused a lot of
hacks in the raycode as well, which even didn't work correctly for all
situations (textures especially).
Done this by creating a new local struct RenderInput, which replaces usage
of the global struct Render R. The latter now only is used to denote
image size, viewmatrix, and the like.
Making the inner render loops using no globals caused 1000s of vars to
be changed... but the result definitely is much nicer code, which enables
making 'real' shaders in a next stage.
It also enabled me to remove the hacks from ray.c
Then i went to the task of removing redundant code. Especially the calculus
of texture coords took place (identical) in three locations.
Most obvious is the change in the unified render part, which is much less
code now; it uses the same rendering routines as normal render now.
(Note; not for halos yet!)
I also removed 6 files called 'shadowbuffer' something. This was experimen-
tal stuff from NaN days. And again saved a lot of double used code.
Finally I went over the blenkernel and blender/src calls to render stuff.
Here the same local data is used now, resulting in less dependency.
I also moved render-texture to the render module, this was still in Kernel.
(new file: texture.c)
So! After this commit I will check on the autofiles, to try to fix that.
MSVC people have to do it themselves.
This commit will need quite some testing help, but I'm around!
2003-12-21 21:52:51 +00:00
|
|
|
#include "DNA_scene_types.h"
|
2003-05-03 12:17:11 +00:00
|
|
|
#include "DNA_userdef_types.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_view3d_types.h"
|
2006-07-11 09:07:19 +00:00
|
|
|
#include "DNA_camera_types.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
|
#include "BLI_arithb.h"
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
#include "BKE_displist.h"
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
#include "BKE_depsgraph.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_global.h"
|
2006-12-20 17:57:56 +00:00
|
|
|
#include "BKE_image.h"
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
#include "BKE_library.h"
|
|
|
|
|
#include "BKE_mesh.h"
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
#include "BKE_node.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_main.h"
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
#include "BKE_plugin_types.h"
|
|
|
|
|
#include "BKE_utildefines.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2005-02-25 17:40:03 +00:00
|
|
|
#include "BIF_editnla.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_editarmature.h"
|
2004-09-28 16:18:22 +00:00
|
|
|
#include "BIF_editdeform.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_editfont.h"
|
|
|
|
|
#include "BIF_editmesh.h"
|
|
|
|
|
#include "BIF_editseq.h"
|
|
|
|
|
#include "BIF_editlattice.h"
|
|
|
|
|
#include "BIF_editsima.h"
|
2003-04-28 11:17:21 +00:00
|
|
|
#include "BIF_editoops.h"
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
#include "BIF_editview.h"
|
2005-02-25 17:40:03 +00:00
|
|
|
#include "BIF_gl.h"
|
|
|
|
|
#include "BIF_graphics.h"
|
2003-04-28 11:17:21 +00:00
|
|
|
#include "BIF_imasel.h"
|
2005-02-25 17:40:03 +00:00
|
|
|
#include "BIF_interface.h"
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
#include "BIF_mainqueue.h"
|
2005-02-25 17:40:03 +00:00
|
|
|
#include "BIF_mywindow.h"
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
#include "BIF_renderwin.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_screen.h"
|
2004-09-24 11:45:42 +00:00
|
|
|
#include "BIF_space.h"
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
#include "BIF_toolbox.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_tbcallback.h"
|
2005-02-25 17:40:03 +00:00
|
|
|
#include "BIF_transform.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
#include "BDR_editobject.h"
|
|
|
|
|
#include "BDR_editcurve.h"
|
|
|
|
|
#include "BDR_editmball.h"
|
|
|
|
|
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
#include "BSE_drawipo.h"
|
|
|
|
|
#include "BSE_edit.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BSE_editipo.h"
|
2003-04-28 11:17:21 +00:00
|
|
|
#include "BSE_filesel.h"
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
#include "BSE_headerbuttons.h"
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
#include "BSE_node.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
|
|
|
|
|
|
#include "blendef.h"
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
#include "butspace.h"
|
|
|
|
|
#include "mydevice.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2007-04-02 09:58:01 +00:00
|
|
|
/* bpymenu */
|
|
|
|
|
#include "BPY_extern.h"
|
|
|
|
|
#include "BPY_menus.h"
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void asciitoraw(int ch, unsigned short *event, unsigned short *qual)
|
|
|
|
|
{
|
|
|
|
|
if( isalpha(ch)==0 ) return;
|
|
|
|
|
|
|
|
|
|
if( isupper(ch) ) {
|
|
|
|
|
*qual= LEFTSHIFTKEY;
|
|
|
|
|
ch= tolower(ch);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch(ch) {
|
|
|
|
|
case 'a': *event= AKEY; break;
|
|
|
|
|
case 'b': *event= BKEY; break;
|
|
|
|
|
case 'c': *event= CKEY; break;
|
|
|
|
|
case 'd': *event= DKEY; break;
|
|
|
|
|
case 'e': *event= EKEY; break;
|
|
|
|
|
case 'f': *event= FKEY; break;
|
|
|
|
|
case 'g': *event= GKEY; break;
|
|
|
|
|
case 'h': *event= HKEY; break;
|
|
|
|
|
case 'i': *event= IKEY; break;
|
|
|
|
|
case 'j': *event= JKEY; break;
|
|
|
|
|
case 'k': *event= KKEY; break;
|
|
|
|
|
case 'l': *event= LKEY; break;
|
|
|
|
|
case 'm': *event= MKEY; break;
|
|
|
|
|
case 'n': *event= NKEY; break;
|
|
|
|
|
case 'o': *event= OKEY; break;
|
|
|
|
|
case 'p': *event= PKEY; break;
|
|
|
|
|
case 'q': *event= QKEY; break;
|
|
|
|
|
case 'r': *event= RKEY; break;
|
|
|
|
|
case 's': *event= SKEY; break;
|
|
|
|
|
case 't': *event= TKEY; break;
|
|
|
|
|
case 'u': *event= UKEY; break;
|
|
|
|
|
case 'v': *event= VKEY; break;
|
|
|
|
|
case 'w': *event= WKEY; break;
|
|
|
|
|
case 'x': *event= XKEY; break;
|
|
|
|
|
case 'y': *event= YKEY; break;
|
|
|
|
|
case 'z': *event= ZKEY; break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ************************************ */
|
2003-07-18 18:32:57 +00:00
|
|
|
|
|
|
|
|
/* this va_ stuff allows printf() style codes in these menus */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
static int vconfirm(char *title, char *itemfmt, va_list ap)
|
|
|
|
|
{
|
|
|
|
|
char *s, buf[512];
|
|
|
|
|
|
|
|
|
|
s= buf;
|
|
|
|
|
if (title) s+= sprintf(s, "%s%%t|", title);
|
|
|
|
|
vsprintf(s, itemfmt, ap);
|
|
|
|
|
|
|
|
|
|
return (pupmenu(buf)>=0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int confirm(char *title, char *itemfmt, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
|
|
va_start(ap, itemfmt);
|
|
|
|
|
ret= vconfirm(title, itemfmt, ap);
|
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int okee(char *str, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
int ret;
|
2005-10-04 20:17:30 +00:00
|
|
|
char titlestr[256];
|
|
|
|
|
|
|
|
|
|
sprintf(titlestr, "OK? %%i%d", ICON_HELP);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
va_start(ap, str);
|
2005-10-04 20:17:30 +00:00
|
|
|
ret= vconfirm(titlestr, str, ap);
|
2002-10-12 11:37:38 +00:00
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void notice(char *str, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
va_start(ap, str);
|
|
|
|
|
vconfirm(NULL, str, ap);
|
|
|
|
|
va_end(ap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void error(char *fmt, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
char nfmt[256];
|
2005-10-04 20:17:30 +00:00
|
|
|
char titlestr[256];
|
|
|
|
|
|
|
|
|
|
sprintf(titlestr, "Error %%i%d", ICON_ERROR);
|
|
|
|
|
|
|
|
|
|
sprintf(nfmt, "%s", fmt);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
va_start(ap, fmt);
|
2006-03-12 11:51:56 +00:00
|
|
|
if (G.background || !G.curscreen) {
|
2002-10-12 11:37:38 +00:00
|
|
|
vprintf(nfmt, ap);
|
|
|
|
|
printf("\n");
|
|
|
|
|
} else {
|
2005-10-04 20:17:30 +00:00
|
|
|
vconfirm(titlestr, nfmt, ap);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
va_end(ap);
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-22 22:08:19 +00:00
|
|
|
void error_libdata(void)
|
|
|
|
|
{
|
|
|
|
|
error(ERROR_LIBDATA_MESSAGE);
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
int saveover(char *file)
|
|
|
|
|
{
|
2006-07-09 13:00:41 +00:00
|
|
|
int len= strlen(file);
|
|
|
|
|
|
|
|
|
|
if(len==0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if(BLI_exists(file)==0)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
if( file[len-1]=='/' || file[len-1]=='\\' ) {
|
|
|
|
|
error("Cannot overwrite a directory");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return confirm("Save over", file);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* ****************** EXTRA STUFF **************** */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
short button(short *var, short min, short max, char *str)
|
|
|
|
|
{
|
|
|
|
|
uiBlock *block;
|
|
|
|
|
ListBase listb={0, 0};
|
|
|
|
|
short x1,y1;
|
|
|
|
|
short mval[2], ret=0;
|
|
|
|
|
|
|
|
|
|
if(min>max) min= max;
|
|
|
|
|
|
|
|
|
|
getmouseco_sc(mval);
|
|
|
|
|
|
|
|
|
|
if(mval[0]<150) mval[0]=150;
|
|
|
|
|
if(mval[1]<30) mval[1]=30;
|
|
|
|
|
if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10;
|
|
|
|
|
if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10;
|
|
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
|
2004-09-19 19:27:57 +00:00
|
|
|
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
x1=mval[0]-150;
|
|
|
|
|
y1=mval[1]-20;
|
|
|
|
|
|
|
|
|
|
uiDefButS(block, NUM, 0, str, (short)(x1+5),(short)(y1+10),125,20, var,(float)min,(float)max, 0, 0, "");
|
2007-01-12 11:13:34 +00:00
|
|
|
uiDefBut(block, BUT, 32767, "OK", (short)(x1+136),(short)(y1+10),25,20, NULL, 0, 0, 0, 0, "");
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
uiBoundsBlock(block, 5);
|
|
|
|
|
|
2007-12-11 23:05:10 +00:00
|
|
|
ret= uiDoBlocks(&listb, 0, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
if(ret==UI_RETURN_OK) return 1;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-19 11:44:09 +00:00
|
|
|
short sbutton(char *var, short min, short max, char *str)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
uiBlock *block;
|
|
|
|
|
ListBase listb={0, 0};
|
|
|
|
|
short x1,y1;
|
|
|
|
|
short mval[2], ret=0;
|
2008-04-19 11:44:09 +00:00
|
|
|
char *editvar = NULL; /* dont edit the original text, incase we cancel the popup */
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if(min>max) min= max;
|
|
|
|
|
|
|
|
|
|
getmouseco_sc(mval);
|
|
|
|
|
|
2007-06-25 13:01:46 +00:00
|
|
|
if(mval[0]<250) mval[0]=250;
|
2002-10-12 11:37:38 +00:00
|
|
|
if(mval[1]<30) mval[1]=30;
|
|
|
|
|
if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10;
|
|
|
|
|
if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10;
|
|
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2007-06-25 13:01:46 +00:00
|
|
|
x1=mval[0]-250;
|
2002-10-12 11:37:38 +00:00
|
|
|
y1=mval[1]-20;
|
|
|
|
|
|
2008-05-15 23:16:42 +00:00
|
|
|
editvar = MEM_callocN(max+1, "sbutton");
|
2008-04-19 11:44:09 +00:00
|
|
|
BLI_strncpy(editvar, var, max);
|
|
|
|
|
|
|
|
|
|
uiDefButC(block, TEX, 32766, str, x1+5,y1+10,225,20, editvar,(float)min,(float)max, 0, 0, "");
|
2007-06-25 13:01:46 +00:00
|
|
|
uiDefBut(block, BUT, 32767, "OK", x1+236,y1+10,25,20, NULL, 0, 0, 0, 0, "");
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
uiBoundsBlock(block, 5);
|
Patch #4980, by Joshua Leung (aligorith)
This enables finding data in the Outliner.
Usage: Fkey (partial strings), CTRL+Fkey (partial strings, case sensitive).
SHIFT+Fkey to repeat a search, this cycles around.
Extra changes:
- button popups to enter strings now starts activated.
- outliner either shows for Armature the Bones, or Posechannels or
Editbones, depending the mode. Was needed to make searches meaningful.
Although Joshua did very good work on the key functions, there were a couple
of issues in his code, and problems in Outliner code, that didn't make it
all work nicely. So, this is quite a revised patch. :)
Full review log can be found in the patch tracker.
2006-11-07 14:25:58 +00:00
|
|
|
|
2007-01-12 11:13:34 +00:00
|
|
|
mainqenter_ext(BUT_ACTIVATE, 32766, 0); /* note, button id '32766' is asking for errors some day! */
|
2007-12-11 23:05:10 +00:00
|
|
|
ret= uiDoBlocks(&listb, 0, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2008-04-19 11:44:09 +00:00
|
|
|
if(ret==UI_RETURN_OK) {
|
|
|
|
|
BLI_strncpy(var, editvar, max);
|
|
|
|
|
MEM_freeN(editvar);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
MEM_freeN(editvar);
|
2002-10-12 11:37:38 +00:00
|
|
|
return 0;
|
2007-06-25 13:01:46 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
2005-10-25 13:57:37 +00:00
|
|
|
short fbutton(float *var, float min, float max, float a1, float a2, char *str)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
uiBlock *block;
|
|
|
|
|
ListBase listb={0, 0};
|
|
|
|
|
short x1,y1;
|
|
|
|
|
short mval[2], ret=0;
|
|
|
|
|
|
|
|
|
|
if(min>max) min= max;
|
|
|
|
|
|
|
|
|
|
getmouseco_sc(mval);
|
|
|
|
|
|
|
|
|
|
if(mval[0]<150) mval[0]=150;
|
|
|
|
|
if(mval[1]<30) mval[1]=30;
|
|
|
|
|
if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10;
|
|
|
|
|
if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10;
|
|
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1);
|
|
|
|
|
|
|
|
|
|
x1=mval[0]-150;
|
|
|
|
|
y1=mval[1]-20;
|
|
|
|
|
|
2004-04-11 00:23:06 +00:00
|
|
|
uiDefButF(block, NUM, 0, str,(short)(x1+5),(short)(y1+10),125,20, var, min, max, a1, a2, "");
|
2007-01-12 11:13:34 +00:00
|
|
|
uiDefBut(block, BUT, 32767, "OK",(short)(x1+136),(short)(y1+10), 35, 20, NULL, 0, 0, 0, 0, "");
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
uiBoundsBlock(block, 2);
|
|
|
|
|
|
2007-12-11 23:05:10 +00:00
|
|
|
ret= uiDoBlocks(&listb, 0, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
if(ret==UI_RETURN_OK) return 1;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-24 18:58:59 +00:00
|
|
|
int movetolayer_buts(unsigned int *lay, char *title)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
uiBlock *block;
|
|
|
|
|
ListBase listb={0, 0};
|
|
|
|
|
int dx, dy, a, x1, y1, sizex=160, sizey=30;
|
|
|
|
|
short pivot[2], mval[2], ret=0;
|
|
|
|
|
|
|
|
|
|
if(G.vd->localview) {
|
|
|
|
|
error("Not in localview ");
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getmouseco_sc(mval);
|
|
|
|
|
|
|
|
|
|
pivot[0]= CLAMPIS(mval[0], (sizex+10), G.curscreen->sizex-30);
|
|
|
|
|
pivot[1]= CLAMPIS(mval[1], (sizey/2)+10, G.curscreen->sizey-(sizey/2)-10);
|
|
|
|
|
|
|
|
|
|
if (pivot[0]!=mval[0] || pivot[1]!=mval[1])
|
|
|
|
|
warp_pointer(pivot[0], pivot[1]);
|
|
|
|
|
|
|
|
|
|
mywinset(G.curscreen->mainwin);
|
|
|
|
|
|
|
|
|
|
x1= pivot[0]-sizex+10;
|
|
|
|
|
y1= pivot[1]-sizey/2;
|
|
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
|
2003-11-21 13:14:50 +00:00
|
|
|
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
dx= (sizex-5)/12;
|
|
|
|
|
dy= sizey/2;
|
|
|
|
|
|
2006-11-24 18:58:59 +00:00
|
|
|
if(title)
|
|
|
|
|
uiDefBut(block, LABEL, 0, title, (short)(x1), (short)y1+30, sizex, 20, NULL, 1, 0, 0, 0, "");
|
2004-11-22 11:48:51 +00:00
|
|
|
|
2006-11-24 18:58:59 +00:00
|
|
|
/* buttons have 0 as return event, to prevent menu to close on hotkeys */
|
2003-11-22 22:22:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
for(a=0; a<5; a++)
|
2007-03-17 14:43:52 +00:00
|
|
|
uiDefButBitI(block, TOGR, 1<<a, 0, "",(short)(x1+a*dx),(short)(y1+dy),(short)dx,(short)dy, (int *)lay, 0, 0, 0, 0, "");
|
2003-11-22 22:22:16 +00:00
|
|
|
for(a=0; a<5; a++)
|
2007-03-17 14:43:52 +00:00
|
|
|
uiDefButBitI(block, TOGR, 1<<(a+10), 0, "",(short)(x1+a*dx),(short)y1,(short)dx,(short)dy, (int *)lay, 0, 0, 0, 0, "");
|
2003-11-22 22:22:16 +00:00
|
|
|
x1+= 5;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-11-22 22:22:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
for(a=5; a<10; a++)
|
2007-03-17 14:43:52 +00:00
|
|
|
uiDefButBitI(block, TOGR, 1<<a, 0, "",(short)(x1+a*dx),(short)(y1+dy),(short)dx,(short)dy, (int *)lay, 0, 0, 0, 0, "");
|
2003-11-22 22:22:16 +00:00
|
|
|
for(a=5; a<10; a++)
|
2007-03-17 14:43:52 +00:00
|
|
|
uiDefButBitI(block, TOGR, 1<<(a+10), 0, "",(short)(x1+a*dx),(short)y1,(short)dx,(short)dy, (int *)lay, 0, 0, 0, 0, "");
|
2003-11-22 22:22:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
|
|
|
|
x1-= 5;
|
2007-01-12 11:13:34 +00:00
|
|
|
uiDefBut(block, BUT, 32767, "OK", (short)(x1+10*dx+10), (short)y1, (short)(3*dx), (short)(2*dy), NULL, 0, 0, 0, 0, "");
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
uiBoundsBlock(block, 2);
|
|
|
|
|
|
2007-12-11 23:05:10 +00:00
|
|
|
ret= uiDoBlocks(&listb, 0, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
if(ret==UI_RETURN_OK) return 1;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-24 18:58:59 +00:00
|
|
|
/* armature or bone */
|
|
|
|
|
int movetolayer_short_buts(short *lay, char *title)
|
2005-12-07 12:36:26 +00:00
|
|
|
{
|
|
|
|
|
uiBlock *block;
|
|
|
|
|
ListBase listb={0, 0};
|
|
|
|
|
int dx, dy, a, x1, y1, sizex=120, sizey=30;
|
|
|
|
|
short pivot[2], mval[2], ret=0;
|
|
|
|
|
|
|
|
|
|
getmouseco_sc(mval);
|
|
|
|
|
|
|
|
|
|
pivot[0]= CLAMPIS(mval[0], (sizex+10), G.curscreen->sizex-30);
|
|
|
|
|
pivot[1]= CLAMPIS(mval[1], (sizey/2)+10, G.curscreen->sizey-(sizey/2)-10);
|
|
|
|
|
|
|
|
|
|
if (pivot[0]!=mval[0] || pivot[1]!=mval[1])
|
|
|
|
|
warp_pointer(pivot[0], pivot[1]);
|
|
|
|
|
|
|
|
|
|
mywinset(G.curscreen->mainwin);
|
|
|
|
|
|
|
|
|
|
x1= pivot[0]-sizex+10;
|
|
|
|
|
y1= pivot[1]-sizey/2;
|
|
|
|
|
|
|
|
|
|
block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
|
|
|
|
|
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK);
|
|
|
|
|
|
|
|
|
|
dx= (sizex-5)/10;
|
|
|
|
|
dy= sizey/2;
|
|
|
|
|
|
2006-11-24 18:58:59 +00:00
|
|
|
if(title)
|
|
|
|
|
uiDefBut(block, LABEL, 0, title, (short)(x1), (short)y1+30, sizex, 20, NULL, 1, 0, 0, 0, "");
|
|
|
|
|
|
2005-12-07 12:36:26 +00:00
|
|
|
/* buttons have 0 as return event, to prevent menu to close on hotkeys */
|
|
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
for(a=0; a<8; a++)
|
|
|
|
|
uiDefButBitS(block, TOGR, 1<<a, 0, "",(short)(x1+a*dx),(short)(y1+dy),(short)dx,(short)dy, lay, 0, 0, 0, 0, "");
|
|
|
|
|
for(a=0; a<8; a++)
|
|
|
|
|
uiDefButBitS(block, TOGR, 1<<(a+8), 0, "",(short)(x1+a*dx),(short)y1,(short)dx,(short)dy, lay, 0, 0, 0, 0, "");
|
|
|
|
|
|
|
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
|
|
|
|
x1-= 5;
|
2007-01-12 11:13:34 +00:00
|
|
|
uiDefBut(block, BUT, 32767, "OK", (short)(x1+8*dx+10), (short)y1, (short)(3*dx), (short)(2*dy), NULL, 0, 0, 0, 0, "");
|
2005-12-07 12:36:26 +00:00
|
|
|
|
|
|
|
|
uiBoundsBlock(block, 2);
|
|
|
|
|
|
2007-12-11 23:05:10 +00:00
|
|
|
ret= uiDoBlocks(&listb, 0, 0);
|
2005-12-07 12:36:26 +00:00
|
|
|
|
|
|
|
|
if(ret==UI_RETURN_OK) return 1;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* ********************** CLEVER_NUMBUTS ******************** */
|
|
|
|
|
|
2006-11-05 12:32:00 +00:00
|
|
|
#define MAXNUMBUTS 120
|
2006-12-15 20:22:59 +00:00
|
|
|
#define MAXNUMBUTROWS 8
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
VarStruct numbuts[MAXNUMBUTS];
|
|
|
|
|
void *numbpoin[MAXNUMBUTS];
|
|
|
|
|
int numbdata[MAXNUMBUTS];
|
|
|
|
|
|
|
|
|
|
void draw_numbuts_tip(char *str, int x1, int y1, int x2, int y2)
|
|
|
|
|
{
|
|
|
|
|
static char *last=0; /* avoid ugly updates! */
|
|
|
|
|
int temp;
|
|
|
|
|
|
|
|
|
|
if(str==last) return;
|
|
|
|
|
last= str;
|
|
|
|
|
if(str==0) return;
|
|
|
|
|
|
|
|
|
|
glColor3ub(160, 160, 160); /* MGREY */
|
|
|
|
|
glRecti(x1+4, y2-36, x2-4, y2-16);
|
|
|
|
|
|
|
|
|
|
cpack(0x0);
|
|
|
|
|
|
|
|
|
|
temp= 0;
|
2004-01-13 14:50:45 +00:00
|
|
|
while( BIF_GetStringWidth(G.fonts, str+temp, (U.transopts & USER_TR_BUTTONS))>(x2 - x1-24)) temp++;
|
2002-10-12 11:37:38 +00:00
|
|
|
glRasterPos2i(x1+16, y2-30);
|
2004-01-13 14:50:45 +00:00
|
|
|
BIF_DrawString(G.fonts, str+temp, (U.transopts & USER_TR_BUTTONS));
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int do_clever_numbuts(char *name, int tot, int winevent)
|
|
|
|
|
{
|
|
|
|
|
ListBase listb= {NULL, NULL};
|
|
|
|
|
uiBlock *block;
|
|
|
|
|
VarStruct *varstr;
|
2006-11-05 12:32:00 +00:00
|
|
|
int a, sizex, sizey, x1, y2, width, colunms=1, xi=0, yi=0;
|
2002-10-12 11:37:38 +00:00
|
|
|
short mval[2], event;
|
|
|
|
|
|
2006-01-11 04:03:19 +00:00
|
|
|
/* Clear all events so tooltips work, this is not ideal and
|
|
|
|
|
only needed because calls from the menu still have some events
|
|
|
|
|
left over when do_clever_numbuts is called.
|
|
|
|
|
Calls from keyshortcuts do not have this problem.*/
|
|
|
|
|
ScrArea *sa;
|
|
|
|
|
BWinEvent temp_bevt;
|
|
|
|
|
for (sa= G.curscreen->areabase.first; sa; sa= sa->next) {
|
2006-01-30 11:30:37 +00:00
|
|
|
if(sa->win) {
|
|
|
|
|
while( bwin_qread( sa->win, &temp_bevt ) ) {}
|
|
|
|
|
}
|
|
|
|
|
if(sa->headwin) {
|
|
|
|
|
while( bwin_qread( sa->headwin, &temp_bevt ) ) {}
|
|
|
|
|
}
|
2006-01-11 04:03:19 +00:00
|
|
|
}
|
|
|
|
|
/* Done clearing events */
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if(tot<=0 || tot>MAXNUMBUTS) return 0;
|
2006-11-05 12:32:00 +00:00
|
|
|
|
|
|
|
|
/* if we have too many buttons then have more then 1 column */
|
|
|
|
|
colunms= (int)ceil((double)tot / (double)MAXNUMBUTROWS);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
getmouseco_sc(mval);
|
|
|
|
|
|
|
|
|
|
/* size */
|
2006-11-05 12:32:00 +00:00
|
|
|
sizex= 175;
|
|
|
|
|
sizey= 30+20*(MIN2(MAXNUMBUTROWS, tot)+1);
|
|
|
|
|
width= (sizex*colunms)+60;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* center */
|
2006-11-05 12:32:00 +00:00
|
|
|
if(mval[0]<width/2) mval[0]=width/2;
|
2002-10-12 11:37:38 +00:00
|
|
|
if(mval[1]<sizey/2) mval[1]=sizey/2;
|
2006-11-05 12:32:00 +00:00
|
|
|
if(mval[0]>G.curscreen->sizex -width/2) mval[0]= G.curscreen->sizex -width/2;
|
2002-10-12 11:37:38 +00:00
|
|
|
if(mval[1]>G.curscreen->sizey -sizey/2) mval[1]= G.curscreen->sizey -sizey/2;
|
|
|
|
|
|
|
|
|
|
mywinset(G.curscreen->mainwin);
|
|
|
|
|
|
2006-11-05 12:32:00 +00:00
|
|
|
x1= mval[0]-width/2;
|
2002-10-12 11:37:38 +00:00
|
|
|
y2= mval[1]+sizey/2;
|
|
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
block= uiNewBlock(&listb, "numbuts", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK);
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* WATCH IT: TEX BUTTON EXCEPTION */
|
2006-01-09 05:01:17 +00:00
|
|
|
/* WARNING: ONLY A SINGLE BIT-BUTTON POSSIBLE: WE WORK AT COPIED DATA! */
|
2006-01-11 16:55:31 +00:00
|
|
|
|
|
|
|
|
BIF_ThemeColor(TH_MENU_TEXT); /* makes text readable on dark theme */
|
|
|
|
|
|
2006-11-05 12:32:00 +00:00
|
|
|
uiDefBut(block, LABEL, 0, name, (short)(x1+15), (short)(y2-35), (short)(width-60), 19, 0, 1.0, 0.0, 0, 0, "");
|
2006-01-09 05:01:17 +00:00
|
|
|
|
|
|
|
|
/*
|
2002-10-12 11:37:38 +00:00
|
|
|
if(name[0]=='A' && name[7]=='O') {
|
|
|
|
|
y2 -= 20;
|
|
|
|
|
uiDefBut(block, LABEL, 0, "Rotations in degrees!", (short)(x1+15), (short)(y2-35), (short)(sizex-60), 19, 0, 0.0, 0.0, 0, 0, "");
|
2006-01-09 05:01:17 +00:00
|
|
|
}*/
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2006-01-09 05:01:17 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2002-10-12 11:37:38 +00:00
|
|
|
varstr= &numbuts[0];
|
|
|
|
|
for(a=0; a<tot; a++, varstr++) {
|
2006-01-11 16:55:31 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if(varstr->type==TEX) {
|
2006-11-05 12:32:00 +00:00
|
|
|
uiDefBut(block, TEX, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, varstr->tip);
|
2007-05-03 15:10:44 +00:00
|
|
|
} else if(varstr->type==COL) {
|
|
|
|
|
uiDefButF(block, COL, 0, "",(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, "");
|
|
|
|
|
} else {
|
2007-01-04 11:43:13 +00:00
|
|
|
if(varstr->type==LABEL) {/* dont include the label when rounding the buttons */
|
2006-01-11 16:55:31 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
2007-01-04 11:43:13 +00:00
|
|
|
/* using the tip for the name, this is incorrect lets us get around the 16 char limit of name */
|
|
|
|
|
/* Changed from the line below to use the tip since the tip isnt used for a label */
|
|
|
|
|
uiDefBut(block, varstr->type, 0, varstr->tip,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, "");
|
|
|
|
|
} else {
|
|
|
|
|
uiDefBut(block, varstr->type, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, varstr->tip);
|
|
|
|
|
}
|
2006-01-11 16:55:31 +00:00
|
|
|
|
|
|
|
|
if(varstr->type==LABEL)
|
|
|
|
|
uiBlockBeginAlign(block);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2006-01-11 16:55:31 +00:00
|
|
|
|
2006-11-05 12:32:00 +00:00
|
|
|
/* move to the next column */
|
|
|
|
|
yi++;
|
|
|
|
|
if (yi>=MAXNUMBUTROWS) {
|
|
|
|
|
yi=0;
|
|
|
|
|
xi++;
|
|
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2006-01-09 05:01:17 +00:00
|
|
|
uiBlockEndAlign(block);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2006-11-05 12:32:00 +00:00
|
|
|
uiDefBut(block, BUT, 4000, "OK", (short)(x1+width-40),(short)(y2-35-20*MIN2(MAXNUMBUTROWS,a)), 25, (short)(sizey-50), 0, 0, 0, 0, 0, "OK: Assign Values");
|
2006-01-09 05:01:17 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBoundsBlock(block, 5);
|
|
|
|
|
|
2007-12-11 23:05:10 +00:00
|
|
|
event= uiDoBlocks(&listb, 0, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
areawinset(curarea->win);
|
|
|
|
|
|
|
|
|
|
if(event & UI_RETURN_OK) {
|
|
|
|
|
|
|
|
|
|
varstr= &numbuts[0];
|
|
|
|
|
for(a=0; a<tot; a++, varstr++) {
|
|
|
|
|
if(varstr->type==TEX);
|
|
|
|
|
else if ELEM( (varstr->type & BUTPOIN), FLO, INT ) memcpy(numbpoin[a], numbdata+a, 4);
|
|
|
|
|
else if((varstr->type & BUTPOIN)==SHO ) *((short *)(numbpoin[a]))= *( (short *)(numbdata+a));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(winevent) {
|
|
|
|
|
ScrArea *sa;
|
|
|
|
|
|
|
|
|
|
sa= G.curscreen->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
if(sa->spacetype==curarea->spacetype) addqueue(sa->win, winevent, 1);
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void add_numbut(int nr, int type, char *str, float min, float max, void *poin, char *tip)
|
|
|
|
|
{
|
2007-01-07 19:52:13 +00:00
|
|
|
int tip_max = sizeof(numbuts[nr].tip);
|
|
|
|
|
int name_max = sizeof(numbuts[nr].name);
|
|
|
|
|
|
|
|
|
|
if(nr >= MAXNUMBUTS || (nr < 0)) return;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
numbuts[nr].type= type;
|
2007-01-04 11:43:13 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
numbuts[nr].min= min;
|
|
|
|
|
numbuts[nr].max= max;
|
2002-12-22 13:43:21 +00:00
|
|
|
|
2007-01-04 11:43:13 +00:00
|
|
|
if (type==LABEL) {
|
|
|
|
|
/* evil use it tooltip for the label string to get around the 16 char limit of "name" */
|
2007-01-07 19:52:13 +00:00
|
|
|
if (str) {
|
|
|
|
|
strncpy(numbuts[nr].tip, str, tip_max);
|
|
|
|
|
numbuts[nr].tip[tip_max-1] = 0;
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(numbuts[nr].tip, "");
|
|
|
|
|
}
|
2007-01-04 11:43:13 +00:00
|
|
|
} else {
|
|
|
|
|
/* for all other types */
|
2007-01-07 19:52:13 +00:00
|
|
|
if (str) {
|
|
|
|
|
strncpy(numbuts[nr].name, str, name_max);
|
|
|
|
|
numbuts[nr].name[name_max-1] = 0;
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(numbuts[nr].name, "");
|
|
|
|
|
}
|
|
|
|
|
if (tip) {
|
|
|
|
|
strncpy(numbuts[nr].tip, tip, tip_max);
|
|
|
|
|
numbuts[nr].tip[tip_max-1] = 0;
|
|
|
|
|
} else {
|
2007-01-04 11:43:13 +00:00
|
|
|
strcpy(numbuts[nr].tip, "");
|
2007-01-07 19:52:13 +00:00
|
|
|
}
|
2007-01-04 11:43:13 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/*WATCH: TEX BUTTON EXCEPTION */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
numbpoin[nr]= poin;
|
|
|
|
|
|
|
|
|
|
if ELEM( (type & BUTPOIN), FLO, INT ) memcpy(numbdata+nr, poin, 4);
|
|
|
|
|
if((type & BUTPOIN)==SHO ) *((short *)(numbdata+nr))= *( (short *)poin);
|
|
|
|
|
|
2006-01-09 05:01:17 +00:00
|
|
|
/* if( strncmp(numbuts[nr].name, "Rot", 3)==0 ) {
|
2002-10-12 11:37:38 +00:00
|
|
|
float *fp;
|
|
|
|
|
|
|
|
|
|
fp= (float *)(numbdata+nr);
|
|
|
|
|
fp[0]= 180.0*fp[0]/M_PI;
|
2006-01-09 05:01:17 +00:00
|
|
|
} */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clever_numbuts(void)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if(curarea->spacetype==SPACE_VIEW3D) {
|
2004-04-26 14:17:48 +00:00
|
|
|
// panel now
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(curarea->spacetype==SPACE_NLA){
|
2004-04-26 14:17:48 +00:00
|
|
|
// panel now
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(curarea->spacetype==SPACE_IPO) {
|
2004-04-26 14:17:48 +00:00
|
|
|
// panel now
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(curarea->spacetype==SPACE_SEQ) {
|
2004-06-16 20:25:56 +00:00
|
|
|
// panel now
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(curarea->spacetype==SPACE_IMAGE) {
|
2004-04-26 14:17:48 +00:00
|
|
|
// panel now
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-04-28 11:17:21 +00:00
|
|
|
else if(curarea->spacetype==SPACE_IMASEL) {
|
|
|
|
|
clever_numbuts_imasel();
|
|
|
|
|
}
|
|
|
|
|
else if(curarea->spacetype==SPACE_OOPS) {
|
|
|
|
|
clever_numbuts_oops();
|
|
|
|
|
}
|
2003-07-20 23:04:09 +00:00
|
|
|
else if(curarea->spacetype==SPACE_ACTION){
|
2004-04-26 14:17:48 +00:00
|
|
|
// in its own queue
|
2003-07-20 23:04:09 +00:00
|
|
|
}
|
2003-04-28 11:17:21 +00:00
|
|
|
else if(curarea->spacetype==SPACE_FILE) {
|
|
|
|
|
clever_numbuts_filesel();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void replace_names_but(void)
|
|
|
|
|
{
|
|
|
|
|
Image *ima= G.main->image.first;
|
|
|
|
|
short len, tot=0;
|
|
|
|
|
char old[64], new[64], temp[80];
|
|
|
|
|
|
|
|
|
|
strcpy(old, "/");
|
|
|
|
|
strcpy(new, "/");
|
|
|
|
|
|
|
|
|
|
add_numbut(0, TEX, "Old:", 0, 63, old, 0);
|
|
|
|
|
add_numbut(1, TEX, "New:", 0, 63, new, 0);
|
|
|
|
|
|
|
|
|
|
if (do_clever_numbuts("Replace image name", 2, REDRAW) ) {
|
|
|
|
|
|
|
|
|
|
len= strlen(old);
|
|
|
|
|
|
|
|
|
|
while(ima) {
|
|
|
|
|
|
|
|
|
|
if(strncmp(old, ima->name, len)==0) {
|
|
|
|
|
|
|
|
|
|
strcpy(temp, new);
|
|
|
|
|
strcat(temp, ima->name+len);
|
|
|
|
|
BLI_strncpy(ima->name, temp, sizeof(ima->name));
|
|
|
|
|
|
2006-12-20 17:57:56 +00:00
|
|
|
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
tot++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ima= ima->id.next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notice("Replaced %d names", tot);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2003-10-07 18:24:02 +00:00
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
/* ********************** NEW TOOLBOX ********************** */
|
|
|
|
|
|
|
|
|
|
ListBase tb_listb= {NULL, NULL};
|
|
|
|
|
|
|
|
|
|
#define TB_TAB 256
|
|
|
|
|
#define TB_ALT 512
|
|
|
|
|
#define TB_CTRL 1024
|
2003-10-25 22:29:24 +00:00
|
|
|
#define TB_PAD 2048
|
2004-01-12 13:30:00 +00:00
|
|
|
#define TB_SHIFT 4096
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
static void tb_do_hotkey(void *arg, int event)
|
|
|
|
|
{
|
2004-10-19 21:29:15 +00:00
|
|
|
unsigned short i, key=0;
|
|
|
|
|
unsigned short qual[] = { 0,0,0,0 };
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
if(event & TB_CTRL) {
|
2004-10-19 21:29:15 +00:00
|
|
|
qual[0] = LEFTCTRLKEY;
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
event &= ~TB_CTRL;
|
|
|
|
|
}
|
|
|
|
|
if(event & TB_ALT) {
|
2004-10-19 21:29:15 +00:00
|
|
|
qual[1] = LEFTALTKEY;
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
event &= ~TB_ALT;
|
|
|
|
|
}
|
2004-01-12 13:30:00 +00:00
|
|
|
if(event & TB_SHIFT) {
|
2004-10-19 21:29:15 +00:00
|
|
|
qual[2] = LEFTSHIFTKEY;
|
2004-01-12 13:30:00 +00:00
|
|
|
event &= ~TB_SHIFT;
|
|
|
|
|
}
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
if(event & TB_TAB) key= TABKEY;
|
2003-10-25 22:29:24 +00:00
|
|
|
else if(event & TB_PAD) {
|
|
|
|
|
event &= ~TB_PAD;
|
|
|
|
|
switch(event) {
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
case '-': key= PADMINUS; break;
|
|
|
|
|
case '+': key= PADPLUSKEY; break;
|
2003-10-29 00:23:16 +00:00
|
|
|
case '0': key= PAD0; break;
|
|
|
|
|
case '5': key= PAD5; break;
|
|
|
|
|
case '/': key= PADSLASHKEY; break;
|
|
|
|
|
case '.': key= PADPERIOD; break;
|
|
|
|
|
case '*': key= PADASTERKEY; break;
|
|
|
|
|
case 'h': key= HOMEKEY; break;
|
|
|
|
|
case 'u': key= PAGEUPKEY; break;
|
|
|
|
|
case 'd': key= PAGEDOWNKEY; break;
|
2003-10-25 22:29:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-10-19 21:29:15 +00:00
|
|
|
else asciitoraw(event, &key, &qual[3]);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2004-10-19 21:29:15 +00:00
|
|
|
for (i=0;i<4;i++)
|
|
|
|
|
{
|
|
|
|
|
if(qual[i]) mainqenter(qual[i], 1);
|
|
|
|
|
}
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
mainqenter(key, 1);
|
|
|
|
|
mainqenter(key, 0);
|
|
|
|
|
mainqenter(EXECUTE, 1);
|
2004-10-19 21:29:15 +00:00
|
|
|
|
|
|
|
|
for (i=0;i<4;i++)
|
|
|
|
|
{
|
|
|
|
|
if(qual[i]) mainqenter(qual[i], 0);
|
|
|
|
|
}
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* *************Select ********** */
|
|
|
|
|
|
2004-01-12 13:30:00 +00:00
|
|
|
static TBitem tb_object_select_layer1_5[]= {
|
|
|
|
|
{ 0, "1", 1, NULL},
|
|
|
|
|
{ 0, "2", 2, NULL},
|
|
|
|
|
{ 0, "3", 3, NULL},
|
|
|
|
|
{ 0, "4", 4, NULL},
|
|
|
|
|
{ 0, "5", 5, NULL},
|
|
|
|
|
{ -1, "", 0, do_view3d_select_object_layermenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_object_select_layer6_10[]= {
|
|
|
|
|
{ 0, "6", 6, NULL},
|
|
|
|
|
{ 0, "7", 7, NULL},
|
|
|
|
|
{ 0, "8", 8, NULL},
|
|
|
|
|
{ 0, "9", 9, NULL},
|
|
|
|
|
{ 0, "10", 10, NULL},
|
|
|
|
|
{ -1, "", 0, do_view3d_select_object_layermenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_object_select_layer11_15[]= {
|
|
|
|
|
{ 0, "11", 11, NULL},
|
|
|
|
|
{ 0, "12", 12, NULL},
|
|
|
|
|
{ 0, "13", 13, NULL},
|
|
|
|
|
{ 0, "14", 14, NULL},
|
|
|
|
|
{ 0, "15", 15, NULL},
|
|
|
|
|
{ -1, "", 0, do_view3d_select_object_layermenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_object_select_layer16_20[]= {
|
|
|
|
|
{ 0, "16", 16, NULL},
|
|
|
|
|
{ 0, "17", 17, NULL},
|
|
|
|
|
{ 0, "18", 18, NULL},
|
|
|
|
|
{ 0, "19", 19, NULL},
|
|
|
|
|
{ 0, "20", 20, NULL},
|
|
|
|
|
{ -1, "", 0, do_view3d_select_object_layermenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_object_select_layer[]= {
|
|
|
|
|
{ 0, "Layers 1-5", 0, tb_object_select_layer1_5},
|
|
|
|
|
{ 0, "Layers 6-10", 0, tb_object_select_layer6_10},
|
|
|
|
|
{ 0, "Layers 11-15", 0, tb_object_select_layer11_15},
|
|
|
|
|
{ 0, "Layers 16-20", 0, tb_object_select_layer16_20},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_object_select_type[]= {
|
|
|
|
|
{ 0, "Mesh", 1, NULL},
|
|
|
|
|
{ 0, "Curve", 2, NULL},
|
|
|
|
|
{ 0, "Surface", 3, NULL},
|
|
|
|
|
{ 0, "Meta", 4, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Armature", 5, NULL},
|
|
|
|
|
{ 0, "Lattice", 6, NULL},
|
|
|
|
|
{ 0, "Text", 7, NULL},
|
|
|
|
|
{ 0, "Empty", 8, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Camera", 9, NULL},
|
|
|
|
|
{ 0, "Lamp", 10, NULL},
|
|
|
|
|
{ -1, "", 0, do_view3d_select_object_typemenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_object_select_linked[]= {
|
|
|
|
|
{ 0, "Object Ipo|Shift L, 1", 1, NULL},
|
|
|
|
|
{ 0, "ObData|Shift L, 2", 2, NULL},
|
|
|
|
|
{ 0, "Material|Shift L, 3", 3, NULL},
|
|
|
|
|
{ 0, "Texture|Shift L, 4", 4, NULL},
|
|
|
|
|
{ -1, "", 0, do_view3d_select_object_linkedmenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_object_select_grouped[]= {
|
|
|
|
|
{ 0, "Children|Shift G, 1", 1, NULL},
|
|
|
|
|
{ 0, "Immediate Children|Shift G, 2", 2, NULL},
|
|
|
|
|
{ 0, "Parent|Shift G, 3", 3, NULL},
|
2006-10-09 18:56:02 +00:00
|
|
|
{ 0, "Siblings (Shared Parent)|Shift G, 4", 4, NULL},
|
|
|
|
|
{ 0, "Objects of Same Type|Shift G, 5", 5, NULL},
|
|
|
|
|
{ 0, "Objects on Shared Layers|Shift G, 6", 6, NULL},
|
|
|
|
|
{ 0, "Objects in Same Group|Shift G, 7", 7, NULL},
|
|
|
|
|
{ 0, "Object Hooks|Shift G, 8", 8, NULL},
|
2007-10-17 11:17:11 +00:00
|
|
|
{ 0, "Object PassIndex|Shift G, 9", 9, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ -1, "", 0, do_view3d_select_object_groupedmenu}};
|
|
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
static TBitem tb_object_select[]= {
|
2005-10-05 13:08:07 +00:00
|
|
|
{ 0, "Border Select|B", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2005-10-05 13:08:07 +00:00
|
|
|
{ 0, "Select/Deselect All|A", 1, NULL},
|
|
|
|
|
{ 0, "Inverse", 2, NULL},
|
2008-01-21 18:09:05 +00:00
|
|
|
{ 0, "Random", 3, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Select All by Layer", 0, tb_object_select_layer},
|
|
|
|
|
{ 0, "Select All by Type", 0, tb_object_select_type},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Linked", 0, tb_object_select_linked},
|
|
|
|
|
{ 0, "Grouped", 0, tb_object_select_grouped},
|
2005-10-05 13:08:07 +00:00
|
|
|
{ -1, "", 0, do_view3d_select_objectmenu}};
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2006-06-27 11:55:33 +00:00
|
|
|
static TBitem tb_face_select[]= {
|
|
|
|
|
{ 0, "Border Select|B", 0, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Select/Deselect All|A", 2, NULL},
|
|
|
|
|
{ 0, "Inverse", 3, NULL},
|
|
|
|
|
{ 0, "Same UV", 4, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Linked Faces|Ctrl L", 5, NULL},
|
|
|
|
|
{ -1, "", 0, do_view3d_select_faceselmenu}};
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
static TBitem tb_mesh_select[]= {
|
2004-01-03 09:22:33 +00:00
|
|
|
{ 0, "Border Select|B", 0, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2007-10-20 12:16:54 +00:00
|
|
|
{ 0, "Select/Deselect All|A", 2, NULL},
|
|
|
|
|
{ 0, "Inverse|Ctrl I", 3, NULL},
|
2004-01-03 09:22:33 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Random...", 5, NULL},
|
|
|
|
|
{ 0, "Non-Manifold|Shift Ctrl Alt M", 9, NULL},
|
2005-12-29 23:26:48 +00:00
|
|
|
{ 0, "Sharp Edges|Shift Ctrl Alt S", 14, NULL},
|
|
|
|
|
{ 0, "Linked Flat Faces|Shift Ctrl Alt F", 15, NULL},
|
2005-08-16 22:11:40 +00:00
|
|
|
{ 0, "Triangles|Shift Ctrl Alt 3", 11, NULL},
|
|
|
|
|
{ 0, "Quads|Shift Ctrl Alt 4", 12, NULL},
|
2006-03-11 03:23:57 +00:00
|
|
|
{ 0, "Non-Triangles/Quads|Shift Ctrl Alt 5", 13, NULL},
|
2007-08-13 23:25:15 +00:00
|
|
|
{ 0, "Similar to Selection|Shift G", 21, NULL},
|
2004-01-03 09:22:33 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "More|Ctrl NumPad +", 7, NULL},
|
|
|
|
|
{ 0, "Less|Ctrl NumPad -", 8, NULL},
|
2004-01-03 09:22:33 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Linked Vertices|Ctrl L", 4, NULL},
|
2006-06-19 03:31:30 +00:00
|
|
|
{ 0, "Vertex Path|W Alt 7", 16, NULL},
|
|
|
|
|
{ 0, "Edge Loop|Ctrl E 6", 17, NULL},
|
|
|
|
|
{ 0, "Edge Ring|Ctrl E 7", 18, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2006-05-11 19:46:26 +00:00
|
|
|
{ 0, "Loop to Region|Ctrl E 8", 19, NULL},
|
|
|
|
|
{ 0, "Region to Loop|Ctrl E 9", 20, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ -1, "", 0, do_view3d_select_meshmenu}};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static TBitem tb_curve_select[]= {
|
|
|
|
|
{ 0, "Border Select|B", 0, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "(De)select All|A", 2, NULL},
|
|
|
|
|
{ 0, "Inverse", 3, NULL},
|
2007-06-14 14:36:27 +00:00
|
|
|
{ 0, "Random...", 13, NULL},
|
|
|
|
|
{ 0, "Every Nth", 14, NULL},
|
|
|
|
|
{ 0, "Row|Shift R", 5, NULL}, /* shouldn't be visible in case of bezier curves*/
|
2006-11-06 18:20:56 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "(De)select First", 7, NULL},
|
|
|
|
|
{ 0, "(De)select Last", 8, NULL},
|
|
|
|
|
{ 0, "Select Next", 11, NULL},
|
|
|
|
|
{ 0, "Select Previous", 12, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "More|Ctrl NumPad +", 9, NULL},
|
|
|
|
|
{ 0, "Less|Ctrl NumPad -", 10, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ -1, "", 0, do_view3d_select_curvemenu}};
|
|
|
|
|
|
2007-06-08 14:17:13 +00:00
|
|
|
static TBitem tb_mball_select[]= {
|
|
|
|
|
{ 0, "Border Select|B", 0, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "(De)select All|A", 2, NULL},
|
|
|
|
|
{ 0, "Inverse", 3, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Random...", 4, NULL},
|
|
|
|
|
{ -1, "", 0, do_view3d_select_metaballmenu}};
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
static TBitem tb__select[]= {
|
2005-10-05 13:08:07 +00:00
|
|
|
{ 0, "Border Select|B", 'b', NULL},
|
|
|
|
|
{ 0, "(De)select All|A", 'a', NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
2003-10-29 00:23:16 +00:00
|
|
|
|
|
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
/* *************Edit ********** */
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
static TBitem tb_edit[]= {
|
|
|
|
|
{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_curve_edit_seg[]= {
|
2004-05-20 12:27:21 +00:00
|
|
|
{ 0, "Subdivide|W, 1", 0, NULL},
|
|
|
|
|
{ 0, "Switch Direction|W, 2", 1, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ -1, "", 0, do_view3d_edit_curve_segmentsmenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_curve_edit_cv[]= {
|
|
|
|
|
{ 0, "Tilt|T", 't', NULL},
|
|
|
|
|
{ 0, "Clear Tilt|Alt T", TB_ALT|'t', NULL},
|
2005-01-10 18:17:41 +00:00
|
|
|
{ 0, "Separate|P", 'p', NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Automatic|Shift H", 'H', NULL},
|
|
|
|
|
{ 0, "Toggle Free/Aligned|H", 'h', NULL},
|
2005-06-02 10:12:13 +00:00
|
|
|
{ 0, "Vector|V", 'v', NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Make Vertex Parent|Ctrl P", TB_CTRL|'p', NULL},
|
2004-11-09 23:05:06 +00:00
|
|
|
{ 0, "Add Hook|Ctrl H", TB_CTRL|'h', NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static TBitem tb_curve_edit[]= {
|
|
|
|
|
{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "Extrude|E", 'e', NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Duplicate|Shift D", 'D', NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "Make Segment|F", 'f', NULL},
|
2004-11-17 17:15:36 +00:00
|
|
|
{ 0, "Toggle Cyclic|C", 'c', NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Delete...|X", 'x', NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Control Points", 0, tb_curve_edit_cv},
|
|
|
|
|
{ 0, "Segments", 0, tb_curve_edit_seg},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static TBitem tb_mesh_edit_vertex[]= {
|
|
|
|
|
{ 0, "Merge...|Alt M", 5, NULL},
|
2005-11-05 18:40:07 +00:00
|
|
|
{ 0, "Rip|V", 7, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "Split|Y", 4, NULL},
|
|
|
|
|
{ 0, "Separate|P", 3, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2006-02-11 12:07:55 +00:00
|
|
|
{ 0, "Smooth|W, Alt 1", 2, NULL},
|
2007-05-16 05:03:33 +00:00
|
|
|
{ 0, "Remove Doubles|W, 6", 1, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "Make Vertex Parent|Ctrl P", 0, NULL},
|
2004-11-09 23:05:06 +00:00
|
|
|
{ 0, "Add Hook|Ctrl H", 6, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ -1, "", 0, do_view3d_edit_mesh_verticesmenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_mesh_edit_edge[]= {
|
|
|
|
|
{ 0, "Make Edge/Face|F", 5, NULL},
|
2006-05-29 05:17:38 +00:00
|
|
|
{ 0, "Collapse|Alt M", 14, NULL},
|
2004-04-20 10:46:28 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2006-02-11 12:07:55 +00:00
|
|
|
{ 0, "Bevel|W, Alt 2", 6, NULL},
|
2003-10-30 10:56:06 +00:00
|
|
|
{ 0, "Loop Subdivide|Ctrl R", 4, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "Knife Subdivide...|Shift K", 3, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-04-20 10:46:28 +00:00
|
|
|
{ 0, "Subdivide|W, 1", 2, NULL},
|
|
|
|
|
{ 0, "Subdivide Fractal|W, 2", 1, NULL},
|
|
|
|
|
{ 0, "Subdivide Smooth|W, 3", 0, NULL},
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Mark Seam|Ctrl E", 7, NULL},
|
|
|
|
|
{ 0, "Clear Seam|Ctrl E", 8, NULL},
|
2004-07-21 01:44:27 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Crease SubSurf|Shift E", 9, NULL},
|
2004-08-20 21:22:47 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2005-07-13 15:20:40 +00:00
|
|
|
{ 0, "Rotate Edge CW|Ctrl E", 10, NULL},
|
|
|
|
|
{ 0, "Rotate Edge CCW|Ctrl E", 11, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2005-11-05 18:40:07 +00:00
|
|
|
{ 0, "Slide Edge|Ctrl E", 12, NULL},
|
|
|
|
|
{ 0, "Delete Edge Loop|X", 13, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ -1, "", 0, do_view3d_edit_mesh_edgesmenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_mesh_edit_face[]= {
|
2005-09-28 11:55:43 +00:00
|
|
|
{ 0, "Make Edge/Face|F", 5, NULL},
|
|
|
|
|
{ 0, "Fill|Shift F", 0, NULL},
|
|
|
|
|
{ 0, "Beautify Fill|Alt F", 1, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2005-09-28 11:55:43 +00:00
|
|
|
{ 0, "Convert to Triangles|Ctrl T", 2, NULL},
|
|
|
|
|
{ 0, "Convert to Quads|Alt J", 3, NULL},
|
2007-09-14 06:46:57 +00:00
|
|
|
{ 0, "Flip Triangle Edges|Ctrl Shift F", 4, NULL},
|
|
|
|
|
{ 0, "Set Smooth|Ctrl F, 3", 6, NULL},
|
|
|
|
|
{ 0, "Set Solid|Ctrl F, 4", 7, NULL},
|
2005-09-28 11:55:43 +00:00
|
|
|
{ -1, "", 0, do_view3d_edit_mesh_facesmenu}};
|
2003-10-29 00:23:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
static TBitem tb_mesh_edit_normal[]= {
|
2004-05-20 12:27:21 +00:00
|
|
|
{ 0, "Recalculate Outside|Ctrl N", 2, NULL},
|
|
|
|
|
{ 0, "Recalculate Inside|Ctrl Shift N", 1, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2007-09-14 06:46:57 +00:00
|
|
|
{ 0, "Flip|Ctrl F, 1", 0, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ -1, "", 0, do_view3d_edit_mesh_normalsmenu}};
|
|
|
|
|
|
2003-10-25 22:29:24 +00:00
|
|
|
static TBitem tb_mesh_edit[]= {
|
|
|
|
|
{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
|
2007-09-14 06:46:57 +00:00
|
|
|
{ 0, "Undo|Ctrl Z", 'u', NULL},
|
|
|
|
|
{ 0, "Redo|Ctrl Shift Z", 'U', NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Extrude|E", 'e', NULL},
|
|
|
|
|
{ 0, "Duplicate|Shift D", 'D', NULL},
|
|
|
|
|
{ 0, "Delete...|X", 'x', NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "Vertices", 0, tb_mesh_edit_vertex},
|
|
|
|
|
{ 0, "Edges", 0, tb_mesh_edit_edge},
|
|
|
|
|
{ 0, "Faces", 0, tb_mesh_edit_face},
|
|
|
|
|
{ 0, "Normals", 0, tb_mesh_edit_normal},
|
2003-10-25 22:29:24 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static TBitem tb_object_ipo[]= {
|
|
|
|
|
{ 0, "Show/Hide", 'k', NULL},
|
|
|
|
|
{ 0, "Select Next", TB_PAD|'u', NULL},
|
|
|
|
|
{ 0, "Select Prev", TB_PAD|'d', NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
static TBitem tb_object_edit[]= {
|
|
|
|
|
{ 0, "Enter Editmode|Tab", TB_TAB, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Duplicate|Shift D", 'D', NULL},
|
|
|
|
|
{ 0, "Duplicate Linked|Alt D", TB_ALT|'d', NULL},
|
|
|
|
|
{ 0, "Delete|X", 'x', NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Object Keys", 0, tb_object_ipo},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
/* ************* Type ********** */
|
|
|
|
|
|
2004-01-12 13:30:00 +00:00
|
|
|
static TBitem tb_obdata_hide[]= {
|
|
|
|
|
{ 0, "Show Hidden|Alt H", TB_ALT|'h', NULL},
|
|
|
|
|
{ 0, "Hide Selected|H", 'h', NULL},
|
|
|
|
|
{ 0, "Hide Deselected|Shift H", 'H', NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
static void tb_do_mesh(void *arg, int event){
|
|
|
|
|
switch(event) {
|
2004-01-12 13:30:00 +00:00
|
|
|
case 1: common_insertkey(); break;
|
|
|
|
|
case 2: G.f ^= G_DRAWEDGES; break;
|
|
|
|
|
case 3: G.f ^= G_DRAWFACES; break;
|
|
|
|
|
case 4: G.f ^= G_DRAWNORMALS; break;
|
2006-11-14 18:13:34 +00:00
|
|
|
case 5: flip_subdivison(-1); break;
|
2003-10-29 00:23:16 +00:00
|
|
|
}
|
|
|
|
|
addqueue(curarea->win, REDRAW, 1);
|
|
|
|
|
}
|
2003-10-25 22:29:24 +00:00
|
|
|
|
|
|
|
|
static TBitem tb_mesh[]= {
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Insert Keyframe|I", 1, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Show/Hide Edges", 2, NULL},
|
|
|
|
|
{ 0, "Show/Hide Faces", 3, NULL},
|
|
|
|
|
{ 0, "Show/Hide Normals", 4, NULL},
|
2004-05-11 21:40:39 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-11-26 20:20:42 +00:00
|
|
|
{ 0, "Subdivision Surface", 5, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Show/Hide Vertices", 0, tb_obdata_hide},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ -1, "", 0, tb_do_mesh}};
|
|
|
|
|
|
2004-01-12 13:30:00 +00:00
|
|
|
static TBitem tb_curve_hide[]= {
|
|
|
|
|
{ 0, "Show Hidden|Alt H", 10, NULL},
|
2007-05-10 05:44:44 +00:00
|
|
|
{ 0, "Hide Selected|Alt Ctrl H", 11, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ -1, "", 0, do_view3d_edit_curve_showhidemenu}};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static TBitem tb_curve[]= {
|
|
|
|
|
{ 0, "Insert Keyframe|I", 'i', NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2005-06-02 10:12:13 +00:00
|
|
|
{ 0, "Show/Hide Points", 0, tb_curve_hide},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
static TBitem tb_obdata[]= {
|
2003-10-25 22:29:24 +00:00
|
|
|
{ 0, "Duplicate|Shift D", 'D', NULL},
|
|
|
|
|
{ 0, "Delete|X", 'x', NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
2003-10-25 22:29:24 +00:00
|
|
|
|
2004-01-12 13:30:00 +00:00
|
|
|
static TBitem tb_object_parent[]= {
|
|
|
|
|
{ 0, "Make Parent...|Ctrl P", TB_CTRL|'p', NULL},
|
|
|
|
|
{ 0, "Clear Parent...|Alt P", TB_ALT|'p', NULL},
|
2003-10-25 22:29:24 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
2004-01-12 13:30:00 +00:00
|
|
|
static TBitem tb_object_track[]= {
|
|
|
|
|
{ 0, "Make Track|Ctrl T", TB_CTRL|'t', NULL},
|
|
|
|
|
{ 0, "Clear Track|Alt T", TB_ALT|'t', NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
2003-10-25 22:29:24 +00:00
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
static TBitem tb_object[]= {
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Insert Keyframe|I", 'i', NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:48:26 +00:00
|
|
|
{ 0, "Make Links...|Ctrl L", TB_CTRL|'l', NULL},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ 0, "Make Single User...|U", 'u', NULL},
|
2004-01-12 13:48:26 +00:00
|
|
|
{ 0, "Copy Attributes...|Ctrl C", TB_CTRL|'c', NULL},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Parent", 0, tb_object_parent},
|
|
|
|
|
{ 0, "Track", 0, tb_object_track},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Boolean Operation|W", 'w', NULL},
|
|
|
|
|
{ 0, "Join Objects...|Ctrl J", TB_CTRL|'j', NULL},
|
|
|
|
|
{ 0, "Convert Object Type...|Alt C", TB_ALT|'c', NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ 0, "Move to Layer...|M", 'm', NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
|
2003-10-25 22:29:24 +00:00
|
|
|
/* *************VIEW ********** */
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
static void tb_do_view_dt(void *arg, int event){
|
|
|
|
|
G.vd->drawtype= event;
|
|
|
|
|
addqueue(curarea->win, REDRAW, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static TBitem tb_view_dt[]= {
|
2004-01-12 13:30:00 +00:00
|
|
|
{ ICON_BBOX, "Bounding Box", 1, NULL},
|
2004-05-20 12:27:21 +00:00
|
|
|
{ ICON_WIRE, "Wireframe|Z", 2, NULL},
|
|
|
|
|
{ ICON_SOLID, "Solid|Z", 3, NULL},
|
2005-09-18 11:20:05 +00:00
|
|
|
{ ICON_SMOOTH, "Shaded|Shift Z", 4, NULL},
|
2004-05-20 12:27:21 +00:00
|
|
|
{ ICON_POTATO, "Textured|Alt Z", 5, NULL},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ -1, "", 0, tb_do_view_dt}};
|
|
|
|
|
|
2004-01-12 13:30:00 +00:00
|
|
|
static TBitem tb_view_alignview[]= {
|
2007-04-03 08:20:17 +00:00
|
|
|
{ 0, "Center View to Cursor|C", 'c', NULL},
|
2004-10-19 21:29:15 +00:00
|
|
|
{ 0, "Align Active Camera to View|Ctrl Alt NumPad 0",
|
|
|
|
|
TB_CTRL|TB_ALT|TB_PAD|'0', NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Align View to Selected|NumPad *", TB_PAD|'*', NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
2003-10-25 22:29:24 +00:00
|
|
|
static TBitem tb_view[]= {
|
|
|
|
|
{ 0, "Viewport Shading", 0, tb_view_dt},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Ortho/Perspective|NumPad 5", TB_PAD|'5', NULL},
|
|
|
|
|
{ 0, "Local/Global View|NumPad /", TB_PAD|'/', NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Align View", 0, tb_view_alignview},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "View Selected|NumPad .", TB_PAD|'.', NULL},
|
|
|
|
|
{ 0, "View All|Home", TB_PAD|'h', NULL},
|
2003-10-25 22:29:24 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Play Back Animation|Alt A", TB_ALT|'a', NULL},
|
2004-05-04 16:25:35 +00:00
|
|
|
{ 0, "Camera Fly Mode|Shift F", TB_SHIFT|'f', NULL},
|
2003-10-25 22:29:24 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
/* *************TRANSFORM ********** */
|
|
|
|
|
|
2004-01-12 13:30:00 +00:00
|
|
|
static TBitem tb_transform_moveaxis[]= {
|
|
|
|
|
{ 0, "X Global|G, X", 0, NULL},
|
|
|
|
|
{ 0, "Y Global|G, Y", 1, NULL},
|
|
|
|
|
{ 0, "Z Global|G, Z", 2, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "X Local|G, X, X", 3, NULL},
|
|
|
|
|
{ 0, "Y Local|G, Y, Y", 4, NULL},
|
|
|
|
|
{ 0, "Z Local|G, Z, Z", 5, NULL},
|
2004-05-12 16:53:11 +00:00
|
|
|
{ -1, "", 0, do_view3d_transform_moveaxismenu}};
|
2004-01-12 13:30:00 +00:00
|
|
|
|
|
|
|
|
static TBitem tb_transform_rotateaxis[]= {
|
2004-02-05 17:26:37 +00:00
|
|
|
{ 0, "X Global|R, X", 0, NULL},
|
|
|
|
|
{ 0, "Y Global|R, Y", 1, NULL},
|
|
|
|
|
{ 0, "Z Global|R, Z", 2, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-02-05 17:26:37 +00:00
|
|
|
{ 0, "X Local|R, X, X", 3, NULL},
|
|
|
|
|
{ 0, "Y Local|R, Y, Y", 4, NULL},
|
|
|
|
|
{ 0, "Z Local|R, Z, Z", 5, NULL},
|
2004-05-12 16:53:11 +00:00
|
|
|
{ -1, "", 0, do_view3d_transform_rotateaxismenu}};
|
2004-01-12 13:30:00 +00:00
|
|
|
|
|
|
|
|
static TBitem tb_transform_scaleaxis[]= {
|
2004-02-05 17:26:37 +00:00
|
|
|
{ 0, "X Global|S, X", 0, NULL},
|
|
|
|
|
{ 0, "Y Global|S, Y", 1, NULL},
|
|
|
|
|
{ 0, "Z Global|S, Z", 2, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-02-05 17:26:37 +00:00
|
|
|
{ 0, "X Local|S, X, X", 3, NULL},
|
|
|
|
|
{ 0, "Y Local|S, Y, Y", 4, NULL},
|
|
|
|
|
{ 0, "Z Local|S, Z, Z", 5, NULL},
|
2004-05-12 16:53:11 +00:00
|
|
|
{ -1, "", 0, do_view3d_transform_scaleaxismenu}};
|
2004-01-12 13:30:00 +00:00
|
|
|
|
|
|
|
|
static void tb_do_transform_clearapply(void *arg, int event)
|
|
|
|
|
{
|
2004-06-05 06:52:14 +00:00
|
|
|
Object *ob;
|
|
|
|
|
ob= OBACT;
|
|
|
|
|
|
2004-01-12 13:30:00 +00:00
|
|
|
switch(event)
|
|
|
|
|
{
|
|
|
|
|
case 0: /* clear location */
|
|
|
|
|
clear_object('g');
|
|
|
|
|
break;
|
|
|
|
|
case 1: /* clear rotation */
|
|
|
|
|
clear_object('r');
|
|
|
|
|
break;
|
2006-06-12 20:01:18 +00:00
|
|
|
case 2: /* clear scale */
|
2004-01-12 13:30:00 +00:00
|
|
|
clear_object('s');
|
|
|
|
|
break;
|
2006-06-12 20:01:18 +00:00
|
|
|
case 3: /* apply scale/rotation */
|
2007-12-28 17:10:55 +00:00
|
|
|
apply_objects_locrot();
|
2004-01-12 13:30:00 +00:00
|
|
|
break;
|
2007-12-28 17:10:55 +00:00
|
|
|
case 4: /* apply scale/rotation */
|
|
|
|
|
apply_objects_visual_tx();
|
|
|
|
|
break;
|
|
|
|
|
case 5: /* apply deformation */
|
2004-09-28 16:18:22 +00:00
|
|
|
object_apply_deform(ob);
|
2004-06-05 06:52:14 +00:00
|
|
|
break;
|
2007-12-28 17:10:55 +00:00
|
|
|
case 6: /* make duplicates real */
|
2004-06-05 06:52:14 +00:00
|
|
|
if (ob->transflag & OB_DUPLI) make_duplilist_real();
|
|
|
|
|
else error("The active object does not have dupliverts");
|
2004-01-12 13:30:00 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static TBitem tb_transform_clearapply[]= {
|
2004-05-20 12:27:21 +00:00
|
|
|
{ 0, "Clear Location|Alt G", 0, NULL},
|
|
|
|
|
{ 0, "Clear Rotation|Alt R", 1, NULL},
|
2006-06-12 20:01:18 +00:00
|
|
|
{ 0, "Clear Scale|Alt S", 2, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2007-12-28 17:10:55 +00:00
|
|
|
{ 0, "Apply Scale/Rotation to ObData|Ctrl A, 1", 3, NULL},
|
|
|
|
|
{ 0, "Apply Visual Transform|Ctrl A, 2", 4, NULL},
|
|
|
|
|
{ 0, "Apply Deformation|Shift Ctrl A", 5, NULL},
|
|
|
|
|
{ 0, "Make Duplicates Real|Shift Ctrl A", 6, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ -1, "", 0, tb_do_transform_clearapply}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_transform_snap[]= {
|
|
|
|
|
{ 0, "Selection -> Grid|Shift S, 1", 1, NULL},
|
|
|
|
|
{ 0, "Selection -> Cursor|Shift S, 2", 2, NULL},
|
2008-03-08 21:57:15 +00:00
|
|
|
{ 0, "Selection -> Center|Shift S, 3", 3, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Cursor -> Selection|Shift S, 4", 4, NULL},
|
2008-03-08 21:57:15 +00:00
|
|
|
{ 0, "Cursor -> Grid|Shift S, 5", 5, NULL},
|
|
|
|
|
{ 0, "Cursor -> Active|Shift S, 6", 6, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ -1, "", 0, do_view3d_edit_snapmenu}};
|
|
|
|
|
|
|
|
|
|
static void tb_do_transform(void *arg, int event)
|
|
|
|
|
{
|
|
|
|
|
switch(event)
|
|
|
|
|
{
|
|
|
|
|
case 0: /* Grab/move */
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_TRANSLATION, CTX_NONE);
|
|
|
|
|
Transform();
|
2004-01-12 13:30:00 +00:00
|
|
|
break;
|
|
|
|
|
case 1: /* Rotate */
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_ROTATION, CTX_NONE);
|
|
|
|
|
Transform();
|
2004-01-12 13:30:00 +00:00
|
|
|
break;
|
|
|
|
|
case 2: /* Scale */
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_RESIZE,CTX_NONE);
|
|
|
|
|
Transform();
|
2004-01-12 13:30:00 +00:00
|
|
|
break;
|
|
|
|
|
case 3: /* transform properties */
|
2004-09-24 11:45:42 +00:00
|
|
|
add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
|
2004-01-12 13:30:00 +00:00
|
|
|
break;
|
|
|
|
|
case 4: /* snap */
|
|
|
|
|
snapmenu();
|
|
|
|
|
break;
|
2004-09-24 11:45:42 +00:00
|
|
|
case 5: /* Shrink/Fatten Along Normals */
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_SHRINKFATTEN, CTX_NONE);
|
|
|
|
|
Transform();
|
2004-09-24 11:45:42 +00:00
|
|
|
break;
|
|
|
|
|
case 6: /* Shear */
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_SHEAR, CTX_NONE);
|
|
|
|
|
Transform();
|
2004-09-24 11:45:42 +00:00
|
|
|
break;
|
|
|
|
|
case 7: /* Warp */
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_WARP, CTX_NONE);
|
|
|
|
|
Transform();
|
2004-09-24 11:45:42 +00:00
|
|
|
break;
|
|
|
|
|
case 8: /* proportional edit (toggle) */
|
2005-05-03 10:54:42 +00:00
|
|
|
if(G.scene->proportional) G.scene->proportional= 0;
|
|
|
|
|
else G.scene->proportional= 1;
|
2004-09-24 11:45:42 +00:00
|
|
|
break;
|
2005-10-31 13:39:05 +00:00
|
|
|
case 10:
|
2007-04-04 13:18:41 +00:00
|
|
|
docenter(0);
|
2005-10-31 13:39:05 +00:00
|
|
|
break;
|
|
|
|
|
case 11:
|
2007-04-04 13:18:41 +00:00
|
|
|
docenter_new();
|
2005-10-31 13:39:05 +00:00
|
|
|
break;
|
|
|
|
|
case 12:
|
2007-04-04 13:18:41 +00:00
|
|
|
docenter_cursor();
|
2005-10-31 13:39:05 +00:00
|
|
|
break;
|
2004-01-12 13:30:00 +00:00
|
|
|
}
|
2004-09-24 11:45:42 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
2004-01-12 13:30:00 +00:00
|
|
|
}
|
|
|
|
|
|
2004-04-24 21:09:06 +00:00
|
|
|
static TBitem tb_transform_object_mirror[]= {
|
2004-04-24 21:59:34 +00:00
|
|
|
{ 0, "X Local|Ctrl M, 1", 1, NULL},
|
|
|
|
|
{ 0, "Y Local|Ctrl M, 2", 2, NULL},
|
|
|
|
|
{ 0, "Z Local|Ctrl M, 3", 3, NULL},
|
2004-04-24 21:09:06 +00:00
|
|
|
{ -1, "", 0, do_view3d_object_mirrormenu}};
|
|
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
static TBitem tb_transform[]= {
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Grab/Move|G", 0, NULL},
|
|
|
|
|
{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
|
|
|
|
|
{ 0, "Rotate|R", 1, NULL},
|
|
|
|
|
{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
|
|
|
|
|
{ 0, "Scale|S", 2, NULL},
|
|
|
|
|
{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2005-10-31 13:39:05 +00:00
|
|
|
{ 0, "ObData to Center", 10, NULL},
|
|
|
|
|
{ 0, "Center New", 11, NULL},
|
|
|
|
|
{ 0, "Center Cursor", 12, NULL},
|
2004-04-24 21:09:06 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ ICON_MENU_PANEL, "Properties|N", 3, NULL},
|
2005-10-31 13:39:05 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Mirror", 0, tb_transform_object_mirror},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Snap", 0, tb_transform_snap},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Clear/Apply", 0, tb_transform_clearapply},
|
|
|
|
|
{ -1, "", 0, tb_do_transform}};
|
|
|
|
|
|
2004-04-24 21:09:06 +00:00
|
|
|
static TBitem tb_transform_edit_mirror[]= {
|
2004-04-24 21:59:34 +00:00
|
|
|
{ 0, "X Global|Ctrl M, 1", 1, NULL},
|
|
|
|
|
{ 0, "Y Global|Ctrl M, 2", 2, NULL},
|
|
|
|
|
{ 0, "Z Global|Ctrl M, 3", 3, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-04-24 21:59:34 +00:00
|
|
|
{ 0, "X Local|Ctrl M, 4", 4, NULL},
|
|
|
|
|
{ 0, "Y Local|Ctrl M, 5", 5, NULL},
|
|
|
|
|
{ 0, "Z Local|Ctrl M, 6", 6, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-04-24 21:59:34 +00:00
|
|
|
{ 0, "X View|Ctrl M, 7", 7, NULL},
|
|
|
|
|
{ 0, "Y View|Ctrl M, 8", 8, NULL},
|
|
|
|
|
{ 0, "Z View|Ctrl M, 9", 9, NULL},
|
2004-04-24 21:09:06 +00:00
|
|
|
{ -1, "", 0, do_view3d_edit_mirrormenu}};
|
2003-10-29 00:23:16 +00:00
|
|
|
|
|
|
|
|
static TBitem tb_transform_editmode1[]= {
|
2004-09-24 11:45:42 +00:00
|
|
|
{ 0, "Grab/Move|G", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
|
2004-09-24 11:45:42 +00:00
|
|
|
{ 0, "Rotate|R", 1, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
|
2004-09-24 11:45:42 +00:00
|
|
|
{ 0, "Scale|S", 2, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-09-24 11:45:42 +00:00
|
|
|
{ 0, "Shrink/Fatten|Alt S", 5, NULL},
|
|
|
|
|
{ 0, "Shear|Ctrl S", 6, NULL},
|
|
|
|
|
{ 0, "Warp|Shift W", 7, NULL},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2005-10-31 13:39:05 +00:00
|
|
|
{ 0, "ObData to Center", 10, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-09-24 11:45:42 +00:00
|
|
|
{ ICON_MENU_PANEL, "Properties|N", 3, NULL},
|
2005-10-31 13:39:05 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Mirror", 0, tb_transform_edit_mirror},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Snap", 0, tb_transform_snap},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-09-24 11:45:42 +00:00
|
|
|
{ 0, "Proportional Edit|O", 8, NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_transform}};
|
2003-10-29 00:23:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
static TBitem tb_transform_editmode2[]= {
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Grab/Move|G", 0, NULL},
|
|
|
|
|
{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
|
|
|
|
|
{ 0, "Rotate|R", 1, NULL},
|
|
|
|
|
{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
|
|
|
|
|
{ 0, "Scale|S", 2, NULL},
|
|
|
|
|
{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
|
2003-10-29 00:23:16 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2004-09-24 11:45:42 +00:00
|
|
|
{ ICON_MENU_PANEL, "Properties|N", 3, NULL},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Snap", 0, tb_transform_snap},
|
2004-01-13 00:35:11 +00:00
|
|
|
{ -1, "", 0, tb_do_transform}};
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
/* *************ADD ********** */
|
|
|
|
|
|
|
|
|
|
static TBitem addmenu_curve[]= {
|
|
|
|
|
{ 0, "Bezier Curve", 0, NULL},
|
|
|
|
|
{ 0, "Bezier Circle", 1, NULL},
|
|
|
|
|
{ 0, "NURBS Curve", 2, NULL},
|
|
|
|
|
{ 0, "NURBS Circle", 3, NULL},
|
|
|
|
|
{ 0, "Path", 4, NULL},
|
|
|
|
|
{ -1, "", 0, do_info_add_curvemenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem addmenu_surf[]= {
|
|
|
|
|
{ 0, "NURBS Curve", 0, NULL},
|
|
|
|
|
{ 0, "NURBS Circle", 1, NULL},
|
|
|
|
|
{ 0, "NURBS Surface", 2, NULL},
|
|
|
|
|
{ 0, "NURBS Tube", 3, NULL},
|
|
|
|
|
{ 0, "NURBS Sphere", 4, NULL},
|
|
|
|
|
{ 0, "NURBS Donut", 5, NULL},
|
|
|
|
|
{ -1, "", 0, do_info_add_surfacemenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem addmenu_meta[]= {
|
|
|
|
|
{ 0, "Meta Ball", 0, NULL},
|
|
|
|
|
{ 0, "Meta Tube", 1, NULL},
|
|
|
|
|
{ 0, "Meta Plane", 2, NULL},
|
|
|
|
|
{ 0, "Meta Ellipsoid", 3, NULL},
|
|
|
|
|
{ 0, "Meta Cube", 4, NULL},
|
|
|
|
|
{ -1, "", 0, do_info_add_metamenu}};
|
|
|
|
|
|
2004-09-19 19:27:57 +00:00
|
|
|
static TBitem addmenu_lamp[]= {
|
|
|
|
|
{ 0, "Lamp", 0, NULL},
|
|
|
|
|
{ 0, "Sun", 1, NULL},
|
|
|
|
|
{ 0, "Spot", 2, NULL},
|
|
|
|
|
{ 0, "Hemi", 3, NULL},
|
|
|
|
|
{ 0, "Area", 4, NULL},
|
|
|
|
|
{ -1, "", 0, do_info_add_lampmenu}};
|
|
|
|
|
|
|
|
|
|
static TBitem addmenu_YF_lamp[]= {
|
|
|
|
|
{ 0, "Lamp", 0, NULL},
|
|
|
|
|
{ 0, "Sun", 1, NULL},
|
|
|
|
|
{ 0, "Spot", 2, NULL},
|
|
|
|
|
{ 0, "Hemi", 3, NULL},
|
|
|
|
|
{ 0, "Area", 4, NULL},
|
|
|
|
|
{ 0, "Photon", 5, NULL},
|
|
|
|
|
{ -1, "", 0, do_info_add_lampmenu}};
|
|
|
|
|
|
|
|
|
|
|
2003-11-06 16:35:15 +00:00
|
|
|
static TBitem addmenu_armature[]= {
|
2005-11-03 21:13:20 +00:00
|
|
|
{ 0, "Bone", 8, NULL},
|
2003-11-06 16:35:15 +00:00
|
|
|
{ -1, "", 0, do_info_addmenu}};
|
|
|
|
|
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
/* dynamic items */
|
2007-04-02 09:58:01 +00:00
|
|
|
#define TB_ADD_MESH 0
|
2006-01-26 21:18:02 +00:00
|
|
|
#define TB_ADD_GROUP 7
|
|
|
|
|
#define TB_ADD_LAMP 10
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
static TBitem tb_add[]= {
|
2007-04-02 09:58:01 +00:00
|
|
|
{ 0, "Mesh", 0, NULL},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ 0, "Curve", 1, addmenu_curve},
|
|
|
|
|
{ 0, "Surface", 2, addmenu_surf},
|
2004-01-12 13:30:00 +00:00
|
|
|
{ 0, "Meta", 3, addmenu_meta},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ 0, "Text", 4, NULL},
|
|
|
|
|
{ 0, "Empty", 5, NULL},
|
2006-01-26 21:18:02 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
{ 0, "Group", 10, NULL},
|
2003-10-28 18:43:55 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ 0, "Camera", 6, NULL},
|
2004-09-19 19:27:57 +00:00
|
|
|
{ 0, "Lamp", 7, addmenu_lamp},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Armature", 8, NULL},
|
|
|
|
|
{ 0, "Lattice", 9, NULL},
|
|
|
|
|
{ -1, "", 0, do_info_addmenu}};
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
static TBitem tb_empty[]= {
|
|
|
|
|
{ 0, "Nothing...", 0, NULL},
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
{ -1, "", 0, NULL}};
|
|
|
|
|
|
|
|
|
|
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
/* *************RENDER ********** */
|
|
|
|
|
|
|
|
|
|
static void tb_do_render(void *arg, int event){
|
|
|
|
|
switch(event)
|
|
|
|
|
{
|
|
|
|
|
case 1: /* set render border */
|
|
|
|
|
set_render_border();
|
|
|
|
|
break;
|
|
|
|
|
case 2: /* render */
|
|
|
|
|
BIF_do_render(0);
|
|
|
|
|
break;
|
|
|
|
|
case 3: /* render anim */
|
|
|
|
|
BIF_do_render(1);
|
|
|
|
|
break;
|
2006-07-11 09:07:19 +00:00
|
|
|
case 4: /* passepartout */
|
2006-07-12 14:51:30 +00:00
|
|
|
{
|
|
|
|
|
Camera *ca= NULL;
|
2006-07-11 09:07:19 +00:00
|
|
|
if(G.vd->camera==NULL) return;
|
|
|
|
|
|
|
|
|
|
if(G.vd->camera->type==OB_CAMERA)
|
|
|
|
|
ca= G.vd->camera->data;
|
|
|
|
|
else return;
|
|
|
|
|
|
|
|
|
|
if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT))
|
|
|
|
|
ca->flag &= ~CAM_SHOWPASSEPARTOUT;
|
|
|
|
|
else
|
|
|
|
|
ca->flag |= CAM_SHOWPASSEPARTOUT;
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
2006-07-12 14:51:30 +00:00
|
|
|
}
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
break;
|
2006-07-11 09:07:19 +00:00
|
|
|
case 5: /*preview render */
|
|
|
|
|
toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0);
|
|
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
break;
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static TBitem tb_render[]= {
|
|
|
|
|
{ 0, "Passepartout", 4, NULL},
|
2006-07-11 09:07:19 +00:00
|
|
|
{ 0, "Set Border|Shift B", 1, NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
{ 0, "Render|F12", 2, NULL},
|
2006-07-11 09:07:19 +00:00
|
|
|
{ 0, "Anim|Ctrl F12", 3, NULL},
|
|
|
|
|
{ 0, "Preview|Shift P", 5, NULL},
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
{ -1, "", 0, tb_do_render}};
|
|
|
|
|
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
/* ************************* NODES *********************** */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* dynamic items */
|
|
|
|
|
|
|
|
|
|
static TBitem tb_node_addsh[]= {
|
2006-11-24 22:12:24 +00:00
|
|
|
{ 0, "Input", 1, NULL},
|
2006-06-16 04:32:39 +00:00
|
|
|
{ 0, "Output", 2, NULL},
|
2006-11-24 22:12:24 +00:00
|
|
|
{ 0, "Color", 3, NULL},
|
2006-06-16 04:32:39 +00:00
|
|
|
{ 0, "Vector", 4, NULL},
|
2006-12-31 00:28:46 +00:00
|
|
|
{ 0, "Convertor", 5, NULL},
|
|
|
|
|
{ 0, "Group", 6, NULL},
|
2008-02-09 23:17:15 +00:00
|
|
|
{ 0, "Dynamic", 7, NULL},
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
{ -1, "", 0, NULL}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_node_addcomp[]= {
|
2006-11-24 22:12:24 +00:00
|
|
|
{ 0, "Input", 1, NULL},
|
2006-06-16 04:32:39 +00:00
|
|
|
{ 0, "Output", 2, NULL},
|
2006-11-24 22:12:24 +00:00
|
|
|
{ 0, "Color", 3, NULL},
|
2006-06-16 04:32:39 +00:00
|
|
|
{ 0, "Vector", 4, NULL},
|
2006-12-31 00:28:46 +00:00
|
|
|
{ 0, "Filter", 5, NULL},
|
|
|
|
|
{ 0, "Convertor", 6, NULL},
|
|
|
|
|
{ 0, "Matte", 7, NULL},
|
|
|
|
|
{ 0, "Distort", 8, NULL},
|
|
|
|
|
{ 0, "Group", 9, NULL},
|
2008-02-09 23:17:15 +00:00
|
|
|
{ 0, "Dynamic", 10, NULL},
|
2006-11-19 19:17:32 +00:00
|
|
|
{ -1, "", 0, NULL}};
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
|
2006-06-16 04:32:39 +00:00
|
|
|
/* do_node_addmenu() in header_node.c, prototype in BSE_headerbuttons.h */
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
|
|
|
|
|
/* dynamic toolbox sublevel */
|
2006-11-24 22:12:24 +00:00
|
|
|
static TBitem *node_add_sublevel(ListBase *storage, bNodeTree *ntree, int nodeclass)
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
{
|
2006-12-31 00:28:46 +00:00
|
|
|
static TBitem _addmenu[]= { { 0, " ", 0, NULL}, { -1, "", 0, NULL}};
|
2006-11-24 22:12:24 +00:00
|
|
|
Link *link;
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
TBitem *addmenu;
|
|
|
|
|
int tot= 0, a;
|
|
|
|
|
|
|
|
|
|
if(ntree) {
|
|
|
|
|
if(nodeclass==NODE_CLASS_GROUP) {
|
|
|
|
|
bNodeTree *ngroup= G.main->nodetree.first;
|
|
|
|
|
for(; ngroup; ngroup= ngroup->id.next)
|
|
|
|
|
if(ngroup->type==ntree->type)
|
|
|
|
|
tot++;
|
|
|
|
|
}
|
|
|
|
|
else {
|
2007-03-26 15:07:38 +00:00
|
|
|
bNodeType *ntype = ntree->alltypes.first;
|
|
|
|
|
while(ntype) {
|
|
|
|
|
if(ntype->nclass == nodeclass) {
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
tot++;
|
2007-03-26 15:07:38 +00:00
|
|
|
}
|
|
|
|
|
ntype= ntype->next;
|
|
|
|
|
}
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(tot==0) {
|
2006-11-24 22:12:24 +00:00
|
|
|
return _addmenu;
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(tot+1), "types menu");
|
|
|
|
|
BLI_addtail(storage, link);
|
|
|
|
|
addmenu= (TBitem *)(link+1);
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
|
|
|
|
|
if(nodeclass==NODE_CLASS_GROUP) {
|
|
|
|
|
bNodeTree *ngroup= G.main->nodetree.first;
|
|
|
|
|
for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) {
|
|
|
|
|
if(ngroup->type==ntree->type) {
|
|
|
|
|
addmenu[a].name= ngroup->id.name+2;
|
|
|
|
|
addmenu[a].retval= NODE_GROUP_MENU+tot; /* so we can use BLI_findlink() */
|
|
|
|
|
a++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
2008-02-09 23:17:15 +00:00
|
|
|
bNodeType *type= ntree->alltypes.first;
|
|
|
|
|
int script=0;
|
|
|
|
|
for(a=0; type; type= type->next) {
|
|
|
|
|
if( type->nclass == nodeclass ) {
|
|
|
|
|
if(type->type == NODE_DYNAMIC) {
|
|
|
|
|
if(type->id)
|
|
|
|
|
addmenu[a].name= type->id->name+2;
|
|
|
|
|
else
|
|
|
|
|
addmenu[a].name= type->name;
|
|
|
|
|
addmenu[a].retval= NODE_DYNAMIC_MENU+script;
|
|
|
|
|
script++;
|
|
|
|
|
} else {
|
|
|
|
|
addmenu[a].name= type->name;
|
|
|
|
|
addmenu[a].retval= type->type;
|
|
|
|
|
}
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
a++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-03-26 15:07:38 +00:00
|
|
|
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
addmenu[a].icon= -1; /* end signal */
|
|
|
|
|
addmenu[a].name= "";
|
|
|
|
|
addmenu[a].retval= a;
|
|
|
|
|
addmenu[a].poin= do_node_addmenu;
|
|
|
|
|
|
|
|
|
|
return addmenu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-06-16 04:32:39 +00:00
|
|
|
static TBitem tb_node_node[]= {
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
{ 0, "Duplicate|Shift D", TB_SHIFT|'d', NULL},
|
|
|
|
|
{ 0, "Delete|X", 'x', NULL},
|
|
|
|
|
{ 0, "SEPR", 0, NULL},
|
2008-01-07 12:55:37 +00:00
|
|
|
{ 0, "Make Link|F", 'f', NULL},
|
2007-12-27 10:17:33 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
{ 0, "Make Group|Ctrl G", TB_CTRL|'g', NULL},
|
|
|
|
|
{ 0, "Ungroup|Alt G", TB_ALT|'g', NULL},
|
2006-06-16 04:32:39 +00:00
|
|
|
{ 0, "Edit Group|Tab", TB_TAB, NULL},
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
|
|
|
|
{ 0, "Hide/Unhide|H", 'h', NULL},
|
2008-01-07 19:38:01 +00:00
|
|
|
{ 0, "Rename|Ctrl R", TB_CTRL|'r', NULL},
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
{ 0, "SEPR", 0, NULL},
|
2006-06-16 04:32:39 +00:00
|
|
|
{ 0, "Read Saved Render Results|R", 'r', NULL},
|
|
|
|
|
{ 0, "Show Cyclic Dependencies|C", 'c', NULL},
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_node_select[]= {
|
|
|
|
|
{ 0, "Select/Deselect All|A", 'a', NULL},
|
|
|
|
|
{ 0, "Border Select|B", 'b', NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_node_transform[]= {
|
|
|
|
|
{ 0, "Grab/Move|G", 'g', NULL},
|
|
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
static TBitem tb_node_view[]= {
|
2006-06-16 04:32:39 +00:00
|
|
|
{ 0, "Zoom In|NumPad +", TB_PAD|'+', NULL},
|
|
|
|
|
{ 0, "Zoom Out|NumPad -", TB_PAD|'-', NULL},
|
|
|
|
|
{ 0, "View All|Home", TB_PAD|'h', NULL},
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
{ -1, "", 0, tb_do_hotkey}};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *********************************************** */
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
static uiBlock *tb_makemenu(void *arg)
|
|
|
|
|
{
|
|
|
|
|
static int counter=0;
|
|
|
|
|
TBitem *item= arg, *itemt;
|
|
|
|
|
uiBlock *block;
|
2006-11-24 22:12:24 +00:00
|
|
|
int xco= 0, yco= 0;
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
char str[10];
|
|
|
|
|
|
|
|
|
|
if(arg==NULL) return NULL;
|
|
|
|
|
|
2004-10-03 13:49:54 +00:00
|
|
|
sprintf(str, "tb %d", counter++);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
block= uiNewBlock(&tb_listb, str, UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
|
|
|
|
|
uiBlockSetCol(block, TH_MENU_ITEM);
|
|
|
|
|
|
|
|
|
|
// last item has do_menu func, has to be stored in each button
|
|
|
|
|
itemt= item;
|
|
|
|
|
while(itemt->icon != -1) itemt++;
|
|
|
|
|
uiBlockSetButmFunc(block, itemt->poin, NULL);
|
|
|
|
|
|
|
|
|
|
// now make the buttons
|
|
|
|
|
while(item->icon != -1) {
|
|
|
|
|
|
|
|
|
|
if(strcmp(item->name, "SEPR")==0) {
|
2006-11-24 22:12:24 +00:00
|
|
|
uiDefBut(block, SEPR, 0, "", xco, yco-=6, 50, 6, NULL, 0.0, 0.0, 0, 0, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
|
|
|
|
else if(item->icon) {
|
2006-11-24 22:12:24 +00:00
|
|
|
uiDefIconTextBut(block, BUTM, 1, item->icon, item->name, xco, yco-=20, 80, 19, NULL, 0.0, 0.0, 0, item->retval, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
|
|
|
|
else if(item->poin) {
|
2004-01-12 13:30:00 +00:00
|
|
|
uiDefIconTextBlockBut(block, tb_makemenu, item->poin, ICON_RIGHTARROW_THIN, item->name, 0, yco-=20, 80, 19, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2006-11-24 22:12:24 +00:00
|
|
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, item->name, xco, yco-=20, 80, 19, NULL, 0.0, 0.0, 0, item->retval, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
2006-11-24 22:12:24 +00:00
|
|
|
|
|
|
|
|
if(yco <= -600) {
|
|
|
|
|
yco = 0;
|
|
|
|
|
xco += 80;
|
|
|
|
|
}
|
|
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
item++;
|
|
|
|
|
}
|
2006-11-24 22:12:24 +00:00
|
|
|
|
2004-10-26 12:52:20 +00:00
|
|
|
uiTextBoundsBlock(block, 60);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
/* direction is also set in the function that calls this */
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
if(U.uiflag & USER_PLAINMENUS)
|
|
|
|
|
uiBlockSetDirection(block, UI_RIGHT);
|
|
|
|
|
else
|
2007-04-04 13:18:41 +00:00
|
|
|
uiBlockSetDirection(block, UI_RIGHT|UI_CENTER);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
static int tb_mainx= 1234, tb_mainy= 0;
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
static void store_main(void *arg1, void *arg2)
|
|
|
|
|
{
|
2007-04-29 10:49:02 +00:00
|
|
|
tb_mainx= (long)arg1;
|
|
|
|
|
tb_mainy= (long)arg2;
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
|
|
|
|
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
static void do_group_addmenu(void *arg, int event)
|
|
|
|
|
{
|
|
|
|
|
Object *ob;
|
|
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
if(event<0) return;
|
|
|
|
|
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
add_object_draw(OB_EMPTY);
|
|
|
|
|
ob= OBACT;
|
|
|
|
|
|
|
|
|
|
ob->dup_group= BLI_findlink(&G.main->group, event);
|
|
|
|
|
if(ob->dup_group) {
|
2008-01-15 19:00:09 +00:00
|
|
|
rename_id(&ob->id, ob->dup_group->id.name+2);
|
|
|
|
|
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
id_us_plus((ID *)ob->dup_group);
|
|
|
|
|
ob->transflag |= OB_DUPLIGROUP;
|
2005-12-11 18:01:09 +00:00
|
|
|
DAG_scene_sort(G.scene);
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
}
|
|
|
|
|
}
|
2006-11-24 19:59:47 +00:00
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
/* helper for create group menu */
|
2006-11-24 19:59:47 +00:00
|
|
|
static void tag_groups_for_toolbox(void)
|
|
|
|
|
{
|
|
|
|
|
Group *group;
|
|
|
|
|
GroupObject *go;
|
|
|
|
|
|
|
|
|
|
for(group= G.main->group.first; group; group= group->id.next)
|
|
|
|
|
group->id.flag |= LIB_DOIT;
|
|
|
|
|
|
|
|
|
|
for(group= G.main->group.first; group; group= group->id.next) {
|
|
|
|
|
if(group->id.flag & LIB_DOIT)
|
|
|
|
|
for(go= group->gobject.first; go; go= go->next)
|
|
|
|
|
if(go->ob && go->ob->dup_group)
|
|
|
|
|
go->ob->dup_group->id.flag &= ~LIB_DOIT;
|
|
|
|
|
}
|
2006-11-24 22:12:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* helper for create group menu */
|
2007-02-01 14:14:07 +00:00
|
|
|
/* note that group id.flag was set */
|
2006-11-24 22:12:24 +00:00
|
|
|
static int count_group_libs(void)
|
|
|
|
|
{
|
|
|
|
|
Group *group;
|
|
|
|
|
Library *lib;
|
|
|
|
|
int tot= 0;
|
2006-11-24 19:59:47 +00:00
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
for(lib= G.main->library.first; lib; lib= lib->id.next)
|
|
|
|
|
lib->id.flag |= LIB_DOIT;
|
|
|
|
|
|
|
|
|
|
for(group= G.main->group.first; group; group= group->id.next) {
|
2007-02-01 14:14:07 +00:00
|
|
|
if(group->id.flag & LIB_DOIT) {
|
|
|
|
|
if(group->id.lib && (group->id.lib->id.flag & LIB_DOIT)) {
|
|
|
|
|
group->id.lib->id.flag &= ~LIB_DOIT;
|
|
|
|
|
tot++;
|
|
|
|
|
}
|
2006-11-24 22:12:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tot;
|
2006-11-24 19:59:47 +00:00
|
|
|
}
|
2006-11-24 22:12:24 +00:00
|
|
|
|
|
|
|
|
/* dynamic toolbox sublevel */
|
|
|
|
|
static TBitem *create_group_sublevel(ListBase *storage, Library *lib)
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
{
|
|
|
|
|
static TBitem addmenu[]= { { 0, "No Groups", 0, NULL}, { -1, "", 0, NULL}};
|
2006-11-24 22:12:24 +00:00
|
|
|
Link *link;
|
2006-11-24 19:59:47 +00:00
|
|
|
TBitem *groupmenu, *gm;
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
Group *group;
|
|
|
|
|
int a;
|
|
|
|
|
int tot= BLI_countlist(&G.main->group);
|
|
|
|
|
|
|
|
|
|
if(tot==0) {
|
2006-11-24 22:12:24 +00:00
|
|
|
return addmenu;
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
/* build menu, we insert a Link before the array of TBitems */
|
|
|
|
|
link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(tot+1), "group menu lib");
|
|
|
|
|
BLI_addtail(storage, link);
|
|
|
|
|
gm= groupmenu= (TBitem *)(link+1);
|
|
|
|
|
for(a=0, group= G.main->group.first; group; group= group->id.next, a++) {
|
|
|
|
|
if(group->id.lib==lib && (group->id.flag & LIB_DOIT)) {
|
|
|
|
|
gm->name= group->id.name+2;
|
|
|
|
|
gm->retval= a;
|
|
|
|
|
gm++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gm->icon= -1; /* end signal */
|
|
|
|
|
gm->name= "";
|
|
|
|
|
gm->retval= a;
|
|
|
|
|
gm->poin= do_group_addmenu;
|
|
|
|
|
|
|
|
|
|
return groupmenu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static TBitem *create_group_all_sublevels(ListBase *storage)
|
|
|
|
|
{
|
|
|
|
|
Library *lib;
|
|
|
|
|
Group *group;
|
|
|
|
|
Link *link;
|
|
|
|
|
TBitem *groupmenu, *gm;
|
|
|
|
|
int a;
|
2007-02-01 14:14:07 +00:00
|
|
|
int totlevel= 0;
|
2006-11-24 22:12:24 +00:00
|
|
|
int totlocal= 0;
|
|
|
|
|
|
|
|
|
|
/* we add totlevel + local groups entries */
|
|
|
|
|
|
2006-11-24 19:59:47 +00:00
|
|
|
/* let's skip group-in-group */
|
|
|
|
|
tag_groups_for_toolbox();
|
|
|
|
|
|
2007-02-01 14:14:07 +00:00
|
|
|
/* this call checks for skipped group-in-groups */
|
|
|
|
|
totlevel= count_group_libs();
|
|
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
for(group= G.main->group.first; group; group= group->id.next)
|
|
|
|
|
if(group->id.flag & LIB_DOIT)
|
|
|
|
|
if(group->id.lib==NULL)
|
|
|
|
|
totlocal++;
|
|
|
|
|
|
|
|
|
|
if(totlocal+totlevel==0)
|
|
|
|
|
return create_group_sublevel(storage, NULL);
|
|
|
|
|
|
|
|
|
|
/* build menu, we insert a Link before the array of TBitems */
|
|
|
|
|
link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(totlocal+totlevel+1), "group menu");
|
|
|
|
|
BLI_addtail(storage, link);
|
|
|
|
|
gm= groupmenu= (TBitem *)(link+1);
|
|
|
|
|
|
|
|
|
|
/* first all levels. libs with groups are not tagged */
|
|
|
|
|
for(lib= G.main->library.first; lib; lib= lib->id.next) {
|
|
|
|
|
if(!(lib->id.flag & LIB_DOIT)) {
|
2006-11-28 10:16:24 +00:00
|
|
|
char *str;
|
|
|
|
|
/* do some tricks to get .blend file name without extension */
|
|
|
|
|
link= MEM_callocN(sizeof(Link) + 128, "string");
|
|
|
|
|
BLI_addtail(storage, link);
|
|
|
|
|
str= (char *)(link+1);
|
|
|
|
|
BLI_strncpy(str, BLI_last_slash(lib->filename)+1, 128);
|
|
|
|
|
if(strlen(str)>6) str[strlen(str)-6]= 0;
|
|
|
|
|
gm->name= str;
|
2006-11-24 22:12:24 +00:00
|
|
|
gm->retval= -1;
|
|
|
|
|
gm->poin= create_group_sublevel(storage, lib);
|
|
|
|
|
gm++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* remaining groups */
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
for(a=0, group= G.main->group.first; group; group= group->id.next, a++) {
|
2006-11-24 22:12:24 +00:00
|
|
|
if(group->id.lib==NULL && (group->id.flag & LIB_DOIT)) {
|
2006-11-24 19:59:47 +00:00
|
|
|
gm->name= group->id.name+2;
|
|
|
|
|
gm->retval= a;
|
|
|
|
|
gm++;
|
|
|
|
|
}
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
}
|
2006-11-24 19:59:47 +00:00
|
|
|
gm->icon= -1; /* end signal */
|
|
|
|
|
gm->name= "";
|
|
|
|
|
gm->retval= a;
|
|
|
|
|
gm->poin= do_group_addmenu;
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
|
|
|
|
|
return groupmenu;
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-02 09:58:01 +00:00
|
|
|
static TBitem *create_mesh_sublevel(ListBase *storage)
|
|
|
|
|
{
|
|
|
|
|
Link *link;
|
|
|
|
|
TBitem *meshmenu, *mm;
|
|
|
|
|
int totmenu= 10, totpymenu=0, a=0;
|
|
|
|
|
|
|
|
|
|
/* Python Menu */
|
|
|
|
|
BPyMenu *pym;
|
|
|
|
|
|
|
|
|
|
/* count the python menu items*/
|
|
|
|
|
for (pym = BPyMenuTable[PYMENU_ADDMESH]; pym; pym = pym->next, totpymenu++) {}
|
|
|
|
|
if (totpymenu) totmenu += totpymenu+1; /* add 1 for the seperator */
|
|
|
|
|
|
|
|
|
|
link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(totmenu+1), "mesh menu");
|
|
|
|
|
BLI_addtail(storage, link);
|
|
|
|
|
mm= meshmenu= (TBitem *)(link+1);
|
|
|
|
|
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "Plane"; mm++; a++;
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "Cube"; mm++; a++;
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "Circle"; mm++; a++;
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "UVsphere"; mm++; a++;
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "Icosphere"; mm++; a++;
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "Cylinder"; mm++; a++; a++;
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "Cone"; mm++; a++;
|
|
|
|
|
mm->icon = 0; mm->retval= 0; mm->name = "SEPR"; mm++;
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "Grid"; mm++; a++;
|
|
|
|
|
mm->icon = 0; mm->retval= a; mm->name = "Monkey"; mm++; a++;
|
|
|
|
|
/* a == 10 */
|
|
|
|
|
|
|
|
|
|
if (totpymenu) {
|
|
|
|
|
int i=0;
|
|
|
|
|
mm->icon = 0; mm->retval= 0; mm->name = "SEPR"; mm++;
|
|
|
|
|
|
|
|
|
|
/* note that we account for the 10 previous entries with i+4: */
|
|
|
|
|
for (pym = BPyMenuTable[PYMENU_ADDMESH]; pym; pym = pym->next, i++) {
|
2007-05-22 03:13:01 +00:00
|
|
|
mm->icon = ICON_PYTHON;
|
2007-04-02 09:58:01 +00:00
|
|
|
mm->retval= i+20;
|
|
|
|
|
mm->name = pym->name;
|
|
|
|
|
mm++; a++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* terminate the menu */
|
|
|
|
|
mm->icon= -1; mm->retval= a; mm->name= ""; mm->poin= do_info_add_meshmenu;
|
|
|
|
|
|
|
|
|
|
return meshmenu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
void toolbox_n(void)
|
|
|
|
|
{
|
|
|
|
|
uiBlock *block;
|
|
|
|
|
uiBut *but;
|
2006-11-24 22:12:24 +00:00
|
|
|
ListBase storage= {NULL, NULL};
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
TBitem *menu1=NULL, *menu2=NULL, *menu3=NULL;
|
|
|
|
|
TBitem *menu4=NULL, *menu5=NULL, *menu6=NULL;
|
2006-11-24 22:12:24 +00:00
|
|
|
TBitem *menu7=NULL;
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
int dx=0;
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
short event, mval[2], tot=0;
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
char *str1=NULL, *str2=NULL, *str3=NULL, *str4=NULL, *str5=NULL, *str6=NULL, *str7=NULL;
|
|
|
|
|
|
|
|
|
|
/* temporal too... when this flag is (was) saved, it should initialize OK */
|
|
|
|
|
if(tb_mainx==1234) {
|
|
|
|
|
if(U.uiflag & USER_PLAINMENUS) {
|
|
|
|
|
tb_mainx= -32;
|
|
|
|
|
tb_mainy= -5;
|
|
|
|
|
} else {
|
|
|
|
|
tb_mainx= 0;
|
|
|
|
|
tb_mainy= -5;
|
|
|
|
|
}
|
|
|
|
|
}
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2008-02-23 10:33:36 +00:00
|
|
|
/* save present mouse position */
|
|
|
|
|
toolbox_mousepos(mval, 1);
|
|
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
mywinset(G.curscreen->mainwin); // we go to screenspace
|
|
|
|
|
|
|
|
|
|
block= uiNewBlock(&tb_listb, "toolbox", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
|
|
|
|
|
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1);
|
|
|
|
|
uiBlockSetCol(block, TH_MENU_ITEM);
|
|
|
|
|
|
|
|
|
|
/* select context for main items */
|
|
|
|
|
if(curarea->spacetype==SPACE_VIEW3D) {
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
/* dynamic menu entries */
|
2006-11-24 22:12:24 +00:00
|
|
|
tb_add[TB_ADD_GROUP].poin= create_group_all_sublevels(&storage);
|
2007-04-02 09:58:01 +00:00
|
|
|
tb_add[TB_ADD_MESH].poin= create_mesh_sublevel(&storage);
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
/* static */
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
if (G.scene->r.renderer==R_YAFRAY)
|
|
|
|
|
tb_add[TB_ADD_LAMP].poin= addmenu_YF_lamp;
|
|
|
|
|
else
|
|
|
|
|
tb_add[TB_ADD_LAMP].poin= addmenu_lamp;
|
|
|
|
|
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
if(U.uiflag & USER_PLAINMENUS) {
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
menu1= tb_add; str1= "Add";
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
menu2= tb_object_edit; str2= "Edit";
|
|
|
|
|
menu3= tb_object_select; str3= "Select";
|
|
|
|
|
menu4= tb_transform; str4= "Transform";
|
|
|
|
|
menu5= tb_object; str5= "Object";
|
|
|
|
|
menu6= tb_view; str6= "View";
|
|
|
|
|
menu7= tb_render; str7= "Render";
|
|
|
|
|
|
|
|
|
|
dx= 96;
|
|
|
|
|
tot= 7;
|
2004-09-19 19:27:57 +00:00
|
|
|
} else {
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
/* 3x2 layout menu */
|
|
|
|
|
menu1= tb_object; str1= "Object";
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
menu2= tb_add; str2= "Add";
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
menu3= tb_object_select; str3= "Select";
|
|
|
|
|
menu4= tb_object_edit; str4= "Edit";
|
|
|
|
|
menu5= tb_transform; str5= "Transform";
|
|
|
|
|
menu6= tb_view; str6= "View";
|
|
|
|
|
|
|
|
|
|
dx= 64;
|
|
|
|
|
tot= 6;
|
2004-09-19 19:27:57 +00:00
|
|
|
}
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
if(G.obedit) {
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
if(U.uiflag & USER_PLAINMENUS) {
|
|
|
|
|
switch(G.obedit->type){
|
|
|
|
|
case OB_MESH:
|
2007-04-02 09:58:01 +00:00
|
|
|
menu1= create_mesh_sublevel(&storage);
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
menu2= tb_mesh_edit;
|
|
|
|
|
menu3= tb_mesh_select;
|
|
|
|
|
menu4= tb_transform_editmode1;
|
|
|
|
|
menu5= tb_mesh; str5= "Mesh";
|
|
|
|
|
break;
|
|
|
|
|
case OB_CURVE:
|
|
|
|
|
menu1= addmenu_curve;
|
|
|
|
|
menu2= tb_curve_edit;
|
|
|
|
|
menu3= tb_curve_select;
|
|
|
|
|
menu4= tb_transform_editmode1;
|
|
|
|
|
menu5= tb_curve; str5= "Curve";
|
|
|
|
|
break;
|
|
|
|
|
case OB_SURF:
|
|
|
|
|
menu1= addmenu_surf;
|
|
|
|
|
menu2= tb_curve_edit;
|
|
|
|
|
menu3= tb_curve_select;
|
|
|
|
|
menu4= tb_transform_editmode1;
|
|
|
|
|
menu5= tb_curve; str5= "Surface";
|
|
|
|
|
break;
|
|
|
|
|
case OB_MBALL:
|
|
|
|
|
menu1= addmenu_meta;
|
|
|
|
|
menu2= tb_edit;
|
2007-06-08 14:17:13 +00:00
|
|
|
menu3= tb_mball_select;
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
menu4= tb_transform_editmode2;
|
|
|
|
|
menu5= tb_obdata; str5= "Meta";
|
|
|
|
|
break;
|
|
|
|
|
case OB_ARMATURE:
|
|
|
|
|
menu1= addmenu_armature;
|
|
|
|
|
menu2= tb_edit;
|
|
|
|
|
menu3= tb__select;
|
|
|
|
|
menu4= tb_transform_editmode2;
|
|
|
|
|
menu5= tb_obdata;str5= "Armature";
|
|
|
|
|
break;
|
|
|
|
|
case OB_LATTICE:
|
|
|
|
|
menu1= tb_empty;
|
|
|
|
|
menu2= tb_edit;
|
|
|
|
|
menu3= tb__select;
|
|
|
|
|
menu4= tb_transform_editmode1;
|
|
|
|
|
menu5= tb_empty;str5= "Lattice";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if(G.obedit->type==OB_MESH) {
|
|
|
|
|
menu1= tb_mesh; str1= "Mesh";
|
2007-04-02 09:58:01 +00:00
|
|
|
menu2= create_mesh_sublevel(&storage);
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
menu3= tb_mesh_select;
|
|
|
|
|
menu4= tb_mesh_edit;
|
|
|
|
|
menu5= tb_transform_editmode1;
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit->type==OB_CURVE) {
|
|
|
|
|
menu1= tb_curve; str1= "Curve";
|
|
|
|
|
menu2= addmenu_curve;
|
|
|
|
|
menu3= tb_curve_select;
|
|
|
|
|
menu4= tb_curve_edit;
|
|
|
|
|
menu5= tb_transform_editmode1;
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit->type==OB_SURF) {
|
|
|
|
|
menu1= tb_curve; str1= "Surface";
|
|
|
|
|
menu2= addmenu_surf;
|
|
|
|
|
menu3= tb_curve_select;
|
|
|
|
|
menu4= tb_curve_edit;
|
|
|
|
|
menu5= tb_transform_editmode1;
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit->type==OB_MBALL) {
|
|
|
|
|
menu1= tb_obdata; str1= "Meta";
|
|
|
|
|
menu2= addmenu_meta;
|
|
|
|
|
menu3= tb__select;
|
|
|
|
|
menu4= tb_edit;
|
|
|
|
|
menu5= tb_transform_editmode2;
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit->type==OB_ARMATURE) {
|
|
|
|
|
menu1= tb_obdata;str1= "Armature";
|
|
|
|
|
menu2= addmenu_armature;
|
|
|
|
|
menu3= tb__select;
|
|
|
|
|
menu4= tb_edit;
|
|
|
|
|
menu5= tb_transform_editmode2;
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit->type==OB_LATTICE) {
|
|
|
|
|
menu1= tb_empty;str1= "Lattice";
|
|
|
|
|
menu2= tb_empty;
|
|
|
|
|
menu3= tb__select;
|
|
|
|
|
menu4= tb_edit;
|
|
|
|
|
menu5= tb_transform_editmode1;
|
|
|
|
|
}
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
2007-09-10 19:32:44 +00:00
|
|
|
else if (FACESEL_PAINT_TEST) {
|
2006-06-27 11:55:33 +00:00
|
|
|
menu3 = tb_face_select;
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
else if(curarea->spacetype==SPACE_NODE) {
|
|
|
|
|
SpaceNode *snode= curarea->spacedata.first;
|
|
|
|
|
|
|
|
|
|
if(snode->treetype==NTREE_COMPOSIT)
|
|
|
|
|
menu1= tb_node_addcomp;
|
|
|
|
|
else
|
|
|
|
|
menu1= tb_node_addsh;
|
|
|
|
|
str1= "Add";
|
2006-06-16 04:32:39 +00:00
|
|
|
menu2= tb_node_node; str2= "Node";
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
menu3= tb_node_select; str3= "Select";
|
|
|
|
|
menu4= tb_node_transform; str4= "Transform";
|
|
|
|
|
menu5= tb_node_view; str5= "View";
|
|
|
|
|
|
|
|
|
|
if(snode->treetype==NTREE_SHADER) {
|
2006-11-24 22:12:24 +00:00
|
|
|
menu1[0].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_INPUT);
|
|
|
|
|
menu1[1].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OUTPUT);
|
|
|
|
|
menu1[2].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_COLOR);
|
|
|
|
|
menu1[3].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_VECTOR);
|
|
|
|
|
menu1[4].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_CONVERTOR);
|
|
|
|
|
menu1[5].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP);
|
2008-02-09 23:17:15 +00:00
|
|
|
menu1[6].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_DYNAMIC);
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
}
|
|
|
|
|
else if(snode->treetype==NTREE_COMPOSIT) {
|
2006-11-24 22:12:24 +00:00
|
|
|
menu1[0].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_INPUT);
|
|
|
|
|
menu1[1].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OUTPUT);
|
|
|
|
|
menu1[2].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_COLOR);
|
|
|
|
|
menu1[3].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_VECTOR);
|
|
|
|
|
menu1[4].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_FILTER);
|
|
|
|
|
menu1[5].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_CONVERTOR);
|
2006-12-31 00:28:46 +00:00
|
|
|
menu1[6].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_MATTE);
|
|
|
|
|
menu1[7].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_DISTORT);
|
|
|
|
|
menu1[8].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP);
|
2008-02-09 23:17:15 +00:00
|
|
|
menu1[9].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_DYNAMIC);
|
2006-12-31 00:28:46 +00:00
|
|
|
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dx= 96;
|
|
|
|
|
tot= 5;
|
|
|
|
|
|
|
|
|
|
}
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
|
|
|
|
getmouseco_sc(mval);
|
|
|
|
|
|
|
|
|
|
/* create the main buttons menu */
|
|
|
|
|
if(tot==6) {
|
2003-10-29 00:23:16 +00:00
|
|
|
|
|
|
|
|
/* check if it fits */
|
|
|
|
|
if(mval[0]-1.5*dx+tb_mainx < 6) mval[0]= 6 + 1.5*dx -tb_mainx;
|
|
|
|
|
else if(mval[0]+1.5*dx+tb_mainx > G.curscreen->sizex-6)
|
|
|
|
|
mval[0]= G.curscreen->sizex-6-1.5*dx-tb_mainx;
|
|
|
|
|
|
|
|
|
|
if(mval[1]-20+tb_mainy < 6) mval[1]= 6+20 -tb_mainy;
|
|
|
|
|
else if(mval[1]+20+tb_mainy > G.curscreen->sizey-6)
|
|
|
|
|
mval[1]= G.curscreen->sizey-6-20-tb_mainy;
|
|
|
|
|
|
2004-10-26 12:52:20 +00:00
|
|
|
but=uiDefBlockBut(block, tb_makemenu, menu1, str1, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_RIGHT);
|
2007-04-29 10:49:02 +00:00
|
|
|
uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)-5);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2004-10-26 12:52:20 +00:00
|
|
|
but=uiDefBlockBut(block, tb_makemenu, menu2, str2, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
uiButSetFlag(but, UI_MAKE_TOP);
|
2007-04-29 10:49:02 +00:00
|
|
|
uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)-5);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2004-10-26 12:52:20 +00:00
|
|
|
but=uiDefBlockBut(block, tb_makemenu, menu3, str3, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_LEFT);
|
2007-04-29 10:49:02 +00:00
|
|
|
uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)-5);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2004-10-26 12:52:20 +00:00
|
|
|
but=uiDefBlockBut(block, tb_makemenu, menu4, str4, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_RIGHT);
|
2007-04-29 10:49:02 +00:00
|
|
|
uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)5);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2004-10-26 12:52:20 +00:00
|
|
|
but=uiDefBlockBut(block, tb_makemenu, menu5, str5, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
uiButSetFlag(but, UI_MAKE_DOWN);
|
2007-04-29 10:49:02 +00:00
|
|
|
uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)5);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2004-10-26 12:52:20 +00:00
|
|
|
but=uiDefBlockBut(block, tb_makemenu, menu6, str6, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_LEFT);
|
2007-04-29 10:49:02 +00:00
|
|
|
uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)5);
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
} else if (tot==5 || tot==7) {
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
/* check if it fits, dubious */
|
|
|
|
|
if(mval[0]-0.25*dx+tb_mainx < 6) mval[0]= 6 + 0.25*dx -tb_mainx;
|
|
|
|
|
else if(mval[0]+0.25*dx+tb_mainx > G.curscreen->sizex-6)
|
|
|
|
|
mval[0]= G.curscreen->sizex-6-0.25*dx-tb_mainx;
|
|
|
|
|
|
|
|
|
|
if(mval[1]-20+tb_mainy < 6) mval[1]= 6+20 -tb_mainy;
|
|
|
|
|
else if(mval[1]+20+tb_mainy > G.curscreen->sizey-6)
|
|
|
|
|
mval[1]= G.curscreen->sizey-6-20-tb_mainy;
|
|
|
|
|
|
|
|
|
|
but=uiDefIconTextBlockBut(block, tb_makemenu, menu1, ICON_RIGHTARROW_THIN, str1, mval[0]+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
|
|
|
|
|
uiButSetFlag(but, UI_MAKE_RIGHT);
|
|
|
|
|
uiButSetFunc(but, store_main, (void *)-32, (void *)-5);
|
|
|
|
|
|
|
|
|
|
but=uiDefIconTextBlockBut(block, tb_makemenu, menu2, ICON_RIGHTARROW_THIN, str2, mval[0]+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
|
|
|
|
|
uiButSetFlag(but, UI_MAKE_RIGHT);
|
|
|
|
|
uiButSetFunc(but, store_main, (void *)-32, (void *)15);
|
|
|
|
|
|
|
|
|
|
but=uiDefIconTextBlockBut(block, tb_makemenu, menu3, ICON_RIGHTARROW_THIN, str3, mval[0]+tb_mainx,mval[1]+tb_mainy-40, dx, 19, "");
|
|
|
|
|
uiButSetFlag(but, UI_MAKE_RIGHT);
|
|
|
|
|
uiButSetFunc(but, store_main, (void *)-32, (void *)35);
|
|
|
|
|
|
|
|
|
|
but=uiDefIconTextBlockBut(block, tb_makemenu, menu4, ICON_RIGHTARROW_THIN, str4, mval[0]+tb_mainx,mval[1]+tb_mainy-60, dx, 19, "");
|
|
|
|
|
uiButSetFlag(but, UI_MAKE_RIGHT);
|
|
|
|
|
uiButSetFunc(but, store_main, (void *)-32, (void *)55);
|
|
|
|
|
|
|
|
|
|
but=uiDefIconTextBlockBut(block, tb_makemenu, menu5, ICON_RIGHTARROW_THIN, str5, mval[0]+tb_mainx,mval[1]+tb_mainy-80, dx, 19, "");
|
|
|
|
|
uiButSetFlag(but, UI_MAKE_RIGHT);
|
|
|
|
|
uiButSetFunc(but, store_main, (void *)-32, (void *)75);
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
|
|
|
|
|
if(tot>5) {
|
|
|
|
|
but=uiDefIconTextBlockBut(block, tb_makemenu, menu6, ICON_RIGHTARROW_THIN, str6, mval[0]+tb_mainx,mval[1]+tb_mainy-100, dx, 19, "");
|
|
|
|
|
uiButSetFlag(but, UI_MAKE_RIGHT);
|
|
|
|
|
uiButSetFunc(but, store_main, (void *)-32, (void *)95);
|
|
|
|
|
}
|
|
|
|
|
if(tot>6) {
|
|
|
|
|
but=uiDefIconTextBlockBut(block, tb_makemenu, menu7, ICON_RIGHTARROW_THIN, str7, mval[0]+tb_mainx,mval[1]+tb_mainy-120, dx, 19, "");
|
|
|
|
|
uiButSetFlag(but, UI_MAKE_RIGHT);
|
|
|
|
|
uiButSetFunc(but, store_main, (void *)-32, (void *)105);
|
|
|
|
|
}
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uiBoundsBlock(block, 2);
|
2007-12-12 11:00:39 +00:00
|
|
|
event= uiDoBlocks(&tb_listb, 0, 1);
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
|
2006-11-24 22:12:24 +00:00
|
|
|
/* free all dynamic entries... */
|
|
|
|
|
BLI_freelistN(&storage);
|
Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)
-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.
-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.
Current classes are (compositor examples):
Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes
-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
to re-use these temp files on starting Blender or loading files, showing
the last result of a render command.
The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!
-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
mywinset(curarea->win);
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-29 00:23:16 +00:00
|
|
|
void toolbox_n_add(void)
|
|
|
|
|
{
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
reset_toolbox();
|
2003-10-29 00:23:16 +00:00
|
|
|
toolbox_n();
|
2005-01-23 20:32:34 +00:00
|
|
|
}
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
|
|
|
|
|
void reset_toolbox(void)
|
|
|
|
|
{
|
|
|
|
|
if(U.uiflag & USER_PLAINMENUS) {
|
|
|
|
|
tb_mainx= -32;
|
|
|
|
|
tb_mainy= -5;
|
|
|
|
|
} else {
|
|
|
|
|
tb_mainx= 0;
|
|
|
|
|
tb_mainy= -5;
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-02-15 16:08:41 +00:00
|
|
|
|
|
|
|
|
/* general toolbox for python access */
|
|
|
|
|
void toolbox_generic( TBitem *generic_menu )
|
|
|
|
|
{
|
|
|
|
|
uiBlock *block;
|
|
|
|
|
uiBut *but;
|
|
|
|
|
TBitem *menu;
|
|
|
|
|
int dx=96;
|
2008-02-19 18:36:50 +00:00
|
|
|
short event, mval[2];
|
2008-02-15 16:08:41 +00:00
|
|
|
long ypos = -5;
|
|
|
|
|
|
|
|
|
|
tb_mainx= -32;
|
|
|
|
|
tb_mainy= -5;
|
|
|
|
|
|
|
|
|
|
mywinset(G.curscreen->mainwin); // we go to screenspace
|
|
|
|
|
|
|
|
|
|
block= uiNewBlock(&tb_listb, "toolbox", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
|
|
|
|
|
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1);
|
|
|
|
|
uiBlockSetCol(block, TH_MENU_ITEM);
|
|
|
|
|
|
|
|
|
|
getmouseco_sc(mval);
|
|
|
|
|
|
|
|
|
|
menu= generic_menu;
|
|
|
|
|
while(menu->icon != -1) menu++;
|
|
|
|
|
uiBlockSetButmFunc(block, menu->poin, NULL);
|
|
|
|
|
|
|
|
|
|
/* Add the menu */
|
|
|
|
|
for (menu = generic_menu; menu->icon != -1; menu++) {
|
2008-05-16 21:34:22 +00:00
|
|
|
if(strcmp(menu->name, "SEPR")==0) {
|
|
|
|
|
uiDefBut(block, SEPR, 0, "", mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 6, NULL, 0.0, 0.0, 0, 0, "");
|
|
|
|
|
ypos-=6;
|
2008-02-15 16:08:41 +00:00
|
|
|
} else {
|
2008-05-16 21:34:22 +00:00
|
|
|
if (menu->poin) {
|
|
|
|
|
but=uiDefIconTextBlockBut(block, tb_makemenu, menu->poin, ICON_RIGHTARROW_THIN, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, "");
|
|
|
|
|
uiButSetFlag(but, UI_MAKE_RIGHT);
|
|
|
|
|
|
|
|
|
|
uiButSetFunc(but, store_main, (void *)+32, (void *)ypos);
|
|
|
|
|
} else {
|
|
|
|
|
/* TODO - add icon support */
|
|
|
|
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, NULL, 0.0, 0.0, 0, menu->retval, "");
|
|
|
|
|
}
|
|
|
|
|
ypos-=20;
|
2008-02-15 16:08:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uiBlockSetButmFunc(block, menu->poin, NULL);
|
|
|
|
|
|
|
|
|
|
uiBoundsBlock(block, 2);
|
|
|
|
|
event= uiDoBlocks(&tb_listb, 0, 1);
|
|
|
|
|
|
|
|
|
|
mywinset(curarea->win);
|
2008-02-27 14:15:14 +00:00
|
|
|
|
|
|
|
|
reset_toolbox();
|
2008-02-15 16:08:41 +00:00
|
|
|
}
|
2008-02-23 10:33:36 +00:00
|
|
|
|
|
|
|
|
/* save or restore mouse position when entering/exiting menus */
|
|
|
|
|
void toolbox_mousepos( short *mpos, int save )
|
|
|
|
|
{
|
|
|
|
|
static short initpos[2];
|
|
|
|
|
static int tog;
|
|
|
|
|
|
|
|
|
|
if (save) {
|
|
|
|
|
getmouseco_areawin(mpos);
|
|
|
|
|
initpos[0]= mpos[0];
|
|
|
|
|
initpos[1]= mpos[1];
|
|
|
|
|
tog=1;
|
|
|
|
|
} else {
|
|
|
|
|
if (tog) {
|
|
|
|
|
mpos[0]= initpos[0];
|
|
|
|
|
mpos[1]= initpos[1];
|
|
|
|
|
} else {
|
|
|
|
|
getmouseco_areawin(mpos);
|
|
|
|
|
}
|
|
|
|
|
tog= 0;
|
|
|
|
|
}
|
|
|
|
|
}
|