Skip to main content
fix code markdown
Source Link
HikariTW
  • 7.9k
  • 2
  • 20
  • 38

Just like we are using the middle mouse button to navigate the 3dview. When we get to the right of the 3dview, it gets back to the left

Is there an easy way to do it? Or we can just use the simple 'if else' to check when the mouse get to right and reset it to left

This is how I handle the mouse move envent in the modal, and it can only go to the edge of the window

radius: bpy.props.FloatProperty()

def modal(self, context, event): 
    if event.type == 'MOUSEMOVE':
        delta = self.first_mouse_x - event.mouse_region_x
        obj.Rad = self.radius - delta * 0.01
```

Just like we are using the middle mouse button to navigate the 3dview. When we get to the right of the 3dview, it gets back to the left

Is there an easy way to do it? Or we can just use the simple 'if else' to check when the mouse get to right and reset it to left

This is how I handle the mouse move envent in the modal, and it can only go to the edge of the window

radius: bpy.props.FloatProperty()

def modal(self, context, event): 
    if event.type == 'MOUSEMOVE':
        delta = self.first_mouse_x - event.mouse_region_x
        obj.Rad = self.radius - delta * 0.01
```

Just like we are using the middle mouse button to navigate the 3dview. When we get to the right of the 3dview, it gets back to the left

Is there an easy way to do it? Or we can just use the simple 'if else' to check when the mouse get to right and reset it to left

This is how I handle the mouse move envent in the modal, and it can only go to the edge of the window

radius: bpy.props.FloatProperty()

def modal(self, context, event): 
    if event.type == 'MOUSEMOVE':
        delta = self.first_mouse_x - event.mouse_region_x
        obj.Rad = self.radius - delta * 0.01
edited tags
Link
Ray Mairlot
  • 29.4k
  • 12
  • 105
  • 126
Source Link

Make the movemouse event back to left when get to the edge of right

Just like we are using the middle mouse button to navigate the 3dview. When we get to the right of the 3dview, it gets back to the left

Is there an easy way to do it? Or we can just use the simple 'if else' to check when the mouse get to right and reset it to left

This is how I handle the mouse move envent in the modal, and it can only go to the edge of the window

radius: bpy.props.FloatProperty()

def modal(self, context, event): 
    if event.type == 'MOUSEMOVE':
        delta = self.first_mouse_x - event.mouse_region_x
        obj.Rad = self.radius - delta * 0.01
```