Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Rotating on Y axis like Map Object (Plane)
#1
(03-09-2023, 11:47 PM)Ofnuts Wrote: Map object is not unusable (or even that hard to understand).... until you want to map something to an existing cylinder in your image, that elicits considerable amounts of trial and error, first for the size/position/rotation, then for the lighting. If/when they redo Map object with a live preview on the canvas then things will be a lot easier.

I have been looking to map the y axis of plane mode via a python script
any help would be greatly appreciated

specifically try to get orientaion y to rotate(-180, 180, 5)
but all attempts so far have given the incorrect results. I can do this manually but when i need to create so many layers it becomes too time consuming. 

her is the last script i tried:

'''
import math
from gimpfu import *

def rotate_image_on_y(image, drawable):
    for angle in range(-180, 185, 5):
        # Create a duplicate of the drawable (layer)
        duplicate_layer = pdb.gimp_layer_new_from_drawable(drawable, image)
        
        # Add the duplicate layer to the image
        pdb.gimp_image_insert_layer(image, duplicate_layer, None, -1)
        
        # Rotate the duplicate layer on the Y-axis
        pdb.gimp_item_transform_rotate(duplicate_layer, math.radians(angle), True, 0, 0)

    pdb.gimp_displays_flush()

register(
    "rotate_image_on_y",
    "Rotate Image on Y-Axis",
    "Rotate image on the Y-axis",
    "Your Name",
    "Your Name",
    "2023",
    "<Image>/Filters/MyScripts/Rotate Image on Y-Axis",
    "*",
    [],
    [],
    rotate_image_on_y)

main()

'''
Reply


Messages In This Thread
[split] Rotating on Y axis like Map Object (Plane) - by nachocoin - 06-08-2023, 03:47 PM
RE: ofn-path-to-cylinder - by Ofnuts - 06-08-2023, 05:39 PM
RE: ofn-path-to-cylinder - by nachocoin - 06-08-2023, 06:17 PM
RE: ofn-path-to-cylinder - by Ofnuts - 06-09-2023, 08:04 AM

Forum Jump: