make object in current area in BoundBox when transform #2383

Closed
opened 2005-03-30 13:39:39 +02:00 by Guillaume Lecocq · 2 comments

%%%Hello, a french user ask if it possible,when the scene contains many faces, to draw the scene with less detail when grab, rotate, size an object or when pan, zoom, turn the view.

I made a little patch to make object in BOUNDBOX when a transform is made.
For the moment, to enable the boundbox mode, I put 2 toggle button in the view & control area.

If what I say is not clear sorry I'm not english.

Index: source/blender/makesdna/DNA_userdef_types.h


RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_userdef_types.h,v
retrieving revision 1.36
diff -u -r1.36 DNA_userdef_types.h
- source/blender/makesdna/DNA_userdef_types.h 21 Mar 2005 14:20:04 -0000 1.36
+++ source/blender/makesdna/DNA_userdef_types.h 30 Mar 2005 09:41:56 -0000
@@ -174,6 +174,7 @@

  • define USER_TWOBUTTONMOUSE 4096
  • define USER_NONUMPAD 8192
    #define USER_LMOUSESELECT 16384
    +#define USER_DRAWTYPE 32768

/* viewzom */
#define USER_ZOOM_CONT 0
Index: source/blender/src/space.c


RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v
retrieving revision 1.242
diff -u -r1.242 space.c
- source/blender/src/space.c 28 Mar 2005 14:00:49 -0000 1.242
+++ source/blender/src/space.c 30 Mar 2005 09:45:56 -0000
@@ -2452,6 +2452,19 @@
&(U.flag), 0, 0, 0, 0,
"Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)");

  •   uiDefBut(block, LABEL,0,"View when transform",
    
  •   	(xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y2label+5,mpref,buth,
    
  •   	0, 0, 0, 0, 0, "");
    
  •   uiBlockBeginAlign(block);
    
  •   uiDefButBitS(block, TOGN, USER_DRAWTYPE, B_DRAWINFO, "Normal",
    
  •   	(xpos+edgsp+(3*mpref)+(4*midsp)),y1,(mpref/2),buth,
    
  •   	&(U.flag), 0, 0, 0, 0, "Don't change the drawtype in transformation");
    
  •   uiDefButBitS(block, TOG, USER_DRAWTYPE, B_DRAWINFO, "BoundBox",
    
  •   	(xpos+edgsp+(3*mpref)+(4*midsp)+(mpref/2)),y1,(mpref/2),buth,
    
  •   	&(U.flag), 0, 0, 0, 0, "Make drawtype=BOUND_BOX when transform 			(without widgets)");
    
  •   uiBlockEndAlign(block);
    
      uiDefBut(block, LABEL,0,"Middle Mouse Button:",
      	(xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y6label,mpref,buth,
    

Index: source/blender/src/transform.c


RCS file: /cvsroot/bf-blender/blender/source/blender/src/transform.c,v
retrieving revision 1.66
diff -u -r1.66 transform.c
- source/blender/src/transform.c 29 Mar 2005 17:05:43 -0000 1.66
+++ source/blender/src/transform.c 30 Mar 2005 09:45:06 -0000
@@ -1420,11 +1420,17 @@
void Transform(int mode, int context)
{
int ret_val = 0;

  • short pmval- = {0, 0}, mval- , val, oldprop;
  • short pmval- = {0, 0}, mval- , val, oldprop,savedrawtype;
    float mati- [3];
    unsigned short event;
    char cmode = '\0';

  • if (G.vd->drawtype!=OB_BOUNDBOX){

  •   savedrawtype=G.vd->drawtype;
    
  •   G.vd->drawtype=OB_BOUNDBOX;
    
  • }

  • /* STUPID HACK, but this needs fixing right now */
    if (G.f & G_PROPORTIONAL)
    oldprop = 1;
    @@ -1754,6 +1760,7 @@

    /* send events out for redraws */

  • if (U.flag & USER_DRAWTYPE) G.vd->drawtype=savedrawtype;
    allqueue(REDRAWVIEW3D, 0);
    allqueue(REDRAWBUTSOBJECT, 0);
    scrarea_queue_headredraw(curarea);
    @@ -1762,10 +1769,13 @@
    void ManipulatorTransform(int mode)
    {
    int ret_val = 0;

  • short pmval- = {0, 0}, mval- , val;
  • short pmval- = {0, 0}, mval- , val,savedrawtype;
    unsigned short event;
  • if (G.vd->drawtype!=OB_BOUNDBOX){

  •   savedrawtype=G.vd->drawtype;
    
  •   G.vd->drawtype=OB_BOUNDBOX;
    
  • }
    /* stupid PET initialisation code /
    /
    START */
    if (Trans.propsize == 0.0f) {
    @@ -1911,6 +1921,7 @@
    }

    /* send events out for redraws */

  • if (U.flag & USER_DRAWTYPE) G.vd->drawtype=savedrawtype;
    allqueue(REDRAWVIEW3D, 0);
    allqueue(REDRAWBUTSOBJECT, 0);
    scrarea_queue_headredraw(curarea);
    Index: source/blender/src/view.c


RCS file: /cvsroot/bf-blender/blender/source/blender/src/view.c,v
retrieving revision 1.41
diff -u -r1.41 view.c
- source/blender/src/view.c 19 Mar 2005 21:08:13 -0000 1.41
+++ source/blender/src/view.c 30 Mar 2005 09:47:32 -0000
@@ -410,7 +410,7 @@
float firstvec- [x], newvec- [x], dvec[3];
float oldquat- [x], q1- [x], si, phi, dist0;
int firsttime=1;

  • short mvalball- , mval- , mvalo[2];
  • short mvalball- , mval- , mvalo- ,savedrawtype;

    /* sometimes this routine is called from headerbuttons */
    areawinset(curarea->win);
    @@ -427,7 +427,10 @@
    calctrackballvec(&curarea->winrct, mvalo, firstvec);

    /* cumultime(0); */

  • if ((G.vd->drawtype!=OB_BOUNDBOX)&&(U.flag&USER_DRAWTYPE)){
  •   savedrawtype=G.vd->drawtype;
    
  •   G.vd->drawtype=OB_BOUNDBOX;
    
  • }
    while(TRUE) {
    getmouseco_sc(mval);

@@ -582,6 +585,12 @@
/* this in the end, otherwise get_mbut does not work on a PC... */
if( !(get_mbut() & (L_MOUSE|M_MOUSE))) break;
}

  • if (U.flag & USER_DRAWTYPE){
  •   G.vd->drawtype=savedrawtype;
    
  •   scrarea_do_windraw(curarea);
    
  •   screen_swapbuffers();
    
  • }

}

short v3d_windowmode=0;
%%%

%%%Hello, a french user ask if it possible,when the scene contains many faces, to draw the scene with less detail when grab, rotate, size an object or when pan, zoom, turn the view. I made a little patch to make object in BOUNDBOX when a transform is made. For the moment, to enable the boundbox mode, I put 2 toggle button in the view & control area. If what I say is not clear sorry I'm not english. Index: source/blender/makesdna/DNA_userdef_types.h **** RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_userdef_types.h,v retrieving revision 1.36 diff -u -r1.36 DNA_userdef_types.h - source/blender/makesdna/DNA_userdef_types.h 21 Mar 2005 14:20:04 -0000 1.36 +++ source/blender/makesdna/DNA_userdef_types.h 30 Mar 2005 09:41:56 -0000 @@ -174,6 +174,7 @@ - define USER_TWOBUTTONMOUSE 4096 - define USER_NONUMPAD 8192 #define USER_LMOUSESELECT 16384 +#define USER_DRAWTYPE 32768 /* viewzom */ #define USER_ZOOM_CONT 0 Index: source/blender/src/space.c **** RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v retrieving revision 1.242 diff -u -r1.242 space.c - source/blender/src/space.c 28 Mar 2005 14:00:49 -0000 1.242 +++ source/blender/src/space.c 30 Mar 2005 09:45:56 -0000 @@ -2452,6 +2452,19 @@ &(U.flag), 0, 0, 0, 0, "Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)"); + uiDefBut(block, LABEL,0,"View when transform", + (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y2label+5,mpref,buth, + 0, 0, 0, 0, 0, ""); + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOGN, USER_DRAWTYPE, B_DRAWINFO, "Normal", + (xpos+edgsp+(3*mpref)+(4*midsp)),y1,(mpref/2),buth, + &(U.flag), 0, 0, 0, 0, "Don't change the drawtype in transformation"); + uiDefButBitS(block, TOG, USER_DRAWTYPE, B_DRAWINFO, "BoundBox", + (xpos+edgsp+(3*mpref)+(4*midsp)+(mpref/2)),y1,(mpref/2),buth, + &(U.flag), 0, 0, 0, 0, "Make drawtype=BOUND_BOX when transform (without widgets)"); + + uiBlockEndAlign(block); uiDefBut(block, LABEL,0,"Middle Mouse Button:", (xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y6label,mpref,buth, Index: source/blender/src/transform.c **** RCS file: /cvsroot/bf-blender/blender/source/blender/src/transform.c,v retrieving revision 1.66 diff -u -r1.66 transform.c - source/blender/src/transform.c 29 Mar 2005 17:05:43 -0000 1.66 +++ source/blender/src/transform.c 30 Mar 2005 09:45:06 -0000 @@ -1420,11 +1420,17 @@ void Transform(int mode, int context) { int ret_val = 0; - short pmval- [x] = {0, 0}, mval- [x], val, oldprop; + short pmval- [x] = {0, 0}, mval- [x], val, oldprop,savedrawtype; float mati- [x][3]; unsigned short event; char cmode = '\0'; + if (G.vd->drawtype!=OB_BOUNDBOX){ + savedrawtype=G.vd->drawtype; + G.vd->drawtype=OB_BOUNDBOX; + } + + /* STUPID HACK, but this needs fixing right now */ if (G.f & G_PROPORTIONAL) oldprop = 1; @@ -1754,6 +1760,7 @@ /* send events out for redraws */ + if (U.flag & USER_DRAWTYPE) G.vd->drawtype=savedrawtype; allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSOBJECT, 0); scrarea_queue_headredraw(curarea); @@ -1762,10 +1769,13 @@ void ManipulatorTransform(int mode) { int ret_val = 0; - short pmval- [x] = {0, 0}, mval- [x], val; + short pmval- [x] = {0, 0}, mval- [x], val,savedrawtype; unsigned short event; - + if (G.vd->drawtype!=OB_BOUNDBOX){ + savedrawtype=G.vd->drawtype; + G.vd->drawtype=OB_BOUNDBOX; + } /* stupid PET initialisation code */ /* START */ if (Trans.propsize == 0.0f) { @@ -1911,6 +1921,7 @@ } /* send events out for redraws */ + if (U.flag & USER_DRAWTYPE) G.vd->drawtype=savedrawtype; allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWBUTSOBJECT, 0); scrarea_queue_headredraw(curarea); Index: source/blender/src/view.c **** RCS file: /cvsroot/bf-blender/blender/source/blender/src/view.c,v retrieving revision 1.41 diff -u -r1.41 view.c - source/blender/src/view.c 19 Mar 2005 21:08:13 -0000 1.41 +++ source/blender/src/view.c 30 Mar 2005 09:47:32 -0000 @@ -410,7 +410,7 @@ float firstvec- [x], newvec- [x], dvec[3]; float oldquat- [x], q1- [x], si, phi, dist0; int firsttime=1; - short mvalball- [x], mval- [x], mvalo[2]; + short mvalball- [x], mval- [x], mvalo- [x],savedrawtype; /* sometimes this routine is called from headerbuttons */ areawinset(curarea->win); @@ -427,7 +427,10 @@ calctrackballvec(&curarea->winrct, mvalo, firstvec); /* cumultime(0); */ - + if ((G.vd->drawtype!=OB_BOUNDBOX)&&(U.flag&USER_DRAWTYPE)){ + savedrawtype=G.vd->drawtype; + G.vd->drawtype=OB_BOUNDBOX; + } while(TRUE) { getmouseco_sc(mval); @@ -582,6 +585,12 @@ /* this in the end, otherwise get_mbut does not work on a PC... */ if( !(get_mbut() & (L_MOUSE|M_MOUSE))) break; } + if (U.flag & USER_DRAWTYPE){ + G.vd->drawtype=savedrawtype; + scrarea_do_windraw(curarea); + screen_swapbuffers(); + } + } short v3d_windowmode=0; %%%

Changed status to: 'Open'

Changed status to: 'Open'
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#2383
No description provided.