bf-blender / Windows (2004/09/24) Update *fgons*

User-contributed CVS development builds. Please test and give feedback!

Moderators: jesterKing, stiv

gabio
Posts: 0
Joined: Thu Jan 15, 2004 6:41 am
Location: Canada - Québec - Sherbrooke
Contact:

bf-blender / Windows (2004/09/24) Update *fgons*

Post by gabio »

I'm blind, cause i saw such beautifull stuff! all this new stuff!
ok this is a more normal build. Enjoy it for the log if it is.
Of course i'm pointing to levon build if in adition you want the distray patch.
http://www.blender.org/modules.php?op=m ... pic&t=4665
---------------------------------
ImageImageImage
Relevant feature:
-bugfixes.
-editmesh.c refactoring
-New bpy method for World module
-Added the panel context choices in the 'Panels' menu
-Added Hos' NLA move up/down to the NLA Strip menu.
-Window.Theme: new submodule
-EditMesh refactory + undo recode
-fgons

Commit:
-jiri
Log: obj_export.py
- Cam (ideasman) improved speed of exporting
- I fixed indentation

-ton
Log:
Part one of editmesh.c refactoring. The huge file has been split in
logical parts, and include files altered to denote internal and external
functions.

include/editmesh.h: internal calls for editmesh_xxx.c files
include/BIF_editmesh.h: external calls for these files

src/editmesh.c: basic alloc/lists and in/out editmode, undo, separate
src/editmesh_lib.c: basic utility calls for all editmesh_xxx.c (no UI)
src/editmesh_add.c: add prim, add duplicate, add vertex/edge/face (UI)
src/editmesh_mods.c: selecting, transforming (UI)
src/editmesh_loop.c: loop tools like knife, loop select, loop subdiv (UI)
src/editmesh_tools.c: other tools (extrude, spin, etc) (UI)

And a new file:

src/meshtools.c: tools for Mesh outside of editmode (normals, draw flags)

-broken
Log:
Moved the 'Load UI' option from the File menu to the
fileselect window header.

-theeth
Log:
Fix for scalling bug with Stretch To constraint (practicly same bug as Track To last week, but deeper ramifications since stretch to affects scalling).

Quick description of bug: scalling armature had a weird effect on stretch to bone size.

-ton
Log:
Removed all calls to object_wave in code, and moved it into the
mesh_modifier() in deform.c.

Now wave works on top of hooks, before lattice/curve deform and armature.
But together!

-theeth
Log:
Matt's lamp submenu.

And reorganized the #includes in editobject by "modules"

-stiv
Log:
New bpy method for World module to set World for current scene:
my_world.makeActive()

Contributed by Campbell Barton (ideasman)

-eeshlo
Log:
test commit
Bugfix for anim crash with xml export and no export dir set.
Alternate relative path using blender function, but wouldn't be surprised
if it still is a problem in some cases for some (windows) users.

-broken
Log:
Added the panel context choices in the 'Panels' menu (buttons
window). Helps for vertical layouts where the tabs are off screen.
Log:
Added Hos' NLA move up/down to the NLA Strip menu. Also enabled
'Strip Properties' there again.

-ianwill
Log:
- Blender: added option 'scriptsdir' to Blender.Get();
- small updates to the docs;
- Object: small fix to getMatrix: check during_script() to avoid undesired loops; added old behavior (pre 2.34) as option: .getMatrix('oldlocal');
- tentative fix for bug #1275: scene REDRAW scriptlinks were not being executed (the call to do so was missing):
http://projects.blender.org/tracker/ind ... 9&atid=125
added the call in drawview.c, in drawview3dspace(). This causes the scriptlink to be called for each visible view3d, but that's what happens with object redraw scriptlinks, too. Anyway, this is still a test. The place was chosen based on the idea that a scene redraw scriptlink is like an object redraw one, but for all objs in the scene at once.

- Window.Theme: new submodule, to get/set theme options in Blender;
- Added the script save_theme.py (Help menu for now), to save the current theme in Blender as an executable script (currently shown in the Scripts->Misc menu).

