Topic: Blender 2.5 Alpha2
Kiscsirke |
Posted at: 2011-04-25, 22:14
Oh, and one question as well: In the old script for player colors, if an object had no materials, it was turned black, and if an object was in the Group 'PlayerColor', it was whited out. Is it OK if I consider these behaviours deprecated, and expect all objects to have a material, and that player color is represented only by material? It seems to me that those old possibilities aren't used too much (at all?) and they are more ugly, so I would gladly deprecate them, but if they are needed, I think I can code them Top Quote |
chuckw Topic Opener |
Posted at: 2011-04-25, 23:56
@Kiscsirke I will most happily check out your (Python 3?) script! It is very good to hear from you again. To my knowledge of the existing Blender models, player color is currently invoked only via materials, so I believe it would indeed be feasible to deprecate the old behaviors in the rendering script(s). Besides, at this juncture, i.e. migration to a new version of Blender and Python, we can certainly rewrite the manual procedures for graphics development if required. I'll try to test out your script in the next day or so. Cheers! I see little people. Top Quote |
SirVer |
Posted at: 2011-04-26, 10:28
I reviewed the branch you did and it seemed good to me. However, I am not at all comfortable with the blender api to be sure. I encourage further testing Top Quote |
Kiscsirke |
Posted at: 2011-04-27, 14:52
So, here I'll reply to Chuck's post on the bugtracker, because it's gonna be pretty long, and I think it's more permanent on the forum than on the bugtracker. But first, some technical details (Prepare for long rant. Concrete problems will be at the end )
I think so far no one is comfortable with the new blender API, parts of it are still under development. (I just read up on it this weekend, I'm no expert myself either ) Now I want to stick with my approach, that there is only a small loader script inside the blender files, and the real script is loaded by that. This is, so if I change the script, I only need to change one file, and not all the blend files. Now, of course this didn't help, because from 2.4 to 2.5 they renamed the Blender python module from 'Blender' to 'bpy', so we need to change the inner script in all blend files, which will make a ~800 MB commit on the media bzr, but I don't think it can be helped. But the new loader script only uses that the filename is at "bpy.data.filepath", so I hope that will stay the same for some time. (Blender can try to keep track of outside files itself, but that doesn't really work when the files are moved around, for example, it thinks that I have one script at 'C:/Users/Chuck/...', that's why this loader script is needed.) One new thing with the new version is, that if you 'Register' a script, it runs when you load the file (which puts in the menu in the Render box). This could be a security vulnerability, they say, but I don't think that's too serius, beacuse
Sooo I don't think this is a problem, but I thought it fair to warn you One more thing, I'm almost sure I can make a script in blender/python that changes the "old" inner scripts to the new one in all the .blend files, so that wouldn't need to be done by hand. ProblemsAnd now for the actual problems and possible solutions, in order of importance and the chance that I'll solve them
Top Quote |
chuckw Topic Opener |
Posted at: 2011-04-27, 16:25
I agree with SirVer and don't see value in pursuing a migration in earnest until the Blender API is finally stable. However, what we are learning through Kiscsirke's exercise is most valuable indeed and will help in the formulation of a final conversion/migration strategy.
Very true. Well, I'd likely run it ONCE anyway.
Perhaps there are additional measures that can be taken to secure the scripts if this exposure is considered untenable, but this IS open source after all.
Bless your heart.
Of the options mentioned, I think I would prefer a post-processing procedure that would mitigate the need for altering anything but the python code in the models. In fact, I have done batch renames of rendered files for certain models from which I wished to use a subset of the total renderings (mostly out of ignorance of features that may be inherent within Blender itself.) There are freeware utilities we could use or if need be perhaps someone could write a stand-alone Python script.
Hurrah!!
I wouldn't want you to waste calories on this one. The console should be adequate. I see little people. Top Quote |
SirVer |
Posted at: 2011-04-28, 06:32
Hi,
I agree that this is the way to go. The one big commit can't be helped. Maybe we should add documentation for --lightweight checkouts for bzr which work a lot like SVN (you only load one commit and you need internet access for pretty much everything you do in the repo)
This risk is negligible for us as far as I understand. A maliciously crafted script would need to make it into our repository. The same danger is in widelands itself: every developer could try to sneak malicious code into widelands and commit it. So we shouldn't worry too much. I agree though that this is quite a strange approach from the blender people to 'registering' scripts. Will not be long before we have Blender Macro viruses in the open I guess.
I support the approach of calling blenders rendering function instead of manually rendering everything. Good work! Nice to see some progress here already Holger Edited: 2011-04-28, 06:32
Top Quote |
chuckw Topic Opener |
Posted at: 2011-08-21, 19:48
Once again, I apologize for dropping out of site for a while, but I'm back and I would like to hear if anyone knows the current status of the Blender 2.5x Python API. I have just posted in another thread that I will now consider accepting work from non-2.49 Blender models. Are we any closer to migration? I see little people. Top Quote |
kingcreole |
Posted at: 2011-08-22, 10:10
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/changelog_259#Python_API: only 3 lines changed since last blender release and the warning changed from red to white saying
live is my dancefloor as long as my lag works Top Quote |
kingcreole |
Posted at: 2011-08-22, 10:11
heres the link: http://www.blender.org/documentation/blender_python_api_2_59_0/ live is my dancefloor as long as my lag works Top Quote |
Kiscsirke |
Posted at: 2013-01-22, 02:18
Wow, I dropped out of the site for a short while too, eh? Are you still here Chuck? Aaanyway, I did it! I added the rotation, made a script to change it in all the .blend files, and ran it. The results are here. The python interface did indeed still change a bit since 2.57, but that only needed like 2-3 lines of change. This works with 2.65 now. There were a few files I couldn't change, because they had external dependencies that weren't checked in to bzr. For example, Chuck, you didn't check in the textures like "\media\tribes\atlanteans\texture\00003.jpg" for the atlantean buildings, so most atlantean buildings are 1) missing their wood texture, 2) have the old script because I couldn't change them. Also two empire buildings missed files like "C:\home\alexiade\storage\widelands\empire_forester_1.png". But everything else worked, so for example all workers and animals and such! There were also some conversion messages displayed by blender, like "?????? Texture couldn't be updated, look in Help for how to do it", but I think that can be handled if those exact files are ever needed? So, anyway, sorry for the long absence, take a look and merge if you like. I'll try to stay present for a while here PS.: Also, sadly the file sizes also increased from the version conversion, my branch is now almost 5 GB (with the bzr extra), I don't know how that could be helped Top Quote |