Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#20382] Search returns both edit and object mode tools

Date:
2009-12-14 12:02
Priority:
3
State:
Closed
Submitted by:
kino (kino)
Assigned to:
Campbell Barton (campbellbarton)
Category:
None
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Search returns both edit and object mode tools
Detailed description

Hi last svn linux ubuntu 64bit with scons and Mac osx 10.5

create a primitive and enter in Edit mode
- select some vertices
- Space--> Select Inverse

all the objects (camera lamp ecc..) are selected
outside the edit mode :(

thks

Followup

Message
  • Date: 2009-12-14 21:38
  • Sender: Aurel W
  • The select inverse objects operator is also registered when editing the mesh. In fact there are two operators called "Inverse" in mesh editing mode. Should be easy to fix, just couldn't figure it out yet.
  • Date: 2009-12-14 23:07
  • Sender: Aurel W
  • Seems to be an issue, with many operators, especially with those intended to work in object mode, but also available in edit mode (Duplicate for e.g.)
  • Date: 2009-12-15 10:32
  • Sender: kino

  • Hi thanks for your reply and your effort :)
    seem bigger than expected?
    sorry i'm not a devel
    let me know if i can help in any other way

    Ciao
    kino
  • Date: 2009-12-21 12:09
  • Sender: Brecht Van Lommel
  • This is indeed a problem with many operators, many object mode operators can run in edit mode as well, though it is not very likely that you want to run them. The search tool should be made a bit more clever about this... not sure yet how.
  • Date: 2010-01-13 01:46
  • Sender: Matt Ebb
  • Do you think it would be wrong to check for object mode in the poll function? Do we want the ability do run object mode operators in edit mode (via scripting etc?) Maybe it would be useful in some cases, but I can't think of any in normal use...
  • Date: 2010-02-22 22:37
  • Sender: Elia Sarti
  • Regarding this I was thinking maybe poll functions could return a bitwise/enum value instead of a simple boolean? The value informing what level of "usage" is available.
    We'd just have to define OP_POLL_NONE to 0 and OP_POLL_ALL to 1, then all the possible values as flags, for instance OP_POLL_UI, OP_POLL_API etc, meaning the operator is valid in the UI, the operator is valid for being called from python and so on.
    This way it would be compatible with current polls (both in C and python) because of 0/1 values retaining same meaning and they could be ported as needed.
  • Date: 2010-03-14 21:36
  • Sender: Brecht Van Lommel
  • I think Elia's idea is the right one if we decide that it is a good idea to have such object mode operator work in edit mode.

    It may on the other hand be good to not even allow these to run since this may lead to unpredictable results, already if you are using operators for scripting you need to be careful about context, and it may not be a bad idea to really enforce this by only allowing edit mode operators in edit mode. Campbell, what is your opinion on this?
  • Date: 2010-03-22 11:30
  • Sender: Matt Ebb
  • Assigning to campbell for his opinion
  • Date: 2010-04-02 18:08
  • Sender: Elia Sarti
  • Hum, didn't get any e-mail about changes here, weird.

    Anyway my suggestion was more "general" than about this particular issue. I totally agree there should be strong barriers to avoid context ambiguity like running operators in modes they're not supposed to. My idea was to actually "add up" to this limit in some cases.

    For instance as of now the spacebar tool search in the 3d view is really crowded by lots of things that, although a python extension could want to execute, an user would hardly search in there. If you type for e.g. "uv" in the search you get also "Export UV layout" which technically is fine and can be executed safely but hardly someone would search for it in the 3d view. I'm sure there are also other examples.

    The reason I brought this up is that I was thinking of giving it a shot now that I have some time, but only if it makes sense to others too.
  • Date: 2010-04-03 00:30
  • Sender: Elia Sarti
  • Ok, it was pretty easy and quick to do:
    https://projects.blender.org/tracker/index.php?func=detail&aid=21888

    Relevant notes are in the link. While coding this I though of (and implemented) an additional flag that could be useful, OP_POLL_REDO, through which one can disable Operators from being re-done, which for many PyOps is often either non functional or can even cause a crash. This way we just have to make sure most common operators can be redone (for release purposes) without worrying about possible crashes because of other less used operators' with buggy redos.
  • Date: 2010-11-07 00:05
  • Sender: damir prebeg
  • This bug is still present and it's quite annoying...
  • Date: 2010-11-12 18:36
  • Sender: Ton Roosendaal
  • Hi Elia: I'm just back a bit with coding, and although I recognize the issue, it's not fully clear for me yet where to take the current poll functionality. The are issues with context too, and rna-bypasses for context. Maybe your patch solves it though. :)

    I will add your patch on the todo to check later, I prefer to have a few weeks coding to get more confident about the current state and all open issues.

    In the mean time: the issue being discussed here is still solvable with old polling. Just needed to add a proper poll for operators requiring object mode. I'll commit a fix that solves most of the annoying mixups. (at least the ones mentioned). A real good solution is on our todo!

    http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface
 

Attached Files:

No Files Currently Attached

Changes:

Field Old Value Date By
close_date2010-11-12 18:362010-11-12 18:36ton
status_idOpen2010-11-12 18:36ton
assigned_tonone2010-03-22 11:30broken
assigned_tocampbellbarton2010-03-14 21:36blendix
ResolutionNone2010-03-14 21:36blendix
assigned_tonone2010-03-14 21:36blendix
summaryselect inverse in edit mode select all the objects outside edit mode2010-02-24 17:02blendix