There's more work to do for themes, like defining a proper place for them in the interface, adding documentation (for now the added script and the ones it generates can give a pretty good idea of how to use the new module), probably extending themes to support SpaceScript and so on.

-jiri
Log:
- Cam fixed bug reported by Manuel Bastioni (thanks)
- I fixed one bug too.

-ton
Log:
EditMesh refactory + undo recode

The changelog is very long... it's on the web too:
http://www.blender3d.org/cms/Mesh_editi ... 425.0.html

EditMesh refactor notes (user)

**** New selection modes

When entering Edit Mode for a Mesh, you now have the choice for three selection modes. These are shown as icons in the 3D header (hotkey is being searched for!).

- Vertex Select
Select vertices as usual, fully compatible with how previous version work

- Edge Select
Vertices are not drawn anymore, and selections happen by default on the edges. It is a true edge select, meaning that you can select three out of four edges in a face, without automatic having the 4th edge selected.

- Face Select
Instead of vertices, now selection 'points' are drawn in the face centers. Selected faces also get a colored outline, like for edges. This also is true face select, for each face individual regardless selection status of its vertices or edges.

While holding SHIFT, and press a selection mode, you can also combine the above choices. Now selection becomes mixed, and will behave as expected.
For example; in Edge+Face select mode, selecting the 4 edges of a face will select the face too.

The selection modes and optional drawing modes (like transparant faces, normals, or solid drawing) all work together. All of Blender's mesh editing tools now react to the correct selection mode as well.
Most noticeable it's in:

**** Extrude

Extruding in Edge or Face Select mode allows much more precise control over what's extruded and what should be excluded. Try for example a checker pattern selection, and extrude it.

New is the fixed translation when faces are extruded. This always follows the (averaged) face normal(s) of the old face(s), enabling much easier working in 3D views . A single 'G' (Grab) or 'R' (Rotate) or 'S' (Scale) will change transform modus as usual.

**** Other things to note

- Hiding edges/faces will also behave different based on Select Mode.
- while editing, normals of faces are updated always now
- Border select (BKEY) has 2 different rules for edges; when one edge is fully inside of the border, it will only select edges that are fully inside. Otherwise it selects each edge intersecting with the border.
- in face mode, adding vertices, edges or a circle is invisible...
- "Add monkey" now works as a normal primitive (rotated and on 3d cursor)
- Mesh undo was fully recoded, hopefully solving issues now with Vertex Keys and Groups
- Going in and out of editmode was fully recoded. Especially on larger models you'll notice substantial speed gain.

**** Todo

Add 'FaceSelect mode' functionality in EditMode, including zbuffered selection, display and editing of UV texture.

EditMesh refactor notes (coder)

**** Usage of flags in general
The "->f" flags are reserved for the editmesh.c and editmesh_lib.c core functions. Actually only selection status is there now.
The "->f1" and "->f2" flags are free to use. They're available in vertex/edge/face structs. Since they're free, check carefully when calling other functions that use these flags... for example extrude() or subdivide() use them.

**** Selection flags
EditVert: eve->f & SELECT
EditEdge: eed->f & SELECT
EditFace: efa->f & SELECT

- Selection is only possible when not-hidden!
- Selection flags are always up-to-date, BUT:
if selection mode >= SELECT_EDGE vertex selection flags can be incorrect
if selection mode == SELECT_FACE vertex/edge selection flags can be incorrect
This because of shared vertices or edges.

- use for selecting vertices:
eve->f &= SELECT
- use for selecting edges always:
void EM_select_edge(eed, 1) // 1 = select, 0 = deselect
- use for selecting faces always:
void EM_select_face(efa, 1) // 1 = select, 0 = deselect

- To set the 'f' flags in all of the data:
void EM_set_flag_all(int flag);
void EM_clear_flag_all(int flag);

- the old faceselectedOR() and faceselectedAND() are still there, but only
to be used for evaluating its vertices

