A couple of simple feature suggestions added

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

Post Reply
Doogs
Posts: 41
Joined: Wed Oct 16, 2002 1:16 am

A couple of simple feature suggestions added

Post by Doogs »


thorax
Posts: 320
Joined: Sun Oct 27, 2002 6:45 am
Contact:

Re: A couple of simple feature suggestions added

Post by thorax »

Doogs wrote:Hi,

Not sure if the coders usually mull over the tracking lists, I'll link them from here:

http://projects.blender.org/tracker/ind ... 9&atid=128
If you have the source code, look at editobject.c in
edit_mods, specifically "enter_editmode"
you will notice that when an object is
edited, the "G.obedit" attribute is set to the object type
being edited.. And "G.eded" is a global reference to
the object being edited..

What this means is that when you enter an edit mode, the edit mode is specific to the object, not independent, so to have a multi-object
edit mode, there will need to be another level of indirection..

If blender had been done in C++, there would only need to
be a method for each object that edits the object, then
the edit mode would only need to know a basic subset of
what is needed to edit the object, and check each object's type
before performing the function needing to edit it..

This still can be done in Blender, but it may be made more complex considering that each object has its own transformation matrix (transformation matrices allow parenting to occur, otherwise all objects would be in the same absolute universe).. So it may be harder than you
think..

I think a good go between to solve your problem specifically would
be to allow a object selection mode in group edit mode, so that
the G.eded variable can be changed to match the specific object being
edited, or to have functions that modify the objects as group and
set the globals depending on the object being currently modified.. I
don't know how the problem of the transformation matrices would be handled, particularly if some objects may be multi-parented.. Even
C++ wouldn't get us away from this problem, it has to do with how the
objects you see get there in the first place.. In OpenGL every object is
created in an absolute universe then is applied to some transformation matrices that move the object into space, scale it, rotate it.. And then
its projected into 2D so you can see it on your monitor. To move the object in its own space, what may go on, once you enter edit mode
is the object is transformed into the edit space, you make your modifications, and then an inverse transformation matrix is applied to return it to where it was, and then back again..

It may or may not be this complex, I'm not very familiar with matrix math, but it may shed light on why youa re nto getting an instant response to the solution..
This would be easier.. But I think what you want is a axis toggle
mode, like there is in Maya.. That would be more useful.. I like
blender's current constrained movement option based on the current
orientation.. I personally don't like having to specify the axis
because it causes work to be dependent on a particular orientation,
and its easier to create stuff if you are not having be constantly aware of what is X,Y, and Z.. In Maya you will find a lot of users designing
their objects to be viewed from positive X,Y and Z whereas in blender
any quadrant is your choice, any orientation is possible.. Also
in Maya if you move something on the X axis, if you are behind the object
the object moves in the opposite direction of your mouse, this is unintuitive, unless you really want to do this.. So it should be possible,
but I would suggest maybe something like a constrained movement in a
plane that is aligned with the object oriented to the current viewing
plane, like it is now for a single axis constrain.. So if you view your object
from the front, you could constrain the object to move in one or two axis
adjacent to your view.. This would be easier and more intuitive..

To specify precise X,Y, Z locations, it might be more precise and intuitive to do this as a combined interactive mode on the numeric entry
requester that allows you to increase/descrease X,Y,Z values and
watch the changes made to the object in the foreground.. As well as
to be able to move the numeric entry window move about..

Blender frees stuff upon loading.. So if you save something
out or a blender file is saved out, the stuff is not lost it
is still in the file.. Its freed up upon reading it in again,
so if something is twice indirectly owned and you delete it,
it may take it a while for the object to be deleted.. Objects
are saved unused and then upon loading are not read in (this is
the same as deletion, but probably better because you could conceivable retrieve what you lost upon using a file as a library, which is possible)..
When you delete stuff it offers the problem of if you traverse a data structure that has missing information, there is a greater chance for
crash or a memory leak, or something not getting saved into the file
that is a part of the file.. Like if you deleted an object and that
deleted its material, if the material was being used by another object, code not adequately designed to handle the case where an object doesn't have a material or the material pointer is no longer pointing to a material, then you will have a program crash. In blender, stuff is never deleted, its unlinked.. When its read in, its not read in.. Get it?

The source code for handling of blend files, I looked is in
blenloader/intern , in the sources..

Its possible I guess to have stuff deleted if you somehow have
a piece of memory and use the file save functions to write to the memory, read from it, write, read until the object you want to delete is gone, but this would be the same as what you are trying to do..

I suppose it will be pretty easy to implement, it would probably just be a matter of doing the operation enough to satisfaction, maybe we could call it the shredder..

Pol
Posts: 15
Joined: Wed Oct 16, 2002 3:41 pm
Location: Mons
Contact:

Post by Pol »

I did the

http://projects.blender.org/tracker/ind ... 9&atid=128

thingie.

I just wait to have some times to emerge it in the blender tree.

Oops ... I should first ask how to write in the cvs :)

Cya peeps

