devolution

Author Topic: General Discussion  (Read 3816112 times)

0 Members and 13 Guests are viewing this topic.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #9510 on: February 25, 2017, 07:50:32 AM »
Ohhkey, I added the dicts to base classes. Not sure where exactly to add them in jobs rpy.

Offline picobyte

  • Jr. Member
  • **
  • Posts: 75
Re: General Discussion
« Reply #9511 on: February 25, 2017, 07:51:17 AM »
Sorry I didn't get back here for a while. I was ill for a week and thereafter had to do a lot at my work - didn't feel like doing coding in my free time. I cannot promise to keep working on this project forever so maybe it is best to share the blender file and the way I create the objects for the dungeon in the 3d orientations.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #9512 on: February 25, 2017, 09:23:37 AM »
Sure, it will help.

Xela, what's the deal with the recent BR closed update containing tags "bad news" and "refund"? And right after the promise to release the beta 28 Feb, no less. Is it because of your writer or something?
« Last Edit: February 25, 2017, 09:27:57 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #9513 on: February 25, 2017, 12:11:44 PM »
Writer left a while back and there doesn't seem to be a way to beat all systems into shape before 28th. I don't think it will be a long delay, but there will be a delay.
Like what we're doing?

Offline picobyte

  • Jr. Member
  • **
  • Posts: 75
Re: General Discussion
« Reply #9514 on: February 25, 2017, 12:21:59 PM »
blender zip is shared here: here, below a small tutorial how I created objects in all orientations.

Create your object, (usually) within the confines of a block (i.e. mossy or bluegray object)
In this case the object (ring) was resized/positioned to lie within the alcove of the mossy_inset object.

When happy with the result I do the rendering, which requires four copy/paste actions.

First In the blender python console: I copy/paste:
Code: [Select]
import os

#adapt these:
dungeon_dir = 'P:\\ath\\to\\PyTFall\\game\\content\\dungeon\\'

# what objects you want to render, there can be multiple. These objects will be moved about.
tgts=["ring"]

# a tag to append to the folder name
tag="ring"

# the light indication to use in the folder name, either '' (dark) or '_torch' (light)
light=''

# Also make sure that only for the objects below the `camera' is set (in outliner - to ensure these are rendered only)
# - the object you want to draw (here: ring)
# - Camera
# - The light you want to render (for the red stones: mossy_dark or mossy_light)

Next, to store the original locations of the to-be rendered objects:
Code: [Select]
sc = bpy.data.scenes["render"]
bpy.context.screen.scene = sc
origloc = {}
for obj in sc.objects:
    if any(obj.name[:len(t)] == t for t in tgts):
        origloc[obj.name] = [obj.location[0], obj.location[1]]

Then copy/paste code below to start the rendering. This takes a while and blender seems to stall. There should be files created in your output folder. In case you want to stop it, create a file named 'blender_break' in your dungeon_dir. Blender stops right after the next image.
Code: [Select]
distal = {"b": 2, "c": 4 }
for depth in range(0, 6):
    y = (depth-1)*2
    for side in ["left%dc", "left%db", "left%d", "front%d", "right%d", "right%db", "right%dc"]:
        x = 2 if side != "front%d" else 0
        dir = dungeon_dir
        if os.path.isfile(dir+"blender_break"):
            continue
        filename = os.path.join(dungeon_dir + tag + light, "dungeon_" + tag + light + "_" + side % depth)
        if os.path.isfile(filename+".png"):
            print(filename+" exists")
            continue
        if x:
            if side[-1] in distal:
                v = distal[side[-1]]
                if depth < v:
                    continue
                x += v
            if side[:4] == "left":
                x = -x
        for obj in sc.objects:
            if not obj.name in origloc:
                continue
            if x:
                if side[:4] in obj.name:
                    obj.hide_render = True
                    obj.hide = True
                    continue
            elif "left" in obj.name or "right" in obj.name:
                obj.hide_render = True
                obj.hide = True
                continue
            obj.hide_render = False
            obj.hide = False
            obj.location[0] = origloc[obj.name][0] + x
            obj.location[1] = origloc[obj.name][1] + y
            bpy.context.screen.scene = sc
            bpy.context.scene.objects.active = obj
            obj.select = True
        bpy.data.scenes["render"].render.filepath = filename
        bpy.ops.render.render(write_still=True)