**** Code hints for handling selection

If the selectmode is 'face'; vertex or edge selections need to be flushed upward. Same is true for 'edge' selection mode. This means that you'll have to keep track of all selections while coding... selecting the four vertices in a face doesn't automatically select the face anymore.

However, by using the above calls, at least selections flush downward (to vertex level). You then can call:

void EM_selectmode_flush(void);

Which flushes selections back upward, based on the selectmode setting. This function does the following:

- if selectmode 'vertex': select edges/faces based on its selected vertices
- if selectmode 'edge': select faces based its selected edges

This works fine in nice controlled situations.

However, only changing the vertex selections then still doesn't select a face in face mode! If you really can't avoid only working with vertex selections, you can use this call:

void EM_select_flush(void);

Now selection is flushed upward regardless current selectmode. That can be destructive for special cases however, like checkerboard selected faces. So use this only when you know everything else was deselected (or deselect it). Example: adding primitives.

**** Hide flags
EditVert: eve->h
EditEdge: eed->h
EditFace: efa->h

- all hide flags are always up-to-date
- hidden vertices/edges/faces are always deselected. so when you operate on selection only, there's no need to check for hide flag.

**** Unified undo for editmode

New file: editmode_undo.h
A pretty nice function pointer handler style undo. Just code three functions, and your undo will fly! The c file has a good reference.

Also note that the old undo system has been replaced. It currently uses minimal dependencies on Meshes themselves (no abuse of going in/out editmode), and is restricted nicely to editmode functions.

**** Going in/out editmode

As speedup now all vertices/faces/edges are allocated in three big chunks. In vertices/faces/edges now tags are set to denote such data cannot be freed.

ALso the hashtable (lookup) for edges uses no mallocs at all anymore, but is part of the EditEdge itself.
Log:
Little thing; added recalc normals after subdivide, for face centers.
We have to check on this all over very well.
Log:
Three bugfixes, thnx to irc testing! :)

- separate crashed
- wrong button for 'face dot' theme
- deselect vertex on mouseclick didnt work
Log:
Fix for loopcut, didn't work after reconstruct...

-broken
Log:
Fixed bug #1581, toolbox wasn't correctly opening the edit mode
transform properties panel.

-ton
Log:
- basic code for fake-polygon support (called FGon in code). Disabled now
- hide flags now save correctly in mesh, to restore after going in/out
editmode
- after an extrude, faces/edges could have wrong select flags
(only in vertex select mode)
- new rule for addfacelist(); this now copies edges too, if an example
is provided. That prevents a lot of awkward code, still testing if it
goes as desired though...
Log:
New: Fake Polygons, or Face-polygons, or FGons nicked for now.
Just select a bunch of faces (selection should be valid flat poly) and
press FKEY. Works in fact as selection-group optimizing. Nice in solid
drawmode!

Further some small additional fixes in the whole debugging process.
Found old error in loopselect for triangles, subdivision code, and
selection still.

NOTE: subdivide still works on vertex level only.
Log:
All kinds of fixes for new selection modes

- circle-select now works
- delete options for edge/face select work as to be expected.
should check on a better set of choices in menu though
- assign material / select material options work for new modes
- shift+f fill didnt leave proper select flags...
- border select on face-gones (fgons) works
- 'draw normals' and fgons works now
-------------------------------------------
a new build is available.
Last edited by gabio on Sun Sep 26, 2004 5:58 pm, edited 4 times in total.

halibut
Posts: 0
Joined: Fri Apr 25, 2003 2:02 pm
Contact:

Post by halibut »

THankyou Ton :D

lucky3
Posts: 12
Joined: Thu Oct 17, 2002 6:08 pm

Post by lucky3 »

thanks gabio and Ton! a great new build again!

NateTG
Posts: 37
Joined: Mon Oct 14, 2002 2:38 am
Location: Here

Post by NateTG »

ho-ly crap. :shock:

Bellorum
Posts: 0
Joined: Wed Jan 21, 2004 3:27 pm

