Activity
Mon
Wed
Fri
Sun
Oct
Nov
Dec
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
What is this?
Less
More

Memberships

CG Python Academy (Free)

906 members • Free

14 contributions to CG Python Academy (Free)
Heed help with Export FBX operator
I'm trying to build an operator that moves selected objects to world origin (ignoring Z axis), runs 'Export FBX' operator and after execution (either finished or cancelled) the objects should move back to their original locations. The problem that 'Export FBX' is a modal operator and if I write 'move objects back' code after bpy.ops.export_scene.fbx('INVOKE_DEFAULT') , it executes right after the operator was called even if user haven't exported objects yet. So pretty much the objects should stay at world center until user clicks 'Export FBX' or 'Cancel' button because objects need to have their pivot points at the center when I import them to other programs such as Unreal. I can't wrap my head around how to do it. I was thinking of something like "if bpy.ops.export_scene.fbx('INVOKE_DEFAULT') returns {"FINISHED"} or {"CANCELLED"} -> do the thing", but it returns {"RUNNING_MODAL"} on call. Hope it makes sense :D Help please! I'll try to attach the code in comments as it says 'failed to upload an image' when I try to attach .py file here.
1 like • 3d
couldn't upload the .py file for some reason so here's pastebin https://pastebin.com/3vyndUue
Stuff I've been working on
Hello! Just wanted to show what I've been working on, it's my personal Blender QoL addon that has a ton of different functions (the overall project has 10k+ lines of code :D). I won't be able to show everything as a lot of stuff there is quite niche to what I'm doing for work but something that I feel quite proud of is a custom modal that allows to quickly copy materials/modifiers/etc from one object to another, a custom shader pie menu with useful shader node groups and a object viewport colour randomiser and selector. Huge thanks to this community and Victor for help:) I definitely enjoy working with Blender Python and now I have some other tools I want to develop but outside of Blender but that's a different journey it seems :D
Stuff I've been working on
2 likes • Jun 23
Hello!
Variable update
Hello! I have a following problem: I'm building a modal operator that gets an object's name under cursor. Inside an operator, I have a variable named '_object = None' which updates every time user runs modal or moves mouse. Then the modal does something with that variable. The problem is when I try to do something with that _object properties (for example, change objects scale by 0.5) and when user moves cursor to another object, reset that property to previous (set scale back to 1). Soo I'm not really sure how to do it :D Here's a super short structure of my code: class GetObject(bpy.types.Operator): _object = None if event.type == 'MOUSEMOVE': self.get_object() self.change_scale() def get_object(self, context, event): #bunch of code that returns object under cursor def change_scale(self, context, event): self._object.scale = 0.5 #somewhere here I assume should be code that changes previous object's scale back to 1 if get_object() returns a different object (like when user moved cursor) and here's where I stuck at, because things like if self._object != self._object don't work here unfortunately because it has to run after get_object() function to get new object reference Anyone knows how to solve this? I'm attaching full version of my modal just in case
Using Python for Adobe Photoshop
Sorry for offtopic question, but has anyone had experience developing tools for Photoshop using Python? Apparently Photoshop uses JavaScript as its main language but there's a Python API available as well. I've managed to use Python in VSCode via COM method, but I would like to make a full plugin with its own window and buttons and such. I couldn't find any info on this topic in Google so I wonder if anyone here has this experience. Thanks!
2
0
1-10 of 14
Valentyn Porada
3
20points to level up
@valentyn-porada-3111
Concept artist

Active 2d ago
Joined Jan 7, 2025
Powered by