And finally, to restore the image to the original state, copy/paste:
Code: [Select]
sc = bpy.data.scenes["render"]
bpy.context.screen.scene = sc
for obj in sc.objects:
    print(str(obj.name))
    if not obj.name in origloc:
        continue
    if "left" in obj.name or "right" in obj.name:
        obj.hide_render = True
        obj.hide = True
        continue
    obj.hide_render = False
    obj.hide = False
    obj.location[0] = origloc[obj.name][0]
    obj.location[1] = origloc[obj.name][1]
    bpy.context.screen.scene = sc
    bpy.context.scene.objects.active = obj
    obj.select = True


« Last Edit: February 25, 2017, 10:09:47 PM by picobyte »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #9515 on: February 25, 2017, 12:44:48 PM »
Thnx.

I keep trying to fix next day after moving some code around but game just keeps crashing... prolly went a bit too aggressive on refactoring jobs.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #9516 on: February 25, 2017, 01:29:45 PM »
blender zip is shared here: here, below a small tutorial how I created objects in all orientations.
I get 404 error trying to download it  ::)

Offline picobyte

  • Jr. Member
  • **
  • Posts: 75
Re: General Discussion
« Reply #9517 on: February 25, 2017, 01:58:34 PM »
I get 404 error trying to download it  ::)

It seems it gets deleted right after the download. I sent you a PM with a new link.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #9518 on: February 25, 2017, 02:00:36 PM »
Got it, thanks.

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #9519 on: February 26, 2017, 05:26:13 AM »
can i also get that blender file.. as i said before im not so good with background that looks good enough for my girls renders..

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #9520 on: February 26, 2017, 05:51:51 AM »
I pmed you the link from my dropbox.

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #9521 on: February 26, 2017, 07:42:26 AM »
Thnx dark..


Ok nm i see what you want you can get out of those renders but its not as highly detailed as i expected.. there are some free resource out there for walls that looks great with bricks volume or crevasse/cracks into walls and with diffuse/norm/spec/AO maps provided


if i had python skills for blender i could generate all this but its not the case atm.. same for my girls renders.. im using some badly made scripts to get Daz models in but lots of problem.. and i added the correcting morphs manually and they work with drivers so i never wave something ugly when extreme posing something..
(but i could use a script that does all that.. load every morph target/bone axis + and - then assign the required drivers)
« Last Edit: February 26, 2017, 07:49:04 AM by lamoli »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #9522 on: February 26, 2017, 08:41:30 AM »
OK... I killed all changes made yesterday and today after somehow getting to the point where Ren'Py claimed there was an error on an empty line :D Gonna do the same thing but in small bits and getting everything to run correctly every time I move methods around.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #9523 on: February 26, 2017, 10:21:33 AM »
if i had python skills for blender i could generate all this but its not the case atm.. same for my girls renders.. im using some badly made scripts to get Daz models in but lots of problem.. and i added the correcting morphs manually and they work with drivers so i never wave something ugly when extreme posing something..
(but i could use a script that does all that.. load every morph target/bone axis + and - then assign the required drivers)
I suppose Xela can handle it if you explain what you need clearly and in details.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #9524 on: February 26, 2017, 10:45:31 AM »
I suppose Xela can handle it if you explain what you need clearly and in details.

I already offered without a reply. In either case, we'd have to come up with some form of a chat to coop on that level, like Discord or Skype.


What we did with wages in Alpha is almost comical, it's so needlessly complicated and confusing, with code being all over the place... guess it was coded really, really long time ago.
Like what we're doing?