Post by Bellorum »

basic code for fake-polygon support
Erm, stupid question but - what is this supposed to do?:/ In other words, what are fake polygons?
There's no such thing as democracy. There's only the tyranny of one, and the tyranny of many.

lucky3
Posts: 12
Joined: Thu Oct 17, 2002 6:08 pm

Post by lucky3 »

Erm, stupid question but - what is this supposed to do?:/ In other words, what are fake polygons?
When gabio made the build the code was disabled. But Ton has just turned on the code recently.
It is similar to NGons.

gabio
Posts: 0
Joined: Thu Jan 15, 2004 6:41 am
Location: Canada - Québec - Sherbrooke
Contact:

Post by gabio »

lucky3 wrote:
Erm, stupid question but - what is this supposed to do?:/ In other words, what are fake polygons?
When gabio made the build the code was disabled. But Ton has just turned on the code recently.
It is similar to NGons.
damn.give me 2 hours and i'm gonna update this build,i'm at school now.

ElBarto
Posts: 0
Joined: Fri Jun 11, 2004 3:24 pm
Location: Berlin
Contact:

Post by ElBarto »

Selecting Faces with Border Select Brush (BB) does not work in Edge or Face Mode.

But hey lovely stuff!!!!

What about the great boolean function appeart in the built of Jesterking:
http://www.blender.org/modules.php?op=m ... pic&t=4545

When did they arrive in Blender?

lucky3
Posts: 12
Joined: Thu Oct 17, 2002 6:08 pm

Post by lucky3 »

damn.give me 2 hours and i'm gonna update this build,i'm at school now.
No problem gabio, 2 hours and more if you need it... :D
thank you!

TorQ
Posts: 29
Joined: Wed Jan 29, 2003 2:03 am

Post by TorQ »

I think I ran into a bug in edit mode. Try hiding verts in a mesh and then select all with the AKEY then delete the verts. Now unhide the hidden verts and you will see they are no longer there. It appears that the hidden verts are deleted as well. There is also a bug I have seen for a while but I am having a hard time repeating. Sometimes the join tri poly function switches from J to ALT J. This happens a lot but I can pinpoint what exactly causes it.

One feature request while the mesh code is being worked on is vertex snapping. Using merge at the cursor is getting so tedious! :)

Thanks so much all for this amazing work!! Go TEAM!

TorQ

ElBarto
Posts: 0
Joined: Fri Jun 11, 2004 3:24 pm
Location: Berlin
Contact:

Post by ElBarto »

There are some bugs when you switching between UV/Face Select and Edit modes, the selection of faces in UV Face Select is not synchron to selection in Edit Mode when selecting new faces in UV Face Select.

gabio
Posts: 0
Joined: Thu Jan 15, 2004 6:41 am
Location: Canada - Québec - Sherbrooke
Contact:

Post by gabio »

Updated, now we got fgons. it's usefull for the new selection mode , from what i can see. so you can group coplanar face to work on one big "face" for exemple.

thoro
Posts: 15
Joined: Thu Oct 17, 2002 10:20 am
Location: Berlin, Germany
Contact:

Post by thoro »

Yeah! This is a great improvement - thank you very much.

HiNMity
Posts: 3
Joined: Thu Oct 17, 2002 11:01 pm
Contact:

Post by HiNMity »

This is very good news. Thanks a lot all of you developers involved.

TorQ
Posts: 29
Joined: Wed Jan 29, 2003 2:03 am

Post by TorQ »

I seem to have run into another bug. Portions of a mesh in edit mode show only as wireframe. To repeat this do the following: hide a portion of the mesh and then exit edit mode with it still hidden, reenter edit mode and unhide the mesh, exit edit mode, and then reenter edit mode. The parts that were hidden now draw wireframe in shaded view. I can get the faces to appear by pressing ALT H. You have to do this everytime you exit and enter edit mode. I have reproduced this a couple of times but it would be helpful if someone else could verify... Thanks.

TorQ

Post Reply