-pol-

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

Post by TorQ »

Cool! While I am already quite comfortable with constrianing axis movement with the middle mouse button I think that implementing the constrain feature as you have done is much more efficient than manipulator proposed elsewhere. Thanks.

TorQ

Money_YaY!
Posts: 442
Joined: Wed Oct 23, 2002 2:47 pm

Post by Money_YaY! »

Pol wrote:I did the

http://projects.blender.org/tracker/ind ... 9&atid=128

thingie.

I just wait to have some times to emerge it in the blender tree.

Oops ... I should first ask how to write in the cvs :)

Cya peeps

-pol-
create a patch.
But also please post the code and updated files on how you did it so I may try to hack it into tuhopuu. Please ^v^

matt_e
Posts: 410
Joined: Mon Oct 14, 2002 4:32 am
Location: Sydney, Australia
Contact:

Post by matt_e »

Pol wrote:I did the
http://projects.blender.org/tracker/ind ... 9&atid=128
thingie.
I just wait to have some times to emerge it in the blender tree.
Oops ... I should first ask how to write in the cvs :)
Great work, Pol! Just join the bf-committers mailing list and send in the patch.

I don't know if this is easy or not, but since you've just been going through that code, I'll ask:

I notice that the code for grab/move, rotate, scale is in the format:

Code: Select all

transform('g'), transform('r'), transform('s')
Do you think it would be possible to expose this axis constraint functionality through the transform() function? So for example (just an idea from the top of my head) to move along the global X axis you would use: transform('ggx') or for the local X axis: transform('glx'), or to rotate along the global Y axis: transform('rgy') or something like that?

If we could do this, it would make it much easier to make a transform menu similar to in Wings3D: eg.

Code: Select all

Move >    Free

          Global X
          Global Y
          Global Z

          Local X
          Local Y
          Local Z

Rotate >  Free

          Global X
          Global Y
          Global Z

          Local X
          Local Y
          Local Z

Scale >   Free

          Global X
          Global Y
          Global Z

          Local X
          Local Y
          Local Z
Perhaps it may een be possible later to add options for moving along normals, user defined axes, etc.

Just some thoughts anyway :)

Pol
Posts: 15
Joined: Wed Oct 16, 2002 3:41 pm
Location: Mons
Contact:

Post by Pol »

Money_YaY! wrote:
Pol wrote:I did the

http://projects.blender.org/tracker/ind ... 9&atid=128

thingie.

I just wait to have some times to emerge it in the blender tree.

Oops ... I should first ask how to write in the cvs :)

Cya peeps

-pol-
create a patch.
But also please post the code and updated files on how you did it so I may try to hack it into tuhopuu. Please ^v^
How to create the patch ? Any idea ?

-pol-

matt_e
Posts: 410
Joined: Mon Oct 14, 2002 4:32 am
Location: Sydney, Australia
Contact:

Post by matt_e »

If you are on a unix system, or if you have cygwin installed on a windows system, then you can use the diff tool.

Use it with the command:

Code: Select all

diff -u path/to/modifiedfile.c path/to/originalfile.c > patch.txt
This will make a text file (patch.txt) with the differences between the two files inside.

If you are using CVS, you can make a patch by typing:

Code: Select all

cvs diff > ../patch.txt
from inside the root blender directory

If you're stuck, or don't have any of those tools, put your modified source file(s) online somewhere and I or someone else can make a patch for you.

Cheers

Pol
Posts: 15
Joined: Wed Oct 16, 2002 3:41 pm
Location: Mons
Contact:

Post by Pol »

broken wrote:
Pol wrote:I did the
http://projects.blender.org/tracker/ind ... 9&atid=128
thingie.
I just wait to have some times to emerge it in the blender tree.
Oops ... I should first ask how to write in the cvs :)
Great work, Pol! Just join the bf-committers mailing list and send in the patch.

I don't know if this is easy or not, but since you've just been going through that code, I'll ask:

I notice that the code for grab/move, rotate, scale is in the format:

Code: Select all

transform('g'), transform('r'), transform('s')
Do you think it would be possible to expose this axis constraint functionality through the transform() function? So for example (just an idea from the top of my head) to move along the global X axis you would use: transform('ggx') or for the local X axis: transform('glx'), or to rotate along the global Y axis: transform('rgy') or something like that?

If we could do this, it would make it much easier to make a transform menu similar to in Wings3D: eg.

Code: Select all

Move >    Free

          Global X
          Global Y
          Global Z

          Local X
          Local Y
          Local Z

Rotate >  Free

          Global X
          Global Y
          Global Z

          Local X
          Local Y
          Local Z

Scale >   Free

          Global X
          Global Y
          Global Z

          Local X
          Local Y
          Local Z
Perhaps it may een be possible later to add options for moving along normals, user defined axes, etc.

Just some thoughts anyway :)
thanks for the tips of the patch it works good.

About the mailing, this is the second times I try to register ... I don't get the confirmation email ... It think there is a problem on your side :)

Cya

Post Reply