-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added an experimental convert scripts option for godot3 export #11863
Conversation
aec1484
to
7e15835
Compare
set_opacity() conversion must use current color, not white. (If you assume that any set_opacity function is called on an object having a modulate) |
Wow
On Oct 7, 2017 10:52 PM, "Marc" <[email protected]> wrote:
set_opacity() conversion must use current color, not white. (If you assume
that any set_opacity function is called on an object having a modulate)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11863 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z23wiw1R_uxXQpVG1-ZldalaNQfweks5sqCrOgaJpZM4Pv1A4>
.
|
You could also rename "len" identifiers into "length", because "len" is now a reserved function keyword (if there is no other variable in the same scope named "length" already) |
@reduz what's going on? :D |
Another candidate is FixedMaterial -> whatever the 3.0 equivalent is. |
Also AABB -> Rect3, Matrix -> Basis, ColorFrame -> ColorRect, Mesh -> ArrayMesh |
Maybe also |
When this is discussed for merge on IRC, I'd like to suggest that it be merged directly without waiting for all the changes to be added. That way further additions to the conversion script can be contributed through subsequent PRs and help decentralise the effort. |
For opacity, you can do changes in a non-destructive way (currently you're overriding potential modulate colors) with properties:
It would still overwrite the alpha channel of a potential modulate color, but we can assume that users were not using both opacity and modulate alpha at the same time. |
7e15835
to
e1352ef
Compare
I thought about that one too, but it probably is a tricky one since you have to avoid getting false positives as len is a pretty short and common word. But I'll give it a try later.
Are these direct conversions? I haven't used them myself in gdscript, so idk.
Added :). |
@akien-mga Just fixed that modulate thing, thanks for the tip :). |
e1352ef
to
7db5398
Compare
this looks great, i think, if not implemented already, animations should also be properly fixed |
editor/editor_export_godot3.cpp
Outdated
} | ||
regexp.clear(); | ||
|
||
// Convert var.type == InputEvent.KEY => var.get_name() == "InputEventKey" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the recommended method for type checking.
Use var is InputEventKey
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixed it.
7db5398
to
cecc893
Compare
regexp.clear(); | ||
|
||
// Convert .set_opacity(var) => .modulate.a = var | ||
regexp.compile("([ \t]*)([a-zA-Z0-9_]*)[ ]*\\.set_opacity\\((.*)\\)(.*)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcelofg55 I'm doing some improvements to the script conversion, and wonder about this regexp. What's the point of [ ]*
before \\.set_opacity\\(
? Shouldn't it simply be "(.*)\\.set_opacity\\((.*)\\)(.*)"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember if there was a reason that I wrote that regexp that way, but it should work fine as you say as (.*)\\.set_opacity\\((.*)\\)(.*)
.
If enabled this option will convert gdscripts using regexp. So far it converts: