Page MenuHome

Metadata: add hostname to the available metadata options
ClosedPublic

Authored by Sybren A. Stüvel (sybren) on Fri, Dec 7, 5:00 PM.

Details

Summary

Having the hostname allows us to identify which machine rendered which frame in our render farm.

This code simply uses the host's name, and doesn't do any DNS lookup of any IP address of the machine. As such, it's only usable for identification purposes, and not for reachability over a network.

Diff Detail

Repository
rB Blender

Event Timeline

Sybren A. Stüvel (sybren) edited the summary of this revision. (Show Details)

LGTM. Generally useful feature, for anyone involved into farms and movie rendering.

source/blender/blenkernel/intern/image.c
38

Try doing this before:

#ifndef NOGDI
#  define NOGDI
#endif
#ifndef NOMINMAX
#  define NOMINMAX
#endif
#ifndef WIN32_LEAN_AND_MEAN
#  define WIN32_LEAN_AND_MEAN
#endif

The thing is, Windows.h brings a LOT of cruft, which even conflicts with Blender's variables/macroses.

1583

Just FYIL There is BLI_strncpy() which guarantees null-termination. Doesn't matter here though due to the line below.

This revision is now accepted and ready to land.Fri, Dec 7, 5:06 PM
Sybren A. Stüvel (sybren) marked an inline comment as done.Fri, Dec 7, 5:12 PM
Sybren A. Stüvel (sybren) added inline comments.
source/blender/blenkernel/intern/image.c
38

Tested this, works fine with and without those, so for the sake of leanyness and meanyness I'll include it in the commit when I commit.

Lukas Stockner (lukasstockner97) added inline comments.
source/blender/blenkernel/intern/image.c
1749

Leftover debug printf?

Sybren A. Stüvel (sybren) marked 2 inline comments as done.Fri, Dec 7, 5:17 PM
Sybren A. Stüvel (sybren) added inline comments.
source/blender/blenkernel/intern/image.c
1749

Already took it out.

This comment has been deleted.
source/blender/blenkernel/intern/image.c
38

I'd also rather not see windows.h included just because you need a single function out of it, it's very heavy on the pre-processor, also the less places where there is platform specific code the better. Perhaps better to add a function to blender\source\blender\blenlib\intern\system.c which already includes the windows header

This revision was automatically updated to reflect the committed changes.
Sybren A. Stüvel (sybren) marked an inline comment as done.
Sybren A. Stüvel (sybren) marked an inline comment as done.
Sybren A. Stüvel (sybren) added inline comments.
source/blender/blenkernel/intern/image.c
38

I've created D4049 for this.