Refactor#5
Conversation
|
Hi @mattmarcin Thanks! |
|
Will review this week. Thanks for the contributions! |
|
It would be great to get these bits in |
|
Hi @mattmarcin, any progress on this topic? Thanks in advance! |
geri1245
left a comment
There was a problem hiding this comment.
Nice, changes, thanks for fixing this for 4.6!
| func _validate_paths(paths: Array) -> bool: | ||
| for path: String in paths: | ||
| if path.get_extension() == "fbx": | ||
| return true | ||
|
|
||
| return false |
There was a problem hiding this comment.
This will return true if the first file is fbx, even if the rest is not. I think, this is what you were looking for:
| func _validate_paths(paths: Array) -> bool: | |
| for path: String in paths: | |
| if path.get_extension() == "fbx": | |
| return true | |
| return false | |
| func _validate_paths(paths: Array) -> bool: | |
| for path: String in paths: | |
| if path.get_extension() != "fbx": | |
| return false | |
| return true |
Oh, I see that this is only for the context menu to appear. Still, I think that the retarget option should only be shown if only fbx files are selected. But it also works as it is 👍
|
Hey just wanted to chime in here, I've spent some time trying to get this working, I had to make 2 changes for my setup (after copying the changes in #5)
|
A couple of refactors:
EditorContextMenuPlugininstead of manually manipulating the popup menu..fbxfiles so that context menu item is added only when at least one.fbxfile is selected and not every time like it is now.to_snake_case()to use the built in logic instead of the custom made._process_fbx_file()method.